diff options
author | Stefan Wahren <stefan.wahren@i2se.com> | 2015-11-13 12:02:12 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-11-19 15:48:49 -0500 |
commit | 8aa90cf2a28645c6733f8879c5fe1848c5d510b7 (patch) | |
tree | 20fd3cfbb59200959237dffe89828488f93defc4 | |
parent | 6c2dad69163fdb4ea82344dcba360fc00b4adda4 (diff) |
usb: dwc2: make otg clk optional
Fixes commit 09a75e857790
("usb: dwc2: refactor common low-level hw code to platform.c")
The above commit consolidated the low-level phy access into a common
location. This change made the otg clk a requirement and broke some
platforms when it was moved into platform.c.
So make clk handling optional again.
Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: John Youn <johnyoun@synopsys.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Fixes: 09a75e857790 ("usb: dwc2: refactor common low-level hw code to platform.c")
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc2/platform.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c index d28f72e87389..91e2e6b86c7c 100644 --- a/drivers/usb/dwc2/platform.c +++ b/drivers/usb/dwc2/platform.c | |||
@@ -125,9 +125,11 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg) | |||
125 | if (ret) | 125 | if (ret) |
126 | return ret; | 126 | return ret; |
127 | 127 | ||
128 | ret = clk_prepare_enable(hsotg->clk); | 128 | if (hsotg->clk) { |
129 | if (ret) | 129 | ret = clk_prepare_enable(hsotg->clk); |
130 | return ret; | 130 | if (ret) |
131 | return ret; | ||
132 | } | ||
131 | 133 | ||
132 | if (hsotg->uphy) | 134 | if (hsotg->uphy) |
133 | ret = usb_phy_init(hsotg->uphy); | 135 | ret = usb_phy_init(hsotg->uphy); |
@@ -175,7 +177,8 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg) | |||
175 | if (ret) | 177 | if (ret) |
176 | return ret; | 178 | return ret; |
177 | 179 | ||
178 | clk_disable_unprepare(hsotg->clk); | 180 | if (hsotg->clk) |
181 | clk_disable_unprepare(hsotg->clk); | ||
179 | 182 | ||
180 | ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), | 183 | ret = regulator_bulk_disable(ARRAY_SIZE(hsotg->supplies), |
181 | hsotg->supplies); | 184 | hsotg->supplies); |