Lines Matching +full:uniphier +full:- +full:ld20 +full:- +full:usb3 +full:- +full:regulator

1 // SPDX-License-Identifier: GPL-2.0
3 // Regulator controller driver for UniPhier SoC
13 #include <linux/regulator/driver.h>
14 #include <linux/regulator/of_regulator.h>
43 struct device *dev = &pdev->dev; in uniphier_regulator_probe()
54 return -ENOMEM; in uniphier_regulator_probe()
56 priv->data = of_device_get_match_data(dev); in uniphier_regulator_probe()
57 if (WARN_ON(!priv->data)) in uniphier_regulator_probe()
58 return -EINVAL; in uniphier_regulator_probe()
64 for (i = 0; i < priv->data->nclks; i++) in uniphier_regulator_probe()
65 priv->clk[i].id = priv->data->clock_names[i]; in uniphier_regulator_probe()
66 ret = devm_clk_bulk_get(dev, priv->data->nclks, priv->clk); in uniphier_regulator_probe()
70 for (i = 0; i < priv->data->nrsts; i++) { in uniphier_regulator_probe()
71 name = priv->data->reset_names[i]; in uniphier_regulator_probe()
72 priv->rst[i] = devm_reset_control_get_shared(dev, name); in uniphier_regulator_probe()
73 if (IS_ERR(priv->rst[i])) in uniphier_regulator_probe()
74 return PTR_ERR(priv->rst[i]); in uniphier_regulator_probe()
77 ret = clk_bulk_prepare_enable(priv->data->nclks, priv->clk); in uniphier_regulator_probe()
81 for (nr = 0; nr < priv->data->nrsts; nr++) { in uniphier_regulator_probe()
82 ret = reset_control_deassert(priv->rst[nr]); in uniphier_regulator_probe()
87 regmap = devm_regmap_init_mmio(dev, base, priv->data->regconf); in uniphier_regulator_probe()
95 config.of_node = dev->of_node; in uniphier_regulator_probe()
97 config.init_data = of_get_regulator_init_data(dev, dev->of_node, in uniphier_regulator_probe()
98 priv->data->desc); in uniphier_regulator_probe()
99 rdev = devm_regulator_register(dev, priv->data->desc, &config); in uniphier_regulator_probe()
110 while (nr--) in uniphier_regulator_probe()
111 reset_control_assert(priv->rst[nr]); in uniphier_regulator_probe()
113 clk_bulk_disable_unprepare(priv->data->nclks, priv->clk); in uniphier_regulator_probe()
123 for (i = 0; i < priv->data->nrsts; i++) in uniphier_regulator_remove()
124 reset_control_assert(priv->rst[i]); in uniphier_regulator_remove()
126 clk_bulk_disable_unprepare(priv->data->nclks, priv->clk); in uniphier_regulator_remove()
129 /* USB3 controller data */
181 .compatible = "socionext,uniphier-pro4-usb3-regulator",
185 .compatible = "socionext,uniphier-pro5-usb3-regulator",
189 .compatible = "socionext,uniphier-pxs2-usb3-regulator",
193 .compatible = "socionext,uniphier-ld20-usb3-regulator",
197 .compatible = "socionext,uniphier-pxs3-usb3-regulator",
201 .compatible = "socionext,uniphier-nx1-usb3-regulator",
212 .name = "uniphier-regulator",
220 MODULE_DESCRIPTION("UniPhier Regulator Controller Driver");