summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authoramartin@nvidia.com <amartin@nvidia.com>2011-12-20 14:56:16 +0000
committerWolfgang Denk <wd@denx.de>2012-03-03 16:56:29 +0100
commitf9636e8d38abde096fbb32fee5a36bbdb02b7cae (patch)
tree7b09e54faa06756e07ae31a7a9c08ee4b780492d /common
parentfb3ef649ed5cf3e5e73aea6ed161cdde37cb7a5f (diff)
downloadu-boot-imx-f9636e8d38abde096fbb32fee5a36bbdb02b7cae.zip
u-boot-imx-f9636e8d38abde096fbb32fee5a36bbdb02b7cae.tar.gz
u-boot-imx-f9636e8d38abde096fbb32fee5a36bbdb02b7cae.tar.bz2
USB: move keyboard polling into kbd driver
This moves keyboard polling logic from USB HCD drivers into USB keyboard driver. Remove usb_event_poll() as keyboard polling was the only user of this API. With this patch USB keyboard works with EHCI controllers again. Tested on a tegra2 seaboard. Signed-off-by: Allen Martin <amartin@nvidia.com>
Diffstat (limited to 'common')
-rw-r--r--common/usb_kbd.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 960a70a..19f01db 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -323,7 +323,23 @@ static int usb_kbd_irq(struct usb_device *dev)
static inline void usb_kbd_poll_for_event(struct usb_device *dev)
{
#if defined(CONFIG_SYS_USB_EVENT_POLL)
- usb_event_poll();
+ struct usb_interface *iface;
+ struct usb_endpoint_descriptor *ep;
+ struct usb_kbd_pdata *data;
+ int pipe;
+ int maxp;
+
+ /* Get the pointer to USB Keyboard device pointer */
+ data = dev->privptr;
+ iface = &dev->config.if_desc[0];
+ ep = &iface->ep_desc[0];
+ pipe = usb_rcvintpipe(dev, ep->bEndpointAddress);
+
+ /* Submit a interrupt transfer request */
+ maxp = usb_maxpacket(dev, pipe);
+ usb_submit_int_msg(dev, pipe, &data->new[0],
+ maxp > 8 ? 8 : maxp, ep->bInterval);
+
usb_kbd_irq_worker(dev);
#elif defined(CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP)
struct usb_interface *iface;