USB: EHCI: ehci-mv: add HSIC support
Some special dance is needed to initialize the HSIC port. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> Acked-by: Alan Stern <stern@rowland.harvard.edu> Link: https://lore.kernel.org/r/20191221065008.266445-2-lkundrak@v3.sk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
92f983520c
commit
7b104f890a
1 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/usb/otg.h>
|
#include <linux/usb/otg.h>
|
||||||
|
#include <linux/usb/of.h>
|
||||||
#include <linux/platform_data/mv_usb.h>
|
#include <linux/platform_data/mv_usb.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
|
|
||||||
|
@ -67,6 +68,8 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
|
||||||
{
|
{
|
||||||
struct device *dev = hcd->self.controller;
|
struct device *dev = hcd->self.controller;
|
||||||
struct ehci_hcd_mv *ehci_mv = hcd_to_ehci_hcd_mv(hcd);
|
struct ehci_hcd_mv *ehci_mv = hcd_to_ehci_hcd_mv(hcd);
|
||||||
|
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
||||||
|
u32 status;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (ehci_mv == NULL) {
|
if (ehci_mv == NULL) {
|
||||||
|
@ -80,6 +83,14 @@ static int mv_ehci_reset(struct usb_hcd *hcd)
|
||||||
if (retval)
|
if (retval)
|
||||||
dev_err(dev, "ehci_setup failed %d\n", retval);
|
dev_err(dev, "ehci_setup failed %d\n", retval);
|
||||||
|
|
||||||
|
if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) {
|
||||||
|
status = ehci_readl(ehci, &ehci->regs->port_status[0]);
|
||||||
|
status |= PORT_TEST_FORCE;
|
||||||
|
ehci_writel(ehci, status, &ehci->regs->port_status[0]);
|
||||||
|
status &= ~PORT_TEST_FORCE;
|
||||||
|
ehci_writel(ehci, status, &ehci->regs->port_status[0]);
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue