* [U-Boot] [PATCH] USB: move keyboard polling into kbd driver
@ 2011-12-21 0:56 Allen Martin
2012-01-04 19:06 ` Allen Martin
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Allen Martin @ 2011-12-21 0:56 UTC (permalink / raw)
To: u-boot
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>
---
common/usb_kbd.c | 18 +++++++++++++++++-
drivers/usb/host/ehci-hcd.c | 30 ------------------------------
drivers/usb/host/ohci-hcd.c | 6 ------
drivers/usb/host/r8a66597-hcd.c | 6 ------
drivers/usb/musb/musb_hcd.c | 28 ----------------------------
include/usb.h | 1 -
6 files changed, 17 insertions(+), 72 deletions(-)
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 75107c9..e94bb7e 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -313,7 +313,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;
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index db10316..94a5eed 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -26,10 +26,6 @@
#include <asm/io.h>
#include <malloc.h>
#include <watchdog.h>
-#ifdef CONFIG_USB_KEYBOARD
-#include <stdio_dev.h>
-extern unsigned char new[];
-#endif
#include "ehci.h"
@@ -946,29 +942,3 @@ submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
return ehci_submit_async(dev, pipe, buffer, length, NULL);
}
-#ifdef CONFIG_SYS_USB_EVENT_POLL
-/*
- * This function polls for USB keyboard data.
- */
-void usb_event_poll()
-{
- struct stdio_dev *dev;
- struct usb_device *usb_kbd_dev;
- struct usb_interface *iface;
- struct usb_endpoint_descriptor *ep;
- int pipe;
- int maxp;
-
- /* Get the pointer to USB Keyboard device pointer */
- dev = stdio_get_by_name("usbkbd");
- usb_kbd_dev = (struct usb_device *)dev->priv;
- iface = &usb_kbd_dev->config.if_desc[0];
- ep = &iface->ep_desc[0];
- pipe = usb_rcvintpipe(usb_kbd_dev, ep->bEndpointAddress);
-
- /* Submit a interrupt transfer request */
- maxp = usb_maxpacket(usb_kbd_dev, pipe);
- usb_submit_int_msg(usb_kbd_dev, pipe, &new[0],
- maxp > 8 ? 8 : maxp, ep->bInterval);
-}
-#endif /* CONFIG_SYS_USB_EVENT_POLL */
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index cf906b4..1a428e9 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -1771,12 +1771,6 @@ static int hc_start(ohci_t *ohci)
/*-------------------------------------------------------------------------*/
-/* Poll USB interrupt. */
-void usb_event_poll(void)
-{
- hc_interrupt();
-}
-
/* an interrupt happens */
static int hc_interrupt(void)
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index db611b6..aa753d8 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -908,12 +908,6 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
return 0;
}
-void usb_event_poll(void)
-{
- /* no implement */
- R8A66597_DPRINT("%s\n", __func__);
-}
-
int usb_lowlevel_init(void)
{
struct r8a66597 *r8a66597 = &gr8a66597;
diff --git a/drivers/usb/musb/musb_hcd.c b/drivers/usb/musb/musb_hcd.c
index 325edb9..db7161f 100644
--- a/drivers/usb/musb/musb_hcd.c
+++ b/drivers/usb/musb/musb_hcd.c
@@ -1265,31 +1265,3 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe,
dev->act_len = len;
return 0;
}
-
-
-#ifdef CONFIG_SYS_USB_EVENT_POLL
-/*
- * This function polls for USB keyboard data.
- */
-void usb_event_poll()
-{
- struct stdio_dev *dev;
- struct usb_device *usb_kbd_dev;
- struct usb_interface *iface;
- struct usb_endpoint_descriptor *ep;
- int pipe;
- int maxp;
-
- /* Get the pointer to USB Keyboard device pointer */
- dev = stdio_get_by_name("usbkbd");
- usb_kbd_dev = (struct usb_device *)dev->priv;
- iface = &usb_kbd_dev->config.if_desc[0];
- ep = &iface->ep_desc[0];
- pipe = usb_rcvintpipe(usb_kbd_dev, ep->bEndpointAddress);
-
- /* Submit a interrupt transfer request */
- maxp = usb_maxpacket(usb_kbd_dev, pipe);
- usb_submit_int_msg(usb_kbd_dev, pipe, &new[0],
- maxp > 8 ? 8 : maxp, ep->bInterval);
-}
-#endif /* CONFIG_SYS_USB_EVENT_POLL */
diff --git a/include/usb.h b/include/usb.h
index 06170cd..6e03ce5 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -149,7 +149,6 @@ int submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
int transfer_len, struct devrequest *setup);
int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
int transfer_len, int interval);
-void usb_event_poll(void);
/* Defines */
#define USB_UHCI_VEND_ID 0x8086
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] USB: move keyboard polling into kbd driver
2011-12-21 0:56 [U-Boot] [PATCH] USB: move keyboard polling into kbd driver Allen Martin
@ 2012-01-04 19:06 ` Allen Martin
2012-01-24 17:25 ` Allen Martin
2012-01-15 20:40 ` Remy Bohmer
2012-02-26 23:11 ` Marek Vasut
2 siblings, 1 reply; 5+ messages in thread
From: Allen Martin @ 2012-01-04 19:06 UTC (permalink / raw)
To: u-boot
> 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>
ping, anyone have any comments/feedback?
-Allen
nvpublic
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] USB: move keyboard polling into kbd driver
2011-12-21 0:56 [U-Boot] [PATCH] USB: move keyboard polling into kbd driver Allen Martin
2012-01-04 19:06 ` Allen Martin
@ 2012-01-15 20:40 ` Remy Bohmer
2012-02-26 23:11 ` Marek Vasut
2 siblings, 0 replies; 5+ messages in thread
From: Remy Bohmer @ 2012-01-15 20:40 UTC (permalink / raw)
To: u-boot
Hi,
2011/12/21 Allen Martin <amartin@nvidia.com>:
> 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>
> ---
> ?common/usb_kbd.c ? ? ? ? ? ? ? ?| ? 18 +++++++++++++++++-
> ?drivers/usb/host/ehci-hcd.c ? ? | ? 30 ------------------------------
> ?drivers/usb/host/ohci-hcd.c ? ? | ? ?6 ------
> ?drivers/usb/host/r8a66597-hcd.c | ? ?6 ------
> ?drivers/usb/musb/musb_hcd.c ? ? | ? 28 ----------------------------
> ?include/usb.h ? ? ? ? ? ? ? ? ? | ? ?1 -
> ?6 files changed, 17 insertions(+), 72 deletions(-)
Applied to u-boot-usb. Thanks.
Kind regards,
Remy
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] USB: move keyboard polling into kbd driver
2012-01-04 19:06 ` Allen Martin
@ 2012-01-24 17:25 ` Allen Martin
0 siblings, 0 replies; 5+ messages in thread
From: Allen Martin @ 2012-01-24 17:25 UTC (permalink / raw)
To: u-boot
> > 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>
>
> ping, anyone have any comments/feedback?
>
Hi, anyone want to give this patch some love so USB keyboard can work on EHCI again?
-Allen
nvpublic
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] USB: move keyboard polling into kbd driver
2011-12-21 0:56 [U-Boot] [PATCH] USB: move keyboard polling into kbd driver Allen Martin
2012-01-04 19:06 ` Allen Martin
2012-01-15 20:40 ` Remy Bohmer
@ 2012-02-26 23:11 ` Marek Vasut
2 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2012-02-26 23:11 UTC (permalink / raw)
To: u-boot
> 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>
> ---
> common/usb_kbd.c | 18 +++++++++++++++++-
> drivers/usb/host/ehci-hcd.c | 30 ------------------------------
> drivers/usb/host/ohci-hcd.c | 6 ------
> drivers/usb/host/r8a66597-hcd.c | 6 ------
> drivers/usb/musb/musb_hcd.c | 28 ----------------------------
> include/usb.h | 1 -
> 6 files changed, 17 insertions(+), 72 deletions(-)
>
Hi,
what's the status of this patch/patchset?
Thanks
M
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-26 23:11 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21 0:56 [U-Boot] [PATCH] USB: move keyboard polling into kbd driver Allen Martin
2012-01-04 19:06 ` Allen Martin
2012-01-24 17:25 ` Allen Martin
2012-01-15 20:40 ` Remy Bohmer
2012-02-26 23:11 ` Marek Vasut
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.