diff options
author | Girish K S <ks.giri@samsung.com> | 2012-10-08 14:06:33 +0900 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2013-05-20 10:23:18 +0530 |
commit | 30500e77f0d42e845867c20b49e3482ec5a1085a (patch) | |
tree | 225a85c1adeea802998393b360d61e0f345b8d36 | |
parent | ca2fe1f6b02a93e14ffd90d85b947b611cf31c23 (diff) |
usb: ehci-s5p: add the HSIC port initializationtracking-arndale-core-support-llct-20130715.0tracking-arndale-core-support-llct-20130708.0tracking-arndale-core-support-llct-20130701.0tracking-arndale-core-support-llct-20130626.0tracking-arndale-core-support-llct-20130625.0tracking-arndale-core-support-llct-20130618.0tracking-arndale-core-support-llct-20130617.1tracking-arndale-core-support-llct-20130617.0tracking-arndale-core-support-llct-20130613.0tracking-arndale-core-support-llct-20130610.0tracking-arndale-core-support-llct-20130606.0tracking-arndale-core-support-llct-20130604.1tracking-arndale-core-support-llct-20130604.0tracking-arndale-core-support-llct-20130521.0llct-arndale-core-support-v3.10-rc1
The hub-reset and hub-connect pins should be pulled low before phy init
and need to be pulled high after completion of phy init.
Signed-off-by: Girish K S <ks.giri@samsung.com>
Signed-off-by: Yuvaraj Kumar C D <yuvaraj.cd@samsung.com>
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r-- | drivers/usb/host/ehci-s5p.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c index 635775278c7..02516e2a1f2 100644 --- a/drivers/usb/host/ehci-s5p.c +++ b/drivers/usb/host/ehci-s5p.c @@ -52,6 +52,25 @@ struct s5p_ehci_hcd { #define to_s5p_ehci(hcd) (struct s5p_ehci_hcd *)(hcd_to_ehci(hcd)->priv) +static void s5p_setup_hub_gpio(struct platform_device *pdev, const char *propname, int level) +{ + int err; + int gpio; + + if (!pdev->dev.of_node) + return; + + gpio = of_get_named_gpio(pdev->dev.of_node, propname, 0); + if (!gpio_is_valid(gpio)) + return; + err = gpio_request_one(gpio, level, "ehci_vbus_gpio"); + + if (err) + dev_err(&pdev->dev, "can't request ehci hub-reset gpio %d", gpio); + else + gpio_free(gpio); +} + static void s5p_setup_vbus_gpio(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -155,11 +174,18 @@ static int s5p_ehci_probe(struct platform_device *pdev) if (s5p_ehci->otg) s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self); + s5p_setup_hub_gpio(pdev, "hub-reset", GPIOF_OUT_INIT_LOW); + s5p_setup_hub_gpio(pdev, "hub-connect", GPIOF_OUT_INIT_LOW); + if (s5p_ehci->phy) usb_phy_init(s5p_ehci->phy); else if (s5p_ehci->pdata->phy_init) s5p_ehci->pdata->phy_init(pdev, USB_PHY_TYPE_HOST); + mdelay(1); + s5p_setup_hub_gpio(pdev, "hub-reset", GPIOF_OUT_INIT_HIGH); + s5p_setup_hub_gpio(pdev, "hub-connect", GPIOF_OUT_INIT_HIGH); + ehci = hcd_to_ehci(hcd); ehci->caps = hcd->regs; |