Lines Matching +full:dcvdd +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0+
3 // arizona-ldo1.c -- LDO1 supply for Arizona devices
22 #include <linux/regulator/arizona-ldo1.h>
36 struct regulator_consumer_supply supply; member
49 if (sel == rdev->desc->n_voltages - 1) in arizona_ldo1_hc_set_voltage_sel()
76 return rdev->desc->n_voltages - 1; in arizona_ldo1_hc_get_voltage_sel()
195 struct arizona_ldo1 *ldo1 = config->driver_data; in arizona_ldo1_of_get_pdata()
196 struct device_node *np = config->dev->of_node; in arizona_ldo1_of_get_pdata()
201 dcvdd_node = of_parse_phandle(np, "DCVDD-supply", 0); in arizona_ldo1_of_get_pdata()
204 config->of_node = init_node; in arizona_ldo1_of_get_pdata()
206 init_data = of_get_regulator_init_data(config->dev, init_node, in arizona_ldo1_of_get_pdata()
209 init_data->consumer_supplies = &ldo1->supply; in arizona_ldo1_of_get_pdata()
210 init_data->num_consumer_supplies = 1; in arizona_ldo1_of_get_pdata()
215 pdata->init_data = init_data; in arizona_ldo1_of_get_pdata()
232 struct device *parent_dev = pdev->dev.parent; in arizona_ldo1_common_init()
238 ldo1->supply.supply = "DCVDD"; in arizona_ldo1_common_init()
239 ldo1->init_data.consumer_supplies = &ldo1->supply; in arizona_ldo1_common_init()
240 ldo1->supply.dev_name = dev_name(parent_dev); in arizona_ldo1_common_init()
244 config.regmap = ldo1->regmap; in arizona_ldo1_common_init()
265 ldo1->ena_gpiod = config.ena_gpiod; in arizona_ldo1_common_init()
267 if (pdata->init_data) in arizona_ldo1_common_init()
268 config.init_data = pdata->init_data; in arizona_ldo1_common_init()
270 config.init_data = &ldo1->init_data; in arizona_ldo1_common_init()
273 * LDO1 can only be used to supply DCVDD so if it has no in arizona_ldo1_common_init()
274 * consumers then DCVDD is supplied externally. in arizona_ldo1_common_init()
276 if (config.init_data->num_consumer_supplies == 0) in arizona_ldo1_common_init()
279 ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config); in arizona_ldo1_common_init()
283 if (IS_ERR(ldo1->regulator)) { in arizona_ldo1_common_init()
284 ret = PTR_ERR(ldo1->regulator); in arizona_ldo1_common_init()
285 dev_err(&pdev->dev, "Failed to register LDO1 supply: %d\n", in arizona_ldo1_common_init()
297 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); in arizona_ldo1_probe()
303 ldo1 = devm_kzalloc(&pdev->dev, sizeof(*ldo1), GFP_KERNEL); in arizona_ldo1_probe()
305 return -ENOMEM; in arizona_ldo1_probe()
307 ldo1->regmap = arizona->regmap; in arizona_ldo1_probe()
314 switch (arizona->type) { in arizona_ldo1_probe()
320 ldo1->init_data = arizona_ldo1_dvfs; in arizona_ldo1_probe()
325 ldo1->init_data = arizona_ldo1_wm5110; in arizona_ldo1_probe()
329 ldo1->init_data = arizona_ldo1_default; in arizona_ldo1_probe()
334 &arizona->pdata.ldo1, in arizona_ldo1_probe()
337 arizona->external_dcvdd = external_dcvdd; in arizona_ldo1_probe()
346 if (ldo1->ena_gpiod) in arizona_ldo1_remove()
347 gpiod_put(ldo1->ena_gpiod); in arizona_ldo1_remove()
352 struct madera *madera = dev_get_drvdata(pdev->dev.parent); in madera_ldo1_probe()
357 ldo1 = devm_kzalloc(&pdev->dev, sizeof(*ldo1), GFP_KERNEL); in madera_ldo1_probe()
359 return -ENOMEM; in madera_ldo1_probe()
361 ldo1->regmap = madera->regmap; in madera_ldo1_probe()
363 ldo1->init_data = madera_ldo1_default; in madera_ldo1_probe()
366 &madera->pdata.ldo1, in madera_ldo1_probe()
371 madera->internal_dcvdd = !external_dcvdd; in madera_ldo1_probe()
380 .name = "arizona-ldo1",
389 .name = "madera-ldo1",
417 MODULE_ALIAS("platform:arizona-ldo1");
418 MODULE_ALIAS("platform:madera-ldo1");