Commit e4b70d80350c1238fa07872d71c19e3ddbf53b76
Committed by
Marek Vasut
1 parent
fee331f66c
Exists in
v2017.01-smarct4x
and in
30 other branches
usb: kbd: don't use int xfers when polling via ctrl xfers
When CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP is enabled, use a GET_REPORT control transfer to retrieve the initial state of the keyboard. This matches the technique used to poll the keyboard state. This is useful since it eliminates the remaining use of interrupt transfers from the USB keyboard driver, which allows it to work with USB HCD that don't support interrupt transfers. Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff
common/usb_kbd.c
... | ... | @@ -476,6 +476,9 @@ |
476 | 476 | USB_KBD_BOOT_REPORT_SIZE, data->new, |
477 | 477 | data->intinterval); |
478 | 478 | if (!data->intq) { |
479 | +#elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP) | |
480 | + if (usb_get_report(dev, iface->desc.bInterfaceNumber, | |
481 | + 1, 0, data->new, USB_KBD_BOOT_REPORT_SIZE) < 0) { | |
479 | 482 | #else |
480 | 483 | if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize, |
481 | 484 | data->intinterval) < 0) { |