[PATCH v4 0/6] USB keyboard improvements for asahi / desktop systems
Janne Grunau
j at jannau.net
Fri Apr 5 21:05:33 CEST 2024
On Fri, Apr 05, 2024 at 04:52:32PM +0200, Marek Vasut wrote:
> On 4/4/24 8:25 AM, Janne Grunau via B4 Relay wrote:
> > 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 at jannau.net>
>
> I picked the series, but CI indicates build errors, can you have a look ?
>
> https://source.denx.de/u-boot/custodians/u-boot-usb/-/pipelines/20215
The issue seems to be that the field dev in struct usb_device exists
only for DM_USB. That means we can't use dev_dbg.
Either take the following fixup patch or I can resend the series.
Thanks
Janne
-------------- next part --------------
>From 57d54303eb2b60e92bd478e4250a9cc63cfc277e Mon Sep 17 00:00:00 2001
From: Janne Grunau <j at jannau.net>
Date: Fri, 5 Apr 2024 21:00:44 +0200
Subject: [PATCH 1/1] fixup! usb: Add environment based device ignorelist
---
common/usb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/usb.c b/common/usb.c
index 44db07742e..8bc85c58b2 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -1146,7 +1146,7 @@ int usb_select_config(struct usb_device *dev)
err = usb_device_is_ignored(dev->descriptor.idVendor,
dev->descriptor.idProduct);
if (err == -ENODEV) {
- dev_dbg(dev->dev, "Ignoring USB device 0x%x:0x%x\n",
+ debug("Ignoring USB device 0x%x:0x%x\n",
dev->descriptor.idVendor, dev->descriptor.idProduct);
return err;
} else if (err == -EINVAL) {
--
2.44.0
More information about the U-Boot
mailing list