summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorKamil Debski <k.debski@samsung.com>2013-10-07 12:35:40 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:44:51 +0900
commit82f8c8fd2f0617ea6cc9db5df2c1f4a510fa7cc4 (patch)
tree419c4dfc5ec5e539017c54842e445bd8ad7243e5 /drivers/usb/host
parent695b628d3fd91c152a4bd9d3404b7c03d23f5196 (diff)
downloadlinux-3.10-82f8c8fd2f0617ea6cc9db5df2c1f4a510fa7cc4.tar.gz
linux-3.10-82f8c8fd2f0617ea6cc9db5df2c1f4a510fa7cc4.tar.bz2
linux-3.10-82f8c8fd2f0617ea6cc9db5df2c1f4a510fa7cc4.zip
ehci-s5p: Add second clock to the ehci-s5p driver
Adding the second clock was necessary for the USB HOST to work. Previously it was working thanks to the USB DEVICE driver being loaded first. Signed-off-by: Kamil Debski <k.debski@samsung.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-s5p.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 4f15e6b1636..c321a3b0b6a 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -54,7 +54,8 @@ static const char * const s5p_ehci_supply_names[] = {
};
struct s5p_ehci_hcd {
- struct clk *clk;
+ struct clk *clk1;
+ struct clk *clk2;
int power_on;
struct phy *phy;
struct usb_otg *otg;
@@ -121,7 +122,6 @@ static ssize_t store_ehci_power(struct device *dev,
const char *buf, size_t count)
{
struct platform_device *pdev = to_platform_device(dev);
- struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
struct usb_hcd *hcd = platform_get_drvdata(pdev);
struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
int power_on;
@@ -243,17 +243,29 @@ static int s5p_ehci_probe(struct platform_device *pdev)
/* s5p_ehci->otg = phy->otg;*/
}
- s5p_ehci->clk = devm_clk_get(&pdev->dev, "usbhost");
+ s5p_ehci->clk1 = devm_clk_get(&pdev->dev, "usbhost");
- if (IS_ERR(s5p_ehci->clk)) {
+ if (IS_ERR(s5p_ehci->clk1)) {
dev_err(&pdev->dev, "Failed to get usbhost clock\n");
- err = PTR_ERR(s5p_ehci->clk);
- goto fail_clk;
+ err = PTR_ERR(s5p_ehci->clk1);
+ goto fail_clk1;
+ }
+
+ err = clk_prepare_enable(s5p_ehci->clk1);
+ if (err)
+ goto fail_clk1;
+
+ s5p_ehci->clk2 = devm_clk_get(&pdev->dev, "otg");
+
+ if (IS_ERR(s5p_ehci->clk2)) {
+ dev_err(&pdev->dev, "Failed to get otg clock\n");
+ err = PTR_ERR(s5p_ehci->clk2);
+ goto fail_clk2;
}
- err = clk_prepare_enable(s5p_ehci->clk);
+ err = clk_prepare_enable(s5p_ehci->clk2);
if (err)
- goto fail_clk;
+ goto fail_clk2;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -327,8 +339,10 @@ fail_add_hcd:
fail_enable_reg:
fail_get_reg:
fail_io:
- clk_disable_unprepare(s5p_ehci->clk);
-fail_clk:
+ clk_disable_unprepare(s5p_ehci->clk2);
+fail_clk2:
+ clk_disable_unprepare(s5p_ehci->clk1);
+fail_clk1:
usb_put_hcd(hcd);
return err;
}
@@ -347,7 +361,8 @@ static int s5p_ehci_remove(struct platform_device *pdev)
s5p_ehci_phy_disable(s5p_ehci, pdev);
- clk_disable_unprepare(s5p_ehci->clk);
+ clk_disable_unprepare(s5p_ehci->clk1);
+ clk_disable_unprepare(s5p_ehci->clk2);
regulator_bulk_disable(ARRAY_SIZE(s5p_ehci->supplies),
s5p_ehci->supplies);
@@ -381,7 +396,8 @@ static int s5p_ehci_suspend(struct device *dev)
s5p_ehci_phy_disable(s5p_ehci, pdev);
- clk_disable_unprepare(s5p_ehci->clk);
+ clk_disable_unprepare(s5p_ehci->clk1);
+ clk_disable_unprepare(s5p_ehci->clk2);
return rc;
}
@@ -392,7 +408,8 @@ static int s5p_ehci_resume(struct device *dev)
struct s5p_ehci_hcd *s5p_ehci = to_s5p_ehci(hcd);
struct platform_device *pdev = to_platform_device(dev);
- clk_prepare_enable(s5p_ehci->clk);
+ clk_prepare_enable(s5p_ehci->clk1);
+ clk_prepare_enable(s5p_ehci->clk2);
if (s5p_ehci->otg)
s5p_ehci->otg->set_host(s5p_ehci->otg, &hcd->self);