asahi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Janne Grunau via B4 Relay <devnull+j.jannau.net@kernel.org>
To: Bin Meng <bmeng.cn@gmail.com>, Marek Vasut <marex@denx.de>,
	 Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, asahi@lists.linux.dev,
	 Janne Grunau <j@jannau.net>, Hector Martin <marcan@marcan.st>
Subject: [PATCH 0/6] USB keyboard improvements for asahi / desktop systems
Date: Wed, 21 Feb 2024 08:25:00 +0100	[thread overview]
Message-ID: <20240221-asahi-keyboards-v1-0-814b2e741790@jannau.net> (raw)

Apple USB Keyboards from 2021 need quirks to be useable. The boot HID
keyboard protocol is unfortunately not described in the first interface
descriptor but the second. This needs several changes. The USB keyboard
driver has to look at all (2) interface descriptors during probing.
Since I didn't want to rebuild the USB driver probe code the Apple
keyboards are bound to the keyboard driver via USB vendor and product
IDs.
To make the keyboards useable on Apple silicon devices the xhci driver
needs to initializes rings for the endpoints of the first two interface
descriptors. If this is causes concerns regarding regressions or memory
use the USB_MAX_ACTIVE_INTERFACES define could be turned into a CONFIG
option.
Even after this changes the keyboards still do not probe successfully
since they apparently do not behave HID standard compliant. They only
generate reports on key events. This leads the final check whether the
keyboard is operational to fail unless the user presses keys during the
probe. Skip this check for known keyboards.
Keychron seems to emulate Apple keyboards (some models even "re-use"
Apple's USB vendor ID) so apply this quirk as well.

Some devices like Yubikeys emulate a keyboard. since u-boot only binds a
single keyboard block this kind of devices from the USB keyboard driver.

Signed-off-by: Janne Grunau <j@jannau.net>
---
Hector Martin (1):
      usb: kbd: Ignore Yubikeys

Janne Grunau (5):
      usb: xhci: refactor xhci_set_configuration
      usb: xhci: Set up endpoints for the first 2 interfaces
      usb: xhci: Abort transfers with unallocated rings
      usb: kbd: support Apple Magic Keyboards (2021)
      usb: kbd: Add probe quirk for Apple and Keychron keyboards

 common/usb_kbd.c             |  80 +++++++++++++++++++++++++--
 drivers/usb/host/xhci-ring.c |   5 ++
 drivers/usb/host/xhci.c      | 126 +++++++++++++++++++++++++++----------------
 include/usb.h                |   6 +++
 4 files changed, 167 insertions(+), 50 deletions(-)
---
base-commit: 37345abb97ef0dd9c50a03b2a72617612dcae585
change-id: 20240218-asahi-keyboards-f2ddaf0022b2

Best regards,
-- 
Janne Grunau <j@jannau.net>


             reply	other threads:[~2024-02-21  7:25 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  7:25 Janne Grunau via B4 Relay [this message]
2024-02-21  7:25 ` [PATCH 1/6] usb: xhci: refactor xhci_set_configuration Janne Grunau via B4 Relay
2024-02-21 12:28   ` Marek Vasut
2024-02-21  7:25 ` [PATCH 2/6] usb: xhci: Set up endpoints for the first 2 interfaces Janne Grunau via B4 Relay
2024-02-21 12:39   ` Marek Vasut
2024-02-25 15:28     ` Janne Grunau
2024-02-25 21:47       ` Marek Vasut
2024-02-26 20:42         ` Mark Kettenis
2024-02-27  7:38         ` Janne Grunau
2024-02-27 12:02           ` Marek Vasut
2024-02-21  7:25 ` [PATCH 3/6] usb: xhci: Abort transfers with unallocated rings Janne Grunau via B4 Relay
2024-02-21 12:40   ` Marek Vasut
2024-02-25 15:30     ` Janne Grunau
2024-02-21  7:25 ` [PATCH 4/6] usb: kbd: Ignore Yubikeys Janne Grunau via B4 Relay
2024-02-21 12:41   ` Marek Vasut
2024-02-25 16:07     ` Janne Grunau
2024-02-25 21:57       ` Marek Vasut
2024-02-26 20:47         ` Mark Kettenis
2024-02-27  1:20           ` Marek Vasut
2024-02-27  7:13           ` Janne Grunau
2024-02-27 12:01             ` Marek Vasut
2024-02-21  7:25 ` [PATCH 5/6] usb: kbd: support Apple Magic Keyboards (2021) Janne Grunau via B4 Relay
2024-02-21  7:25 ` [PATCH 6/6] usb: kbd: Add probe quirk for Apple and Keychron keyboards Janne Grunau via B4 Relay
2024-02-21 12:44   ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240221-asahi-keyboards-v1-0-814b2e741790@jannau.net \
    --to=devnull+j.jannau.net@kernel.org \
    --cc=asahi@lists.linux.dev \
    --cc=bmeng.cn@gmail.com \
    --cc=j@jannau.net \
    --cc=marcan@marcan.st \
    --cc=marex@denx.de \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).