diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index dba3f318b71..32f0c306887 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -2514,13 +2514,13 @@ config STM32_OTGFS bool "OTG FS" default n depends on STM32_HAVE_OTGFS - select USBHOST_HAVE_ASYNCH if USBHOST + select USBHOST_HAVE_ASYNCH if STM32_USBHOST config STM32_OTGHS bool "OTG HS" default n depends on STM32_STM32F20XX || STM32_STM32F4XXX - select USBHOST_HAVE_ASYNCH if USBHOST + select USBHOST_HAVE_ASYNCH if STM32_USBHOST config STM32_PWR bool "PWR" @@ -9255,6 +9255,7 @@ config STM32_USBHOST bool "Enable USB Host Support" depends on STM32_OTGFS || STM32_OTGHS default n + select USBHOST menu "USB FS Host Configuration" depends on STM32_OTGFS && STM32_USBHOST diff --git a/arch/arm/src/stm32/stm32_otgfs.h b/arch/arm/src/stm32/stm32_otgfs.h index 69f35ba370f..fbaa2877e38 100644 --- a/arch/arm/src/stm32/stm32_otgfs.h +++ b/arch/arm/src/stm32/stm32_otgfs.h @@ -90,7 +90,7 @@ extern "C" * ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST struct usbhost_connection_s; FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller); #endif diff --git a/arch/arm/src/stm32/stm32_otgfshost.c b/arch/arm/src/stm32/stm32_otgfshost.c index fc358e0c65e..3713a629468 100644 --- a/arch/arm/src/stm32/stm32_otgfshost.c +++ b/arch/arm/src/stm32/stm32_otgfshost.c @@ -70,7 +70,7 @@ #include "stm32_gpio.h" #include "stm32_usbhost.h" -#if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGFS) +#if defined(CONFIG_STM32_USBHOST) && defined(CONFIG_STM32_OTGFS) /**************************************************************************** * Pre-processor Definitions @@ -82,9 +82,10 @@ * * Pre-requisites * - * CONFIG_USBHOST - Enable general USB host support - * CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block - * CONFIG_STM32_SYSCFG - Needed + * CONFIG_STM32_USBHOST - Enable STM32 USB host support + * CONFIG_USBHOST - Enable general USB host support + * CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block + * CONFIG_STM32_SYSCFG - Needed * * Options: * @@ -5442,4 +5443,4 @@ FAR struct usbhost_connection_s *stm32_otgfshost_initialize(int controller) return &g_usbconn; } -#endif /* CONFIG_USBHOST && CONFIG_STM32_OTGFS */ +#endif /* CONFIG_STM32_USBHOST && CONFIG_STM32_OTGFS */ diff --git a/arch/arm/src/stm32/stm32_otghs.h b/arch/arm/src/stm32/stm32_otghs.h index e6c4dd47441..da492bcfd66 100644 --- a/arch/arm/src/stm32/stm32_otghs.h +++ b/arch/arm/src/stm32/stm32_otghs.h @@ -89,7 +89,7 @@ extern "C" * ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST struct usbhost_connection_s; FAR struct usbhost_connection_s *stm32_otghshost_initialize(int controller); #endif diff --git a/arch/arm/src/stm32/stm32_otghshost.c b/arch/arm/src/stm32/stm32_otghshost.c index ca5b71dae91..468c4b5d633 100644 --- a/arch/arm/src/stm32/stm32_otghshost.c +++ b/arch/arm/src/stm32/stm32_otghshost.c @@ -70,7 +70,7 @@ #include "stm32_gpio.h" #include "stm32_usbhost.h" -#if defined(CONFIG_USBHOST) && defined(CONFIG_STM32_OTGHS) +#if defined(CONFIG_STM32_USBHOST) && defined(CONFIG_STM32_OTGHS) /**************************************************************************** * Pre-processor Definitions @@ -82,9 +82,10 @@ * * Pre-requisites * - * CONFIG_USBHOST - Enable general USB host support - * CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block - * CONFIG_STM32_SYSCFG - Needed + * CONFIG_STM32_USBHOST - Enable STM32 USB host support + * CONFIG_USBHOST - Enable general USB host support + * CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block + * CONFIG_STM32_SYSCFG - Needed * * Options: * @@ -5447,4 +5448,4 @@ FAR struct usbhost_connection_s *stm32_otghshost_initialize(int controller) return &g_usbconn; } -#endif /* CONFIG_USBHOST && CONFIG_STM32_OTGHS */ +#endif /* CONFIG_STM32_USBHOST && CONFIG_STM32_OTGHS */ diff --git a/arch/arm/src/stm32/stm32_usbhost.h b/arch/arm/src/stm32/stm32_usbhost.h index 22b113914ff..c8348c060d5 100644 --- a/arch/arm/src/stm32/stm32_usbhost.h +++ b/arch/arm/src/stm32/stm32_usbhost.h @@ -49,7 +49,7 @@ #include "hardware/stm32fxxxxx_otgfs.h" #include "hardware/stm32_otghs.h" -#if (defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS)) && defined(CONFIG_USBHOST) +#if (defined(CONFIG_STM32_OTGFS) || defined(CONFIG_STM32_OTGHS)) && defined(CONFIG_STM32_USBHOST) /************************************************************************************ * Public Types @@ -209,11 +209,12 @@ enum usbhost_trace1codes_e * * Pre-requisites * - * CONFIG_USBHOST - Enable general USB host support - * CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block + * CONFIG_STM32_USBHOST - Enable general USB host support + * CONFIG_USBHOST - Enable general USB host support + * CONFIG_STM32_OTGFS - Enable the STM32 USB OTG FS block * or - * CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block - * CONFIG_STM32_SYSCFG - Needed + * CONFIG_STM32_OTGHS - Enable the STM32 USB OTG HS block + * CONFIG_STM32_SYSCFG - Needed * * Options: * @@ -290,5 +291,5 @@ void stm32_usbhost_vbusdrive(int iface, bool enable); #endif #endif /* __ASSEMBLY__ */ -#endif /* CONFIG_STM32_OTGFS && CONFIG_USBHOST */ +#endif /* CONFIG_STM32_OTGFS && CONFIG_STM32_USBHOST */ #endif /* __ARCH_ARM_SRC_STM32_STM32_USBHOST_H */ diff --git a/boards/arm/stm32/olimex-stm32-p207/src/olimex-stm32-p207.h b/boards/arm/stm32/olimex-stm32-p207/src/olimex-stm32-p207.h index f1ee2fc70ed..44277a40171 100644 --- a/boards/arm/stm32/olimex-stm32-p207/src/olimex-stm32-p207.h +++ b/boards/arm/stm32/olimex-stm32-p207/src/olimex-stm32-p207.h @@ -84,7 +84,7 @@ #define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN9) #define GPIO_OTGFS_PWRON (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_PUSHPULL|GPIO_PORTC|GPIO_PIN2) -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST # define GPIO_OTGFS_OVER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTB|GPIO_PIN10) #else @@ -120,7 +120,7 @@ void weak_function stm32_usbinitialize(void); * ****************************************************************************/ -#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_USBHOST) +#if defined(CONFIG_STM32_OTGFS) && defined(CONFIG_STM32_USBHOST) int stm32_usbhost_initialize(void); #endif diff --git a/boards/arm/stm32/olimex-stm32-p207/src/stm32_appinit.c b/boards/arm/stm32/olimex-stm32-p207/src/stm32_appinit.c index 558622f971a..c91b6856afa 100644 --- a/boards/arm/stm32/olimex-stm32-p207/src/stm32_appinit.c +++ b/boards/arm/stm32/olimex-stm32-p207/src/stm32_appinit.c @@ -84,7 +84,8 @@ /* Can't support USB host is USB host is not enabled */ -#ifndef CONFIG_USBHOST +#ifndef CONFIG_STM32_USBHOST +# undef CONFIG_USBHOST # undef HAVE_USBHOST #endif diff --git a/boards/arm/stm32/olimex-stm32-p207/src/stm32_boot.c b/boards/arm/stm32/olimex-stm32-p207/src/stm32_boot.c index 8cfd0e92df0..b01c3165c24 100644 --- a/boards/arm/stm32/olimex-stm32-p207/src/stm32_boot.c +++ b/boards/arm/stm32/olimex-stm32-p207/src/stm32_boot.c @@ -56,7 +56,7 @@ * * Description: * All STM32 architectures must provide the following entry point. This entry point - * is called early in the intitialization -- after all memory has been configured + * is called early in the initialization -- after all memory has been configured * and mapped but before any devices have been initialized. * ****************************************************************************/ @@ -65,7 +65,7 @@ void stm32_boardinitialize(void) { /* Initialize USB if the 1) OTG FS controller is in the configuration and 2) * disabled, and 3) the weak function stm32_usbinitialize() has been brought - * into the build. Presumeably either CONFIG_USBDEV or CONFIG_USBHOST is also + * into the build. Presumably either CONFIG_USBDEV or CONFIG_USBHOST is also * selected. */ diff --git a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c index 0cc0486106f..c9e794e7a30 100644 --- a/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c +++ b/boards/arm/stm32/olimex-stm32-p207/src/stm32_usb.c @@ -85,7 +85,7 @@ * Private Data ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST static struct usbhost_connection_s *g_usbconn; #endif @@ -101,7 +101,7 @@ static struct usbhost_connection_s *g_usbconn; * ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST static int usbhost_waiter(int argc, char *argv[]) { struct usbhost_hubport_s *hport; @@ -166,7 +166,7 @@ void stm32_usbinitialize(void) * ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST int stm32_usbhost_initialize(void) { int pid; @@ -247,7 +247,7 @@ int stm32_usbhost_initialize(void) * ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST int stm32_setup_overcurrent(xcpt_t handler, void *arg) { return stm32_gpiosetevent(GPIO_OTGFS_OVER, true, true, true, handler, arg); @@ -280,7 +280,7 @@ int stm32_setup_overcurrent(xcpt_t handler, void *arg) * ****************************************************************************/ -#ifdef CONFIG_USBHOST +#ifdef CONFIG_STM32_USBHOST void stm32_usbhost_vbusdrive(int iface, bool enable) { DEBUGASSERT(iface == 0);