From f36b833955a6a6c380b4b08ac983f9430e5dfba2 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Thu, 30 Apr 2015 11:27:20 -0600 Subject: [PATCH] STM32F4-Discover: Add missing logic to register the hub class --- configs/stm32f4discovery/src/stm32_usb.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/configs/stm32f4discovery/src/stm32_usb.c b/configs/stm32f4discovery/src/stm32_usb.c index c69220c44c..073552c254 100644 --- a/configs/stm32f4discovery/src/stm32_usb.c +++ b/configs/stm32f4discovery/src/stm32_usb.c @@ -166,8 +166,8 @@ void stm32_usbinitialize(void) int stm32_usbhost_initialize(void) { int pid; -#if defined(CONFIG_USBHOST_MSC) || defined(CONFIG_USBHOST_HIDKBD) || \ - defined(CONFIG_USBHOST_HIDMOUSE) +#if defined(CONFIG_USBHOST_HUB) || defined(CONFIG_USBHOST_MSC) || \ + defined(CONFIG_USBHOST_HIDKBD) || defined(CONFIG_USBHOST_HIDMOUSE) int ret; #endif @@ -177,7 +177,19 @@ int stm32_usbhost_initialize(void) uvdbg("Register class drivers\n"); +#ifdef CONFIG_USBHOST_HUB + /* Initialize USB hub class support */ + + ret = usbhost_hub_initialize(); + if (ret < 0) + { + udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret); + } +#endif + #ifdef CONFIG_USBHOST_MSC + /* Initialize the mass storage class */ + ret = usbhost_storageinit(); if (ret != OK) { @@ -186,6 +198,8 @@ int stm32_usbhost_initialize(void) #endif #ifdef CONFIG_USBHOST_HIDKBD + /* Initialize the HID keyboard class */ + ret = usbhost_kbdinit(); if (ret != OK) { @@ -194,6 +208,8 @@ int stm32_usbhost_initialize(void) #endif #ifdef CONFIG_USBHOST_HIDMOUSE + /* Initialize the HID mouse class */ + ret = usbhost_mouse_init(); if (ret != OK) {