aboutsummaryrefslogtreecommitdiff
path: root/include/usb.h
diff options
context:
space:
mode:
authorJanne Grunau2024-04-04 08:25:50 +0200
committerMarek Vasut2024-04-05 03:25:14 +0200
commit086e461d9e2cc0b98a187883774fa4b8be68a0ab (patch)
tree0798ad3adb81c24ae44d9958d9445f1617ce1511 /include/usb.h
parentf1820eb4f44dfbfc16f06fbaff9ce3d9dde268f5 (diff)
usb: xhci: Set up endpoints for the first 2 interfaces
The xhci driver currently only does the necessary initialization for endpoints found in the first interface descriptor. Apple USB keyboards (released 2021) use the second interface descriptor for the HID keyboard boot protocol. To allow USB drivers to use endpoints from other interface descriptors the xhci driver needs to ensure these endpoints are initialized as well. Use USB_MAX_ACTIVE_INTERFACES to control how many interface descriptors are considered during endpoint initialisation. For now define it to 2 as that is sufficient for supporting the Apple keyboards. Reviewed-by: Marek Vasut <marex@denx.de> Reviewed-by: Neal Gompa <neal@gompa.dev> Signed-off-by: Janne Grunau <j@jannau.net>
Diffstat (limited to 'include/usb.h')
-rw-r--r--include/usb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/usb.h b/include/usb.h
index 09e3f0cb309..3aafdc8bfd1 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -49,6 +49,12 @@ extern bool usb_started; /* flag for the started/stopped USB status */
*/
#define USB_TIMEOUT_MS(pipe) (usb_pipebulk(pipe) ? 5000 : 1000)
+/*
+ * The xhcd hcd driver prepares only a limited number interfaces / endpoints.
+ * Define this limit so that drivers do not exceed it.
+ */
+#define USB_MAX_ACTIVE_INTERFACES 2
+
/* device request (setup) */
struct devrequest {
__u8 requesttype;