aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivek Gautam <gautam.vivek@samsung.com>2014-11-21 08:35:47 -0500
committerFelipe Balbi <balbi@ti.com>2014-11-21 10:07:29 -0500
commited692a99f31c92ec649ee2f7a0ecb4aa0f69d853 (patch)
treebaf45a59d5289368df477658c2a2b3b882424b37
parent72d996fc7a01c2e4d581a15db7d001e2799ffb29 (diff)
usb: dwc3: exynos: Add provision for AXI UpScaler clock on exynos7
DWC3 controller on Exynos7 SoC has separate control for AXI UpScaler which connects DWC3 DRD controller to AXI bus. Get the gate clock for the same to control it across power cycles. Suggested-by: Anton Tikhomirov <av.tikhomirov@samsung.com> Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r--Documentation/devicetree/bindings/usb/exynos-usb.txt6
-rw-r--r--drivers/usb/dwc3/dwc3-exynos.c17
2 files changed, 21 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/usb/exynos-usb.txt b/Documentation/devicetree/bindings/usb/exynos-usb.txt
index a3b5990d0f2c..9b4dbe3b2acc 100644
--- a/Documentation/devicetree/bindings/usb/exynos-usb.txt
+++ b/Documentation/devicetree/bindings/usb/exynos-usb.txt
@@ -82,8 +82,10 @@ Example:
82 82
83DWC3 83DWC3
84Required properties: 84Required properties:
85 - compatible: should be "samsung,exynos5250-dwusb3" for USB 3.0 DWC3 85 - compatible: should be one of the following -
86 controller. 86 "samsung,exynos5250-dwusb3": for USB 3.0 DWC3 controller on
87 Exynos5250/5420.
88 "samsung,exynos7-dwusb3": for USB 3.0 DWC3 controller on Exynos7.
87 - #address-cells, #size-cells : should be '1' if the device has sub-nodes 89 - #address-cells, #size-cells : should be '1' if the device has sub-nodes
88 with 'reg' property. 90 with 'reg' property.
89 - ranges: allows valid 1:1 translation between child's address space and 91 - ranges: allows valid 1:1 translation between child's address space and
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
index a1782d86a226..7bd0a95b2815 100644
--- a/drivers/usb/dwc3/dwc3-exynos.c
+++ b/drivers/usb/dwc3/dwc3-exynos.c
@@ -35,6 +35,7 @@ struct dwc3_exynos {
35 35
36 struct clk *clk; 36 struct clk *clk;
37 struct clk *susp_clk; 37 struct clk *susp_clk;
38 struct clk *axius_clk;
38 39
39 struct regulator *vdd33; 40 struct regulator *vdd33;
40 struct regulator *vdd10; 41 struct regulator *vdd10;
@@ -149,6 +150,17 @@ static int dwc3_exynos_probe(struct platform_device *pdev)
149 } 150 }
150 clk_prepare_enable(exynos->susp_clk); 151 clk_prepare_enable(exynos->susp_clk);
151 152
153 if (of_device_is_compatible(node, "samsung,exynos7-dwusb3")) {
154 exynos->axius_clk = devm_clk_get(dev, "usbdrd30_axius_clk");
155 if (IS_ERR(exynos->axius_clk)) {
156 dev_err(dev, "no AXI UpScaler clk specified\n");
157 return -ENODEV;
158 }
159 clk_prepare_enable(exynos->axius_clk);
160 } else {
161 exynos->axius_clk = NULL;
162 }
163
152 exynos->vdd33 = devm_regulator_get(dev, "vdd33"); 164 exynos->vdd33 = devm_regulator_get(dev, "vdd33");
153 if (IS_ERR(exynos->vdd33)) { 165 if (IS_ERR(exynos->vdd33)) {
154 ret = PTR_ERR(exynos->vdd33); 166 ret = PTR_ERR(exynos->vdd33);
@@ -190,6 +202,7 @@ err4:
190err3: 202err3:
191 regulator_disable(exynos->vdd33); 203 regulator_disable(exynos->vdd33);
192err2: 204err2:
205 clk_disable_unprepare(exynos->axius_clk);
193 clk_disable_unprepare(exynos->susp_clk); 206 clk_disable_unprepare(exynos->susp_clk);
194 clk_disable_unprepare(exynos->clk); 207 clk_disable_unprepare(exynos->clk);
195 return ret; 208 return ret;
@@ -203,6 +216,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
203 platform_device_unregister(exynos->usb2_phy); 216 platform_device_unregister(exynos->usb2_phy);
204 platform_device_unregister(exynos->usb3_phy); 217 platform_device_unregister(exynos->usb3_phy);
205 218
219 clk_disable_unprepare(exynos->axius_clk);
206 clk_disable_unprepare(exynos->susp_clk); 220 clk_disable_unprepare(exynos->susp_clk);
207 clk_disable_unprepare(exynos->clk); 221 clk_disable_unprepare(exynos->clk);
208 222
@@ -214,6 +228,7 @@ static int dwc3_exynos_remove(struct platform_device *pdev)
214 228
215static const struct of_device_id exynos_dwc3_match[] = { 229static const struct of_device_id exynos_dwc3_match[] = {
216 { .compatible = "samsung,exynos5250-dwusb3" }, 230 { .compatible = "samsung,exynos5250-dwusb3" },
231 { .compatible = "samsung,exynos7-dwusb3" },
217 {}, 232 {},
218}; 233};
219MODULE_DEVICE_TABLE(of, exynos_dwc3_match); 234MODULE_DEVICE_TABLE(of, exynos_dwc3_match);
@@ -223,6 +238,7 @@ static int dwc3_exynos_suspend(struct device *dev)
223{ 238{
224 struct dwc3_exynos *exynos = dev_get_drvdata(dev); 239 struct dwc3_exynos *exynos = dev_get_drvdata(dev);
225 240
241 clk_disable(exynos->axius_clk);
226 clk_disable(exynos->clk); 242 clk_disable(exynos->clk);
227 243
228 regulator_disable(exynos->vdd33); 244 regulator_disable(exynos->vdd33);
@@ -248,6 +264,7 @@ static int dwc3_exynos_resume(struct device *dev)
248 } 264 }
249 265
250 clk_enable(exynos->clk); 266 clk_enable(exynos->clk);
267 clk_enable(exynos->axius_clk);
251 268
252 /* runtime set active to reflect active state. */ 269 /* runtime set active to reflect active state. */
253 pm_runtime_disable(dev); 270 pm_runtime_disable(dev);