summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-05-10 19:48:59 -0700
committerMarek Vasut <marex@denx.de>2013-06-12 22:22:50 +0200
commit5da2dc9789abecb1b018beb0c93f4c38c2985bc6 (patch)
tree565dca5d5edcef646827fdfde5ae33806a16ab7e /common
parent09defbc75b46991b794f35957e986acbfe0c7946 (diff)
downloadu-boot-imx-5da2dc9789abecb1b018beb0c93f4c38c2985bc6.zip
u-boot-imx-5da2dc9789abecb1b018beb0c93f4c38c2985bc6.tar.gz
u-boot-imx-5da2dc9789abecb1b018beb0c93f4c38c2985bc6.tar.bz2
usb: workaround non-working keyboards.
If the USB keyboard is not answering properly the first request on its interrupt endpoint, just skip it and try the next one. This workarounds an issue with a wireless mouse dongle which presents itself both as a keyboard and a mouse but has a non-functional keyboard interface. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 012bbf0ce0301be2482857e3f03b481dd15c2340) Rebased to upstream/master: Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usb_kbd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 188763d..3174b5e 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -461,8 +461,13 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum)
usb_set_idle(dev, iface->desc.bInterfaceNumber, REPEAT_RATE, 0);
debug("USB KBD: enable interrupt pipe...\n");
- usb_submit_int_msg(dev, pipe, data->new, maxp > 8 ? 8 : maxp,
- ep->bInterval);
+ if (usb_submit_int_msg(dev, pipe, data->new, maxp > 8 ? 8 : maxp,
+ ep->bInterval) < 0) {
+ printf("Failed to get keyboard state from device %04x:%04x\n",
+ dev->descriptor.idVendor, dev->descriptor.idProduct);
+ /* Abort, we don't want to use that non-functional keyboard. */
+ return 0;
+ }
/* Success. */
return 1;