summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChanho Park <chanho61.park@samsung.com>2013-08-30 20:56:11 +0900
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:44:10 +0900
commitea91d31a12e26e06a590ed5b80dfc475697b7d48 (patch)
treebf6f84dd79167ef0d6bbe9b7e6e2ae7d0462a753
parentbedd47db203c8753a3057fd45828fec806daf63c (diff)
downloadlinux-3.10-ea91d31a12e26e06a590ed5b80dfc475697b7d48.tar.gz
linux-3.10-ea91d31a12e26e06a590ed5b80dfc475697b7d48.tar.bz2
linux-3.10-ea91d31a12e26e06a590ed5b80dfc475697b7d48.zip
usb: ehci-s5p: specify host mode to phy driver
In otg mode, we can use it both host and device mode. Before initializing phy driver, we should specify which mode will be used for it. Signed-off-by: Chanho Park <chanho61.park@samsung.com>
-rw-r--r--drivers/usb/host/ehci-s5p.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index e7d26d6ab27..671de95fa7f 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -51,6 +51,7 @@ struct s5p_ehci_hcd {
int power_on;
struct usb_phy *phy;
struct usb_otg *otg;
+ struct usb_bus *host;
struct s5p_ehci_platdata *pdata;
};
@@ -59,8 +60,11 @@ struct s5p_ehci_hcd {
static void s5p_ehci_phy_enable(struct s5p_ehci_hcd *s5p_ehci,
struct platform_device *pdev)
{
- if (s5p_ehci->phy)
+ if (s5p_ehci->phy) {
+ if (s5p_ehci->otg)
+ otg_set_host(s5p_ehci->otg, s5p_ehci->host);
usb_phy_init(s5p_ehci->phy);
+ }
else if (s5p_ehci->pdata->phy_init)
s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST);
}
@@ -68,8 +72,11 @@ static void s5p_ehci_phy_enable(struct s5p_ehci_hcd *s5p_ehci,
static void s5p_ehci_phy_disable(struct s5p_ehci_hcd *s5p_ehci,
struct platform_device *pdev)
{
- if (s5p_ehci->phy)
+ if (s5p_ehci->phy) {
+ if (s5p_ehci->otg)
+ otg_set_host(s5p_ehci->otg, NULL);
usb_phy_shutdown(s5p_ehci->phy);
+ }
else if (s5p_ehci->pdata->phy_exit)
s5p_ehci->pdata->phy_exit(pdev, USB_PHY_TYPE_HOST);
}
@@ -266,8 +273,7 @@ static int s5p_ehci_probe(struct platform_device *pdev)
goto fail_io;
}
- if (s5p_ehci->otg)
- s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);
+ s5p_ehci->host = &hcd->self;
s5p_ehci_phy_enable(s5p_ehci, pdev);