Lines Matching +full:avdd1 +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8770.c -- WM8770 ALSA SoC Audio driver
31 "AVDD1",
94 * We can't use the same notifier block for more than one supply and
105 regcache_mark_dirty(wm8770->regmap); \
114 static const DECLARE_TLV_DB_SCALE(adc_tlv, -1200, 100, 0);
115 static const DECLARE_TLV_DB_SCALE(dac_dig_tlv, -12750, 50, 1);
116 static const DECLARE_TLV_DB_SCALE(dac_alg_tlv, -12700, 100, 1);
248 SND_SOC_DAPM_SUPPLY("VOUT12 Supply", SND_SOC_NOPM, 0, 0,
250 SND_SOC_DAPM_SUPPLY("VOUT34 Supply", SND_SOC_NOPM, 0, 0,
280 { "VOUT1 Mixer", NULL, "VOUT12 Supply" },
285 { "VOUT2 Mixer", NULL, "VOUT12 Supply" },
290 { "VOUT3 Mixer", NULL, "VOUT34 Supply" },
295 { "VOUT4 Mixer", NULL, "VOUT34 Supply" },
308 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vout12supply_event()
325 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in vout34supply_event()
349 component = dai->component; in wm8770_set_fmt()
359 return -EINVAL; in wm8770_set_fmt()
373 return -EINVAL; in wm8770_set_fmt()
389 return -EINVAL; in wm8770_set_fmt()
418 component = dai->component; in wm8770_hw_params()
436 switch (substream->stream) { in wm8770_hw_params()
446 return -EINVAL; in wm8770_hw_params()
452 ratio = wm8770->sysclk / params_rate(params); in wm8770_hw_params()
458 dev_err(component->dev, in wm8770_hw_params()
460 wm8770->sysclk, params_rate(params)); in wm8770_hw_params()
461 return -EINVAL; in wm8770_hw_params()
464 dev_dbg(component->dev, "MCLK is %dfs\n", mclk_ratios[i]); in wm8770_hw_params()
479 component = dai->component; in wm8770_mute()
490 component = dai->component; in wm8770_set_sysclk()
492 wm8770->sysclk = freq; in wm8770_set_sysclk()
511 ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies), in wm8770_set_bias_level()
512 wm8770->supplies); in wm8770_set_bias_level()
514 dev_err(component->dev, in wm8770_set_bias_level()
520 regcache_sync(wm8770->regmap); in wm8770_set_bias_level()
529 regulator_bulk_disable(ARRAY_SIZE(wm8770->supplies), in wm8770_set_bias_level()
530 wm8770->supplies); in wm8770_set_bias_level()
549 .name = "wm8770-hifi",
574 wm8770->component = component; in wm8770_probe()
576 ret = regulator_bulk_enable(ARRAY_SIZE(wm8770->supplies), in wm8770_probe()
577 wm8770->supplies); in wm8770_probe()
579 dev_err(component->dev, "Failed to enable supplies: %d\n", ret); in wm8770_probe()
585 dev_err(component->dev, "Failed to issue reset: %d\n", ret); in wm8770_probe()
605 regulator_bulk_disable(ARRAY_SIZE(wm8770->supplies), wm8770->supplies); in wm8770_probe()
645 wm8770 = devm_kzalloc(&spi->dev, sizeof(struct wm8770_priv), in wm8770_spi_probe()
648 return -ENOMEM; in wm8770_spi_probe()
650 for (i = 0; i < ARRAY_SIZE(wm8770->supplies); i++) in wm8770_spi_probe()
651 wm8770->supplies[i].supply = wm8770_supply_names[i]; in wm8770_spi_probe()
653 ret = devm_regulator_bulk_get(&spi->dev, ARRAY_SIZE(wm8770->supplies), in wm8770_spi_probe()
654 wm8770->supplies); in wm8770_spi_probe()
656 dev_err(&spi->dev, "Failed to request supplies: %d\n", ret); in wm8770_spi_probe()
660 wm8770->disable_nb[0].notifier_call = wm8770_regulator_event_0; in wm8770_spi_probe()
661 wm8770->disable_nb[1].notifier_call = wm8770_regulator_event_1; in wm8770_spi_probe()
662 wm8770->disable_nb[2].notifier_call = wm8770_regulator_event_2; in wm8770_spi_probe()
665 for (i = 0; i < ARRAY_SIZE(wm8770->supplies); i++) { in wm8770_spi_probe()
667 wm8770->supplies[i].consumer, in wm8770_spi_probe()
668 &wm8770->disable_nb[i]); in wm8770_spi_probe()
670 dev_err(&spi->dev, in wm8770_spi_probe()
676 wm8770->regmap = devm_regmap_init_spi(spi, &wm8770_regmap); in wm8770_spi_probe()
677 if (IS_ERR(wm8770->regmap)) in wm8770_spi_probe()
678 return PTR_ERR(wm8770->regmap); in wm8770_spi_probe()
682 ret = devm_snd_soc_register_component(&spi->dev, in wm8770_spi_probe()