aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/host/ehci-atmel.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c
index 3b645ff46f7b..f417526fb1f4 100644
--- a/drivers/usb/host/ehci-atmel.c
+++ b/drivers/usb/host/ehci-atmel.c
@@ -30,13 +30,17 @@ static const char hcd_name[] = "ehci-atmel";
30static struct hc_driver __read_mostly ehci_atmel_hc_driver; 30static struct hc_driver __read_mostly ehci_atmel_hc_driver;
31 31
32/* interface and function clocks */ 32/* interface and function clocks */
33static struct clk *iclk, *fclk; 33static struct clk *iclk, *fclk, *uclk;
34static int clocked; 34static int clocked;
35 35
36/*-------------------------------------------------------------------------*/ 36/*-------------------------------------------------------------------------*/
37 37
38static void atmel_start_clock(void) 38static void atmel_start_clock(void)
39{ 39{
40 if (IS_ENABLED(CONFIG_COMMON_CLK)) {
41 clk_set_rate(uclk, 48000000);
42 clk_prepare_enable(uclk);
43 }
40 clk_prepare_enable(iclk); 44 clk_prepare_enable(iclk);
41 clk_prepare_enable(fclk); 45 clk_prepare_enable(fclk);
42 clocked = 1; 46 clocked = 1;
@@ -46,6 +50,8 @@ static void atmel_stop_clock(void)
46{ 50{
47 clk_disable_unprepare(fclk); 51 clk_disable_unprepare(fclk);
48 clk_disable_unprepare(iclk); 52 clk_disable_unprepare(iclk);
53 if (IS_ENABLED(CONFIG_COMMON_CLK))
54 clk_disable_unprepare(uclk);
49 clocked = 0; 55 clocked = 0;
50} 56}
51 57
@@ -130,6 +136,14 @@ static int ehci_atmel_drv_probe(struct platform_device *pdev)
130 retval = -ENOENT; 136 retval = -ENOENT;
131 goto fail_request_resource; 137 goto fail_request_resource;
132 } 138 }
139 if (IS_ENABLED(CONFIG_COMMON_CLK)) {
140 uclk = devm_clk_get(&pdev->dev, "usb_clk");
141 if (IS_ERR(uclk)) {
142 dev_err(&pdev->dev, "failed to get uclk\n");
143 retval = PTR_ERR(uclk);
144 goto fail_request_resource;
145 }
146 }
133 147
134 ehci = hcd_to_ehci(hcd); 148 ehci = hcd_to_ehci(hcd);
135 /* registers start at offset 0x0 */ 149 /* registers start at offset 0x0 */