All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] usb: kbd: don't use int xfers when polling via ctrl xfers
@ 2015-11-13 20:34 Stephen Warren
  2015-11-14  1:16 ` Marek Vasut
  2015-11-15 19:40 ` Hans de Goede
  0 siblings, 2 replies; 9+ messages in thread
From: Stephen Warren @ 2015-11-13 20:34 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

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>
---
Are there any disadvantages to using control transfers over interrupt
transfers? I'm not aware of any, but I assume there must be a reason
that U-Boot typically uses interrupt transfers.
---
 common/usb_kbd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 95912f99c767..81c4d62c632b 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -475,6 +475,9 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
 				      USB_KBD_BOOT_REPORT_SIZE, data->new,
 				      data->intinterval);
 	if (!data->intq) {
+#elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP)
+	if (usb_get_report(dev, iface->desc.bInterfaceNumber,
+			   1, 0, data->new, USB_KBD_BOOT_REPORT_SIZE) < 0) {
 #else
 	if (usb_submit_int_msg(dev, data->intpipe, data->new, data->intpktsize,
 			       data->intinterval) < 0) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-12-16 14:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-13 20:34 [U-Boot] [PATCH] usb: kbd: don't use int xfers when polling via ctrl xfers Stephen Warren
2015-11-14  1:16 ` Marek Vasut
2015-12-15 23:35   ` Stephen Warren
2015-12-16  0:42     ` Marek Vasut
2015-12-16  2:45       ` Stephen Warren
2015-12-16 14:13         ` Marek Vasut
2015-11-15 19:40 ` Hans de Goede
2015-11-16 17:16   ` Stephen Warren
2015-11-16 17:20     ` Hans de Goede

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.