Commit fdcfaa1b02268b2899e374b35adf936c911a47eb
Committed by
Markus Klotzbuecher
1 parent
9a1d00fa47
Exists in
master
and in
54 other branches
USB event poll support
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
Showing 3 changed files with 9 additions and 1 deletions Side-by-side Diff
README
... | ... | @@ -901,6 +901,9 @@ |
901 | 901 | CONFIG_USB_CONFIG |
902 | 902 | for differential drivers: 0x00001000 |
903 | 903 | for single ended drivers: 0x00005000 |
904 | + CFG_USB_EVENT_POLL | |
905 | + May be defined to allow interrupt polling | |
906 | + instead of using asynchronous interrupts | |
904 | 907 | |
905 | 908 | - USB Device: |
906 | 909 | Define the below if you wish to use the USB console. |
common/usb_kbd.c
... | ... | @@ -129,7 +129,11 @@ |
129 | 129 | static int usb_kbd_getc(void) |
130 | 130 | { |
131 | 131 | char c; |
132 | - while(usb_in_pointer==usb_out_pointer); | |
132 | + while(usb_in_pointer==usb_out_pointer) { | |
133 | +#ifdef CFG_USB_EVENT_POLL | |
134 | + usb_event_poll(); | |
135 | +#endif | |
136 | + } | |
133 | 137 | if((usb_out_pointer+1)==USB_KBD_BUFFER_LEN) |
134 | 138 | usb_out_pointer=0; |
135 | 139 | else |
include/usb.h
... | ... | @@ -180,6 +180,7 @@ |
180 | 180 | int transfer_len,struct devrequest *setup); |
181 | 181 | int submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer, |
182 | 182 | int transfer_len, int interval); |
183 | +void usb_event_poll(void); | |
183 | 184 | |
184 | 185 | /* Defines */ |
185 | 186 | #define USB_UHCI_VEND_ID 0x8086 |