]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
USB event poll support
authorZhang Wei <wei.zhang@freescale.com>
Wed, 6 Jun 2007 08:08:13 +0000 (10:08 +0200)
committerMarkus Klotzbuecher <mk@pollux.denx.de>
Wed, 6 Jun 2007 08:08:13 +0000 (10:08 +0200)
This patch adds USB event poll support, which could be used in usbkbd
and other usb devices driver when the asynchronous interrupt
processing is supported.

Signed-off-by: Zhang Wei <wei.zhang@freescale.com
README
common/usb_kbd.c
include/usb.h

diff --git a/README b/README
index f9c1978c3bfb8a7af03d0463e9c2acb4a7d4c98d..294f0c1dce0c1ebe70b32ec10ff9255c48257c8c 100644 (file)
--- a/README
+++ b/README
@@ -901,6 +901,9 @@ The following options need to be configured:
                        CONFIG_USB_CONFIG
                                for differential drivers: 0x00001000
                                for single ended drivers: 0x00005000
+                       CFG_USB_EVENT_POLL
+                               May be defined to allow interrupt polling
+                               instead of using asynchronous interrupts
 
 - USB Device:
                Define the below if you wish to use the USB console.
index 56c21660fa006aa69d9912cb5f31ba99f0827379..aec558ad203b34a9a2a04a6091ab7b717aa4703f 100644 (file)
@@ -129,7 +129,11 @@ static int usb_kbd_testc(void)
 static int usb_kbd_getc(void)
 {
        char c;
-       while(usb_in_pointer==usb_out_pointer);
+       while(usb_in_pointer==usb_out_pointer) {
+#ifdef CFG_USB_EVENT_POLL
+               usb_event_poll();
+#endif
+       }
        if((usb_out_pointer+1)==USB_KBD_BUFFER_LEN)
                usb_out_pointer=0;
        else
index 504ccc40fc0c8f95e0a126a52132ecbe51601044..4e1539fa8820684b7c38e2cf00c283d7b6eeb07d 100644 (file)
@@ -180,6 +180,7 @@ 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