Skip to content

Commit 7b104f8

Browse files
lkundrakgregkh
authored andcommitted
USB: EHCI: ehci-mv: add HSIC support
Some special dance is needed to initialize the HSIC port. Signed-off-by: Lubomir Rintel <[email protected]> Acked-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 92f9835 commit 7b104f8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/usb/host/ehci-mv.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/clk.h>
1212
#include <linux/err.h>
1313
#include <linux/usb/otg.h>
14+
#include <linux/usb/of.h>
1415
#include <linux/platform_data/mv_usb.h>
1516
#include <linux/io.h>
1617

@@ -67,6 +68,8 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
6768
{
6869
struct device *dev = hcd->self.controller;
6970
struct ehci_hcd_mv *ehci_mv = hcd_to_ehci_hcd_mv(hcd);
71+
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
72+
u32 status;
7073
int retval;
7174

7275
if (ehci_mv == NULL) {
@@ -80,6 +83,14 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
8083
if (retval)
8184
dev_err(dev, "ehci_setup failed %d\n", retval);
8285

86+
if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) {
87+
status = ehci_readl(ehci, &ehci->regs->port_status[0]);
88+
status |= PORT_TEST_FORCE;
89+
ehci_writel(ehci, status, &ehci->regs->port_status[0]);
90+
status &= ~PORT_TEST_FORCE;
91+
ehci_writel(ehci, status, &ehci->regs->port_status[0]);
92+
}
93+
8394
return retval;
8495
}
8596

0 commit comments

Comments
 (0)