• Home
  • Raw
  • Download

Lines Matching +full:micvdd +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0+
3 // arizona-micsupp.c -- Microphone supply for Arizona devices
31 #include <linux/regulator/arizona-micsupp.h>
40 struct regulator_consumer_supply supply; member
50 struct snd_soc_dapm_context *dapm = *micsupp->dapm; in arizona_micsupp_check_cp()
55 ret = regmap_read(micsupp->regmap, micsupp->enable_reg, &val); in arizona_micsupp_check_cp()
57 dev_err(micsupp->dev, in arizona_micsupp_check_cp()
84 schedule_work(&micsupp->check_cp_work); in arizona_micsupp_enable()
96 schedule_work(&micsupp->check_cp_work); in arizona_micsupp_disable()
108 schedule_work(&micsupp->check_cp_work); in arizona_micsupp_set_bypass()
134 .name = "MICVDD",
161 .name = "MICVDD",
207 .name = "MICVDD",
232 struct arizona_micsupp *micsupp = config->driver_data; in arizona_micsupp_of_get_pdata()
236 np = of_get_child_by_name(config->dev->of_node, "micvdd"); in arizona_micsupp_of_get_pdata()
239 config->of_node = np; in arizona_micsupp_of_get_pdata()
241 init_data = of_get_regulator_init_data(config->dev, np, desc); in arizona_micsupp_of_get_pdata()
244 init_data->consumer_supplies = &micsupp->supply; in arizona_micsupp_of_get_pdata()
245 init_data->num_consumer_supplies = 1; in arizona_micsupp_of_get_pdata()
247 pdata->init_data = init_data; in arizona_micsupp_of_get_pdata()
262 INIT_WORK(&micsupp->check_cp_work, arizona_micsupp_check_cp); in arizona_micsupp_common_init()
264 micsupp->init_data.consumer_supplies = &micsupp->supply; in arizona_micsupp_common_init()
265 micsupp->supply.supply = "MICVDD"; in arizona_micsupp_common_init()
266 micsupp->supply.dev_name = dev_name(micsupp->dev); in arizona_micsupp_common_init()
267 micsupp->enable_reg = desc->enable_reg; in arizona_micsupp_common_init()
269 config.dev = micsupp->dev; in arizona_micsupp_common_init()
271 config.regmap = micsupp->regmap; in arizona_micsupp_common_init()
274 if (!dev_get_platdata(micsupp->dev)) { in arizona_micsupp_common_init()
282 if (pdata->init_data) in arizona_micsupp_common_init()
283 config.init_data = pdata->init_data; in arizona_micsupp_common_init()
285 config.init_data = &micsupp->init_data; in arizona_micsupp_common_init()
288 regmap_update_bits(micsupp->regmap, micsupp->enable_reg, in arizona_micsupp_common_init()
291 micsupp->regulator = devm_regulator_register(&pdev->dev, in arizona_micsupp_common_init()
297 if (IS_ERR(micsupp->regulator)) { in arizona_micsupp_common_init()
298 ret = PTR_ERR(micsupp->regulator); in arizona_micsupp_common_init()
299 dev_err(micsupp->dev, "Failed to register mic supply: %d\n", in arizona_micsupp_common_init()
311 struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); in arizona_micsupp_probe()
315 micsupp = devm_kzalloc(&pdev->dev, sizeof(*micsupp), GFP_KERNEL); in arizona_micsupp_probe()
317 return -ENOMEM; in arizona_micsupp_probe()
319 micsupp->regmap = arizona->regmap; in arizona_micsupp_probe()
320 micsupp->dapm = &arizona->dapm; in arizona_micsupp_probe()
321 micsupp->dev = arizona->dev; in arizona_micsupp_probe()
328 switch (arizona->type) { in arizona_micsupp_probe()
332 micsupp->init_data = arizona_micsupp_ext_default; in arizona_micsupp_probe()
336 micsupp->init_data = arizona_micsupp_default; in arizona_micsupp_probe()
341 &arizona->pdata.micvdd); in arizona_micsupp_probe()
346 struct madera *madera = dev_get_drvdata(pdev->dev.parent); in madera_micsupp_probe()
349 micsupp = devm_kzalloc(&pdev->dev, sizeof(*micsupp), GFP_KERNEL); in madera_micsupp_probe()
351 return -ENOMEM; in madera_micsupp_probe()
353 micsupp->regmap = madera->regmap; in madera_micsupp_probe()
354 micsupp->dapm = &madera->dapm; in madera_micsupp_probe()
355 micsupp->dev = madera->dev; in madera_micsupp_probe()
356 micsupp->init_data = arizona_micsupp_ext_default; in madera_micsupp_probe()
359 &madera->pdata.micvdd); in madera_micsupp_probe()
365 .name = "arizona-micsupp",
372 .name = "madera-micsupp",
397 MODULE_DESCRIPTION("Arizona microphone supply driver");
399 MODULE_ALIAS("platform:arizona-micsupp");
400 MODULE_ALIAS("platform:madera-micsupp");