Lines Matching +full:vdd33 +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0
3 * dwc3-exynos.c - Samsung Exynos DWC3 Specific Glue layer
36 struct regulator *vdd33; member
52 struct device *dev = &pdev->dev; in dwc3_exynos_probe()
53 struct device_node *node = dev->of_node; in dwc3_exynos_probe()
59 return -ENOMEM; in dwc3_exynos_probe()
62 exynos->dev = dev; in dwc3_exynos_probe()
63 exynos->num_clks = driver_data->num_clks; in dwc3_exynos_probe()
64 exynos->clk_names = (const char **)driver_data->clk_names; in dwc3_exynos_probe()
65 exynos->suspend_clk_idx = driver_data->suspend_clk_idx; in dwc3_exynos_probe()
69 for (i = 0; i < exynos->num_clks; i++) { in dwc3_exynos_probe()
70 exynos->clks[i] = devm_clk_get(dev, exynos->clk_names[i]); in dwc3_exynos_probe()
71 if (IS_ERR(exynos->clks[i])) { in dwc3_exynos_probe()
73 exynos->clk_names[i]); in dwc3_exynos_probe()
74 return PTR_ERR(exynos->clks[i]); in dwc3_exynos_probe()
78 for (i = 0; i < exynos->num_clks; i++) { in dwc3_exynos_probe()
79 ret = clk_prepare_enable(exynos->clks[i]); in dwc3_exynos_probe()
81 while (i-- > 0) in dwc3_exynos_probe()
82 clk_disable_unprepare(exynos->clks[i]); in dwc3_exynos_probe()
87 if (exynos->suspend_clk_idx >= 0) in dwc3_exynos_probe()
88 clk_prepare_enable(exynos->clks[exynos->suspend_clk_idx]); in dwc3_exynos_probe()
90 exynos->vdd33 = devm_regulator_get(dev, "vdd33"); in dwc3_exynos_probe()
91 if (IS_ERR(exynos->vdd33)) { in dwc3_exynos_probe()
92 ret = PTR_ERR(exynos->vdd33); in dwc3_exynos_probe()
95 ret = regulator_enable(exynos->vdd33); in dwc3_exynos_probe()
97 dev_err(dev, "Failed to enable VDD33 supply\n"); in dwc3_exynos_probe()
101 exynos->vdd10 = devm_regulator_get(dev, "vdd10"); in dwc3_exynos_probe()
102 if (IS_ERR(exynos->vdd10)) { in dwc3_exynos_probe()
103 ret = PTR_ERR(exynos->vdd10); in dwc3_exynos_probe()
106 ret = regulator_enable(exynos->vdd10); in dwc3_exynos_probe()
108 dev_err(dev, "Failed to enable VDD10 supply\n"); in dwc3_exynos_probe()
120 ret = -ENODEV; in dwc3_exynos_probe()
127 regulator_disable(exynos->vdd10); in dwc3_exynos_probe()
129 regulator_disable(exynos->vdd33); in dwc3_exynos_probe()
131 for (i = exynos->num_clks - 1; i >= 0; i--) in dwc3_exynos_probe()
132 clk_disable_unprepare(exynos->clks[i]); in dwc3_exynos_probe()
134 if (exynos->suspend_clk_idx >= 0) in dwc3_exynos_probe()
135 clk_disable_unprepare(exynos->clks[exynos->suspend_clk_idx]); in dwc3_exynos_probe()
145 device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); in dwc3_exynos_remove()
147 for (i = exynos->num_clks - 1; i >= 0; i--) in dwc3_exynos_remove()
148 clk_disable_unprepare(exynos->clks[i]); in dwc3_exynos_remove()
150 if (exynos->suspend_clk_idx >= 0) in dwc3_exynos_remove()
151 clk_disable_unprepare(exynos->clks[exynos->suspend_clk_idx]); in dwc3_exynos_remove()
153 regulator_disable(exynos->vdd33); in dwc3_exynos_remove()
154 regulator_disable(exynos->vdd10); in dwc3_exynos_remove()
162 .suspend_clk_idx = -1,
179 .compatible = "samsung,exynos5250-dwusb3",
182 .compatible = "samsung,exynos5433-dwusb3",
185 .compatible = "samsung,exynos7-dwusb3",
198 for (i = exynos->num_clks - 1; i >= 0; i--) in dwc3_exynos_suspend()
199 clk_disable_unprepare(exynos->clks[i]); in dwc3_exynos_suspend()
201 regulator_disable(exynos->vdd33); in dwc3_exynos_suspend()
202 regulator_disable(exynos->vdd10); in dwc3_exynos_suspend()
212 ret = regulator_enable(exynos->vdd33); in dwc3_exynos_resume()
214 dev_err(dev, "Failed to enable VDD33 supply\n"); in dwc3_exynos_resume()
217 ret = regulator_enable(exynos->vdd10); in dwc3_exynos_resume()
219 dev_err(dev, "Failed to enable VDD10 supply\n"); in dwc3_exynos_resume()
223 for (i = 0; i < exynos->num_clks; i++) { in dwc3_exynos_resume()
224 ret = clk_prepare_enable(exynos->clks[i]); in dwc3_exynos_resume()
226 while (i-- > 0) in dwc3_exynos_resume()
227 clk_disable_unprepare(exynos->clks[i]); in dwc3_exynos_resume()
248 .name = "exynos-dwc3",