Add USB hub initialization logic to a couple of board configurations
This commit is contained in:
parent
db59d0a2e5
commit
44ac65e8ed
@ -39,6 +39,9 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/usb/usbhost.h>
|
||||
|
||||
#include "lpc17_usbhost.h"
|
||||
@ -66,6 +69,18 @@
|
||||
|
||||
struct usbhost_connection_s *arch_usbhost_initialize(void)
|
||||
{
|
||||
#ifdef CONFIG_USBHOST_HUB
|
||||
int ret;
|
||||
|
||||
/* Initialize USB hub support */
|
||||
|
||||
ret = usbhost_hub_initialize();
|
||||
if (ret < 0)
|
||||
{
|
||||
udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return lpc17_usbhost_initialize(0);
|
||||
}
|
||||
#endif /* CONFIG_LPC17_USBHOST && CONFIG_USBHOST && CONFIG_EXAMPLES_HIDKBD */
|
||||
|
@ -41,9 +41,9 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/usb/usbhost.h>
|
||||
@ -125,6 +125,16 @@ int board_tsc_setup(int minor)
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
#ifdef CONFIG_USBHOST_HUB
|
||||
/* Initialize USB hub support */
|
||||
|
||||
ret = usbhost_hub_initialize();
|
||||
if (ret < 0)
|
||||
{
|
||||
idbg("ERROR: usbhost_hub_initialize failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize and register the USB HID mouse device class */
|
||||
|
||||
ret = usbhost_mouse_init();
|
||||
|
@ -248,6 +248,19 @@ static int nsh_usbhostinitialize(void)
|
||||
*/
|
||||
|
||||
syslog(LOG_INFO, "Register class drivers\n");
|
||||
|
||||
#ifdef CONFIG_USBHOST_HUB
|
||||
/* Initialize USB hub support */
|
||||
|
||||
ret = usbhost_hub_initialize();
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: usbhost_hub_initialize failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Initialize mass storage support */
|
||||
|
||||
ret = usbhost_storageinit();
|
||||
if (ret != OK)
|
||||
{
|
||||
|
@ -135,4 +135,5 @@ int usbmsc_archinitialize(void)
|
||||
|
||||
errout:
|
||||
lpc17_gpiowrite(LPC1766STK_MMC_PWR, true);
|
||||
return ret;}
|
||||
return ret;
|
||||
}
|
||||
|
@ -311,10 +311,20 @@ int sam_usbhost_initialize(void)
|
||||
|
||||
/* First, register all of the class drivers needed to support the drivers
|
||||
* that we care about
|
||||
*
|
||||
* Register theUSB host Mass Storage Class:
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_USBHOST_HUB
|
||||
/* Initialize USB hub support */
|
||||
|
||||
ret = usbhost_hub_initialize();
|
||||
if (ret < 0)
|
||||
{
|
||||
udbg("ERROR: usbhost_hub_initialize failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Register the USB host Mass Storage Class */
|
||||
|
||||
ret = usbhost_storageinit();
|
||||
if (ret != OK)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user