summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2014-11-25 16:30:39 +0100
committerStefan Agner <stefan.agner@toradex.com>2014-11-25 16:34:23 +0100
commit4cabd68701e13ef94c7f533e05721ab1553daace (patch)
tree481d48acdbf44bbbf617a1fe71ea0232958683b3
parent2adb32952ad79026e5fd6308b03910f6e9135d04 (diff)
colibri_vf/usb: fix multiple USB controller usage
Fix usage of multiple USB controllers by setting returning ENODEV for the respective controllers when trying to initialize them in the non-standard mode (on USBH allows only host mode, on USBC allow only device mode).
-rw-r--r--drivers/usb/host/ehci-vf.c8
-rw-r--r--include/configs/colibri_vf.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
index 12b9db3c03..c55e622453 100644
--- a/drivers/usb/host/ehci-vf.c
+++ b/drivers/usb/host/ehci-vf.c
@@ -173,10 +173,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
if (index >= ARRAY_SIZE(nc_reg_bases))
return -EINVAL;
- if (init == USB_INIT_DEVICE)
- index = 0;
- if (init == USB_INIT_HOST)
- index = 1;
+ if (init == USB_INIT_DEVICE && index == 1)
+ return -ENODEV;
+ if (init == USB_INIT_HOST && index == 0)
+ return -ENODEV;
ehci = (struct usb_ehci *)nc_reg_bases[index];
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index 7d0e20d554..6a6c54a061 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -250,7 +250,7 @@
#define CONFIG_CMD_USB
#define CONFIG_USB_EHCI
#define CONFIG_USB_EHCI_VF
-#define CONFIG_USB_MAX_CONTROLLER_COUNT 1
+#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
#define CONFIG_EHCI_HCD_INIT_AFTER_RESET
/* USB Client Support */