diff options
author | Sanchayan Maity <maitysanchayan@gmail.com> | 2016-08-05 13:59:11 +0530 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2016-09-29 06:03:23 +0200 |
commit | dfc215b18aefab24e72e031029a39113508735dc (patch) | |
tree | 6e4d9c7ddd4c9b1f23cbc094aeffd24c43b58e32 | |
parent | 5d364743f61ac748657ad96defc1ff832757288c (diff) |
usb: host: ehci-vf: Implement board_usb_phy_mode weak function
Add board_usb_phy_mode weak function on similar lines to ehci-mx6.
However since Vybrid USB does not have a true OTG, make this weak
functon just return 0. The function is supposed to be implemented
by the individual boards using a GPIO for providing the OTG pin
functionality.
Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
-rw-r--r-- | drivers/usb/host/ehci-vf.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c index 183c6ef141d..87578226030 100644 --- a/drivers/usb/host/ehci-vf.c +++ b/drivers/usb/host/ehci-vf.c @@ -161,6 +161,11 @@ static void usb_oc_config(int index) __raw_writel(val, ctrl); } +int __weak board_usb_phy_mode(int port) +{ + return 0; +} + int __weak board_ehci_hcd_init(int port) { return 0; @@ -170,6 +175,7 @@ int ehci_hcd_init(int index, enum usb_init_type init, struct ehci_hccr **hccr, struct ehci_hcor **hcor) { struct usb_ehci *ehci; + enum usb_init_type type; if (index >= ARRAY_SIZE(nc_reg_bases)) return -EINVAL; @@ -188,6 +194,10 @@ int ehci_hcd_init(int index, enum usb_init_type init, *hcor = (struct ehci_hcor *)((uint32_t)*hccr + HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase))); + type = board_usb_phy_mode(index); + if (type != init) + return -ENODEV; + if (init == USB_INIT_DEVICE) { setbits_le32(&ehci->usbmode, CM_DEVICE); __raw_writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc); |