diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2009-05-23 14:30:20 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2009-05-23 14:30:20 +0000 |
commit | c61a75173b2e81ea3ae3aa1d3cdf84d15e4304c3 (patch) | |
tree | f9056ad1a886d1741b009a6d026b689e18040a17 /firmware/usb.c | |
parent | bca3d3dca44bbe111d8e8595932d2a9491679dab (diff) | |
download | rockbox-c61a75173b2e81ea3ae3aa1d3cdf84d15e4304c3.tar.gz rockbox-c61a75173b2e81ea3ae3aa1d3cdf84d15e4304c3.zip |
Reorganise USB stack defines. Now config.h decides which class drivers get enabled instead of usb_core.h
Also enable HID, and use that as the dummy class instead of charging-only for controllers that have working interrupt transfers.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21053 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/usb.c')
-rw-r--r-- | firmware/usb.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/firmware/usb.c b/firmware/usb.c index f115a92407..f918f19bc4 100644 --- a/firmware/usb.c +++ b/firmware/usb.c | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Conditions under which we want the entire driver */ | 48 | /* Conditions under which we want the entire driver */ |
49 | #if !defined(BOOTLOADER) || (CONFIG_CPU == SH7034) || \ | 49 | #if !defined(BOOTLOADER) || (CONFIG_CPU == SH7034) || \ |
50 | (defined(TOSHIBA_GIGABEAT_S) && defined(USE_ROCKBOX_USB) && defined(USB_STORAGE)) || \ | 50 | (defined(TOSHIBA_GIGABEAT_S) && defined(USE_ROCKBOX_USB) && defined(USB_ENABLE_STORAGE)) || \ |
51 | (defined(HAVE_USBSTACK) && (defined(CREATIVE_ZVx) || \ | 51 | (defined(HAVE_USBSTACK) && (defined(CREATIVE_ZVx) || \ |
52 | defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \ | 52 | defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \ |
53 | (CONFIG_USBOTG == USBOTG_JZ4740) | 53 | (CONFIG_USBOTG == USBOTG_JZ4740) |
@@ -270,13 +270,19 @@ static void usb_thread(void) | |||
270 | /* Only charging is desired */ | 270 | /* Only charging is desired */ |
271 | usb_state = USB_POWERED; | 271 | usb_state = USB_POWERED; |
272 | #ifdef HAVE_USBSTACK | 272 | #ifdef HAVE_USBSTACK |
273 | #ifdef USB_STORAGE | 273 | #ifdef USB_ENABLE_STORAGE |
274 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, false); | 274 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, false); |
275 | #endif | 275 | #endif |
276 | #ifdef USB_HID | 276 | |
277 | #ifdef USB_ENABLE_HID | ||
278 | #ifdef USB_ENABLE_CHARGING_ONLY | ||
277 | usb_core_enable_driver(USB_DRIVER_HID, false); | 279 | usb_core_enable_driver(USB_DRIVER_HID, false); |
278 | #endif | 280 | #else |
279 | #ifdef USB_CHARGING_ONLY | 281 | usb_core_enable_driver(USB_DRIVER_HID, true); |
282 | #endif /* USB_ENABLE_CHARGING_ONLY */ | ||
283 | #endif /* USB_ENABLE_HID */ | ||
284 | |||
285 | #ifdef USB_ENABLE_CHARGING_ONLY | ||
280 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, true); | 286 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, true); |
281 | #endif | 287 | #endif |
282 | usb_attach(); | 288 | usb_attach(); |
@@ -291,13 +297,13 @@ static void usb_thread(void) | |||
291 | * USB_CONNECTED. */ | 297 | * USB_CONNECTED. */ |
292 | usb_state = USB_POWERED; | 298 | usb_state = USB_POWERED; |
293 | #endif | 299 | #endif |
294 | #ifdef USB_STORAGE | 300 | #ifdef USB_ENABLE_STORAGE |
295 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); | 301 | usb_core_enable_driver(USB_DRIVER_MASS_STORAGE, true); |
296 | #endif | 302 | #endif |
297 | #ifdef USB_HID | 303 | #ifdef USB_ENABLE_HID |
298 | usb_core_enable_driver(USB_DRIVER_HID, true); | 304 | usb_core_enable_driver(USB_DRIVER_HID, true); |
299 | #endif | 305 | #endif |
300 | #ifdef USB_CHARGING_ONLY | 306 | #ifdef USB_ENABLE_CHARGING_ONLY |
301 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false); | 307 | usb_core_enable_driver(USB_DRIVER_CHARGING_ONLY, false); |
302 | #endif | 308 | #endif |
303 | 309 | ||