diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2013-08-12 14:44:06 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2013-08-12 14:44:06 -0600 |
commit | 3b04d08043742b9e65cf38d45988b35bff91daed (patch) | |
tree | ca74e5710a1564da64e94e52b34210f6d8401947 /nuttx/configs | |
parent | d5cee29af56c68dceeb8e26f6f4081c9d3c66988 (diff) | |
download | nuttx-3b04d08043742b9e65cf38d45988b35bff91daed.tar.gz nuttx-3b04d08043742b9e65cf38d45988b35bff91daed.tar.bz2 nuttx-3b04d08043742b9e65cf38d45988b35bff91daed.zip |
First of several changes needed to support multiple USB host root hubs
Diffstat (limited to 'nuttx/configs')
-rw-r--r-- | nuttx/configs/cloudctrl/src/up_usb.c | 4 | ||||
-rw-r--r-- | nuttx/configs/mikroe-stm32f4/src/up_usb.c | 4 | ||||
-rw-r--r-- | nuttx/configs/olimex-lpc1766stk/src/up_nsh.c | 4 | ||||
-rw-r--r-- | nuttx/configs/open1788/src/lpc17_nsh.c | 4 | ||||
-rw-r--r-- | nuttx/configs/pic32-starterkit/src/up_nsh.c | 4 | ||||
-rw-r--r-- | nuttx/configs/pic32mx7mmb/src/up_nsh.c | 4 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sam_usb.c | 17 | ||||
-rw-r--r-- | nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h | 2 | ||||
-rw-r--r-- | nuttx/configs/shenzhou/src/up_usb.c | 4 | ||||
-rw-r--r-- | nuttx/configs/stm3220g-eval/src/up_usb.c | 4 | ||||
-rw-r--r-- | nuttx/configs/stm3240g-eval/src/up_usb.c | 4 | ||||
-rw-r--r-- | nuttx/configs/stm32f4discovery/src/up_usb.c | 4 | ||||
-rw-r--r-- | nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c | 6 |
13 files changed, 35 insertions, 30 deletions
diff --git a/nuttx/configs/cloudctrl/src/up_usb.c b/nuttx/configs/cloudctrl/src/up_usb.c index 98f015dee..2407285c5 100644 --- a/nuttx/configs/cloudctrl/src/up_usb.c +++ b/nuttx/configs/cloudctrl/src/up_usb.c @@ -109,7 +109,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -121,7 +121,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/mikroe-stm32f4/src/up_usb.c b/nuttx/configs/mikroe-stm32f4/src/up_usb.c index f8debe5ab..cb94e5cbe 100644 --- a/nuttx/configs/mikroe-stm32f4/src/up_usb.c +++ b/nuttx/configs/mikroe-stm32f4/src/up_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c b/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c index 4ca474c65..e893ba27e 100644 --- a/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c +++ b/nuttx/configs/olimex-lpc1766stk/src/up_nsh.c @@ -169,7 +169,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -181,7 +181,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/open1788/src/lpc17_nsh.c b/nuttx/configs/open1788/src/lpc17_nsh.c index 3dca28b2f..fa6e086ed 100644 --- a/nuttx/configs/open1788/src/lpc17_nsh.c +++ b/nuttx/configs/open1788/src/lpc17_nsh.c @@ -193,7 +193,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -205,7 +205,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/pic32-starterkit/src/up_nsh.c b/nuttx/configs/pic32-starterkit/src/up_nsh.c index 71909f92e..7c8e21412 100644 --- a/nuttx/configs/pic32-starterkit/src/up_nsh.c +++ b/nuttx/configs/pic32-starterkit/src/up_nsh.c @@ -197,7 +197,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -209,7 +209,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/pic32mx7mmb/src/up_nsh.c b/nuttx/configs/pic32mx7mmb/src/up_nsh.c index 37ecc3095..5e59af564 100644 --- a/nuttx/configs/pic32mx7mmb/src/up_nsh.c +++ b/nuttx/configs/pic32mx7mmb/src/up_nsh.c @@ -196,7 +196,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -208,7 +208,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/sama5d3x-ek/src/sam_usb.c b/nuttx/configs/sama5d3x-ek/src/sam_usb.c index 3b009bb41..3ab5d3c39 100644 --- a/nuttx/configs/sama5d3x-ek/src/sam_usb.c +++ b/nuttx/configs/sama5d3x-ek/src/sam_usb.c @@ -54,6 +54,7 @@ #include "up_arch.h" #include "sam_pio.h" #include "sam_usbhost.h" +#include "chip/sam_ohci.h" #include "sama5d3x-ek.h" #if defined(CONFIG_SAMA5_UHPHS) || defined(CONFIG_SAMA5_UDPHS) @@ -97,25 +98,29 @@ static struct usbhost_driver_s *g_ehci; #if HAVE_USBHOST static int usbhost_waiter(struct usbhost_driver_s *dev) { - bool connected = false; + bool connected[SAM_USBHOST_NRHPORT] = {false, false, false}; + int rhpndx; uvdbg("Running\n"); for (;;) { /* Wait for the device to change state */ - DEBUGVERIFY(DRVR_WAIT(dev, connected) == OK); + rhpndx = DRVR_WAIT(dev, connected); + DEBUGASSERT(rhpndx >= 0 && rhpndx < SAM_USBHOST_NRHPORT); - connected = !connected; - uvdbg("%s\n", connected ? "connected" : "disconnected"); + connected[rhpndx] = !connected[rhpndx]; + + uvdbg("RHport%d %s\n", + rhpndx + 1, connected[rhpndx] ? "connected" : "disconnected"); /* Did we just become connected? */ - if (connected) + if (connected[rhpndx]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(dev); + (void)DRVR_ENUMERATE(dev, rhpndx); } } diff --git a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h index 0cf87b2e4..9f91aee92 100644 --- a/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h +++ b/nuttx/configs/sama5d3x-ek/src/sama5d3x-ek.h @@ -293,7 +293,7 @@ PIO_PORT_PIOD | PIO_PIN27) /* Both Ports B and C - * + * * PIO Signal Name Function * ---- ----------- ------------------------------------------------------- * PD28 OVCUR_USB Combined overrcurrent indication from port A and B diff --git a/nuttx/configs/shenzhou/src/up_usb.c b/nuttx/configs/shenzhou/src/up_usb.c index 0ae1d8c52..88f6d96ba 100644 --- a/nuttx/configs/shenzhou/src/up_usb.c +++ b/nuttx/configs/shenzhou/src/up_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/stm3220g-eval/src/up_usb.c b/nuttx/configs/stm3220g-eval/src/up_usb.c index b16bdb6aa..4de02df96 100644 --- a/nuttx/configs/stm3220g-eval/src/up_usb.c +++ b/nuttx/configs/stm3220g-eval/src/up_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/stm3240g-eval/src/up_usb.c b/nuttx/configs/stm3240g-eval/src/up_usb.c index b9082cbe7..c69a017bb 100644 --- a/nuttx/configs/stm3240g-eval/src/up_usb.c +++ b/nuttx/configs/stm3240g-eval/src/up_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/stm32f4discovery/src/up_usb.c b/nuttx/configs/stm32f4discovery/src/up_usb.c index 4a5268155..166f4e7a9 100644 --- a/nuttx/configs/stm32f4discovery/src/up_usb.c +++ b/nuttx/configs/stm32f4discovery/src/up_usb.c @@ -108,7 +108,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -120,7 +120,7 @@ static int usbhost_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } diff --git a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c index 294afcb79..b9ea90dba 100644 --- a/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c +++ b/nuttx/configs/sure-pic32mx/src/pic32mx_nsh.c @@ -1,7 +1,7 @@ /**************************************************************************** * config/sure-pic32mx/src/pic32mx_nsh.c * - * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2011-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without @@ -188,7 +188,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Wait for the device to change state */ - ret = DRVR_WAIT(g_drvr, connected); + ret = DRVR_WAIT(g_drvr, &connected); DEBUGASSERT(ret == OK); connected = !connected; @@ -200,7 +200,7 @@ static int nsh_waiter(int argc, char *argv[]) { /* Yes.. enumerate the newly connected device */ - (void)DRVR_ENUMERATE(g_drvr); + (void)DRVR_ENUMERATE(g_drvr, 0); } } |