From c61a75173b2e81ea3ae3aa1d3cdf84d15e4304c3 Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 23 May 2009 14:30:20 +0000 Subject: 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 --- firmware/export/config-gigabeat-s.h | 1 - firmware/export/config-iaudio7.h | 3 --- firmware/export/config.h | 43 +++++++++++++++++++++++++++++++++++++ firmware/export/usb_core.h | 10 --------- 4 files changed, 43 insertions(+), 14 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/config-gigabeat-s.h b/firmware/export/config-gigabeat-s.h index d122edbf74..015e863fc9 100644 --- a/firmware/export/config-gigabeat-s.h +++ b/firmware/export/config-gigabeat-s.h @@ -183,7 +183,6 @@ /* enable these for the usb stack */ #define USE_ROCKBOX_USB #define HAVE_USBSTACK -#define USB_STORAGE /* usb stack and driver settings */ #define USB_PORTSCX_PHY_TYPE PORTSCX_PTS_ULPI #define USB_VENDOR_ID 0x0930 diff --git a/firmware/export/config-iaudio7.h b/firmware/export/config-iaudio7.h index 8886b18633..1e7c42258c 100644 --- a/firmware/export/config-iaudio7.h +++ b/firmware/export/config-iaudio7.h @@ -66,9 +66,6 @@ #define HAVE_USBSTACK #define USB_VENDOR_ID 0x0e21 #define USB_PRODUCT_ID 0x0750 - -#define USB_STORAGE -#define USB_SERIAL #endif /* define this if you have a flash memory storage */ diff --git a/firmware/export/config.h b/firmware/export/config.h index efaf326384..abc159e13c 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -540,6 +540,7 @@ Lyre prototype 1*/ #endif #endif /* HAVE_USBSTACK */ + #endif /* BOOTLOADER */ #if defined(HAVE_USBSTACK) || (CONFIG_CPU == JZ4732) \ @@ -756,4 +757,46 @@ Lyre prototype 1*/ #include /* MIPS GCC fix? */ #endif +#if defined(HAVE_USBSTACK) +/* Define the implemented USB transport classes */ +#if CONFIG_USBOTG == USBOTG_ISP1583 +#define USB_HAS_BULK +#elif CONFIG_USBOTG == USBOTG_ARC +#define USB_HAS_BULK +#define USB_HAS_INTERRUPT +#elif CONFIG_USBOTG == USBOTG_JZ4740 +#define USB_HAS_BULK +#define USB_HAS_INTERRUPT +#elif defined(CPU_TCC780X) || defined(define CPU_TCC77X) +#define USB_HAS_BULK +#endif /* CONFIG_USBOTG */ + +/* define the class drivers to enable */ +#ifndef BOOTLOADER + +//#define USB_ENABLE_SERIAL +#define USB_ENABLE_STORAGE + +#ifdef USB_HAS_INTERRUPT +#define USB_ENABLE_HID +#else +#define USB_ENABLE_CHARGING_ONLY +#endif + +#else /* BOOTLOADER */ + +/* enable usb storage for targets that do bootloader usb */ +#if (defined(TOSHIBA_GIGABEAT_S) && defined(USE_ROCKBOX_USB) && defined(USB_STORAGE)) || \ + (defined(HAVE_USBSTACK) && (defined(CREATIVE_ZVx) || \ + defined(CPU_TCC77X) || defined(CPU_TCC780X))) || \ + (CONFIG_USBOTG == USBOTG_JZ4740) +#define USB_ENABLE_STORAGE +#endif + +#endif /* BOOTLOADER */ + +#endif /* HAVE_USBSTACK */ + + + #endif /* __CONFIG_H__ */ diff --git a/firmware/export/usb_core.h b/firmware/export/usb_core.h index 9c105fbc7c..c65be5fa3c 100644 --- a/firmware/export/usb_core.h +++ b/firmware/export/usb_core.h @@ -21,16 +21,6 @@ #ifndef USB_CORE_H #define USB_CORE_H -#ifndef BOOTLOADER - -//#define USB_SERIAL -#define USB_STORAGE -#define USB_CHARGING_ONLY -//#define USB_HID -#else /* BOOTLOADER */ -#define USB_CHARGING_ONLY -#endif /* BOOTLOADER */ - #include "usb_ch9.h" #include "usb.h" -- cgit v1.2.3