diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2014-11-25 16:30:39 +0100 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2014-11-25 16:34:23 +0100 |
commit | 4cabd68701e13ef94c7f533e05721ab1553daace (patch) | |
tree | 481d48acdbf44bbbf617a1fe71ea0232958683b3 | |
parent | 2adb32952ad79026e5fd6308b03910f6e9135d04 (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.c | 8 | ||||
-rw-r--r-- | include/configs/colibri_vf.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c index 12b9db3c035..c55e622453d 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 7d0e20d554f..6a6c54a0616 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 */ |