Lines Matching +full:avdd1 +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0+
3 // wm8994-regulator.c -- Regulator driver for the WM8994
27 struct regulator_consumer_supply supply; member
47 return -EINVAL; in wm8994_ldo2_list_voltage()
49 switch (ldo->wm8994->type) { in wm8994_ldo2_list_voltage()
57 return -EINVAL; in wm8994_ldo2_list_voltage()
63 return -EINVAL; in wm8994_ldo2_list_voltage()
130 { .supply = "AVDD1" },
131 { .supply = "DCVDD" },
151 struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); in wm8994_ldo_probe()
152 struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev); in wm8994_ldo_probe()
153 int id = pdev->id % ARRAY_SIZE(pdata->ldo); in wm8994_ldo_probe()
159 dev_dbg(&pdev->dev, "Probing LDO%d\n", id + 1); in wm8994_ldo_probe()
161 ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_ldo), GFP_KERNEL); in wm8994_ldo_probe()
163 return -ENOMEM; in wm8994_ldo_probe()
165 ldo->wm8994 = wm8994; in wm8994_ldo_probe()
166 ldo->supply = wm8994_ldo_consumer[id]; in wm8994_ldo_probe()
167 ldo->supply.dev_name = dev_name(wm8994->dev); in wm8994_ldo_probe()
169 config.dev = wm8994->dev; in wm8994_ldo_probe()
171 config.regmap = wm8994->regmap; in wm8994_ldo_probe()
172 config.init_data = &ldo->init_data; in wm8994_ldo_probe()
178 gpiod = gpiod_get_optional(pdev->dev.parent, in wm8994_ldo_probe()
187 if (!pdata || !pdata->ldo[id].init_data || wm8994->dev->of_node) { in wm8994_ldo_probe()
188 dev_dbg(wm8994->dev, "Using default init data, supply %s %s\n", in wm8994_ldo_probe()
189 ldo->supply.dev_name, ldo->supply.supply); in wm8994_ldo_probe()
191 ldo->init_data = wm8994_ldo_default[id]; in wm8994_ldo_probe()
192 ldo->init_data.consumer_supplies = &ldo->supply; in wm8994_ldo_probe()
194 ldo->init_data.constraints.valid_ops_mask = 0; in wm8994_ldo_probe()
196 ldo->init_data = *pdata->ldo[id].init_data; in wm8994_ldo_probe()
204 if (ldo->wm8994->type == WM8994) { in wm8994_ldo_probe()
205 ldo->regulator = devm_regulator_register(&pdev->dev, in wm8994_ldo_probe()
209 ldo->regulator = devm_regulator_register(&pdev->dev, in wm8994_ldo_probe()
214 if (IS_ERR(ldo->regulator)) { in wm8994_ldo_probe()
215 ret = PTR_ERR(ldo->regulator); in wm8994_ldo_probe()
216 dev_err(wm8994->dev, "Failed to register LDO%d: %d\n", in wm8994_ldo_probe()
229 .name = "wm8994-ldo",
240 MODULE_ALIAS("platform:wm8994-ldo");