Lines Matching +full:hpvdd +full:- +full:supply

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * wm8400.c -- WM8400 ALSA Soc Audio driver
5 * Copyright 2008-11 Wolfson Microelectronics PLC.
18 #include <linux/mfd/wm8400-audio.h>
19 #include <linux/mfd/wm8400-private.h>
32 .supply = "I2S1VDD",
35 .supply = "I2S2VDD",
38 .supply = "DCVDD",
41 .supply = "AVDD",
44 .supply = "FLLVDD",
47 .supply = "HPVDD",
50 .supply = "SPKVDD",
67 wm8400_reset_codec_reg_cache(wm8400->wm8400); in wm8400_component_reset()
70 static const DECLARE_TLV_DB_SCALE(in_pga_tlv, -1650, 3000, 0);
72 static const DECLARE_TLV_DB_SCALE(out_mix_tlv, -2100, 0, 0);
74 static const DECLARE_TLV_DB_SCALE(out_pga_tlv, -7300, 600, 0);
76 static const DECLARE_TLV_DB_SCALE(out_dac_tlv, -7163, 0, 0);
78 static const DECLARE_TLV_DB_SCALE(in_adc_tlv, -7163, 1763, 0);
80 static const DECLARE_TLV_DB_SCALE(out_sidetone_tlv, -3600, 0, 0);
87 (struct soc_mixer_control *)kcontrol->private_value; in wm8400_outpga_put_volsw_vu()
88 int reg = mc->reg; in wm8400_outpga_put_volsw_vu()
120 {"Hi-fi mode", "Voice mode 1", "Voice mode 2", "Voice mode 3"};
318 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in outmixer_event()
320 (struct soc_mixer_control *)kcontrol->private_value; in outmixer_event()
321 u32 reg_shift = mc->shift; in outmixer_event()
331 ret = -1; in outmixer_event()
339 ret = -1; in outmixer_event()
347 ret = -1; in outmixer_event()
355 ret = -1; in outmixer_event()
364 static const DECLARE_TLV_DB_SCALE(in_mix_tlv, -1200, 600, 0);
835 struct snd_soc_component *component = codec_dai->component; in wm8400_set_dai_sysclk()
838 wm8400->sysclk = freq; in wm8400_set_dai_sysclk()
858 factors->outdiv = 2; in fll_factors()
859 while (Fout * factors->outdiv < 90000000 || in fll_factors()
860 Fout * factors->outdiv > 100000000) { in fll_factors()
861 factors->outdiv *= 2; in fll_factors()
862 if (factors->outdiv > 32) { in fll_factors()
863 dev_err(wm8400->wm8400->dev, in fll_factors()
866 return -EINVAL; in fll_factors()
869 target = Fout * factors->outdiv; in fll_factors()
870 factors->outdiv = factors->outdiv >> 2; in fll_factors()
873 factors->freq_ref = 1; in fll_factors()
875 factors->freq_ref = 0; in fll_factors()
878 factors->fratio = 9; in fll_factors()
880 factors->fratio = 0; in fll_factors()
885 factors->fratio--; in fll_factors()
887 factors->fratio++; in fll_factors()
889 if (factors->fratio < 1 || factors->fratio > 8) { in fll_factors()
890 dev_err(wm8400->wm8400->dev, in fll_factors()
892 return -EINVAL; in fll_factors()
895 factors->n = target / (Fref * factors->fratio); in fll_factors()
896 Nmod = target % (Fref * factors->fratio); in fll_factors()
899 /* Calculate fractional part - scale up so we can round. */ in fll_factors()
902 do_div(Kpart, (Fref * factors->fratio)); in fll_factors()
910 factors->k = K / 10; in fll_factors()
912 dev_dbg(wm8400->wm8400->dev, in fll_factors()
915 factors->n, factors->k, factors->fratio, factors->outdiv); in fll_factors()
924 struct snd_soc_component *component = codec_dai->component; in wm8400_set_dai_pll()
930 if (freq_in == wm8400->fll_in && freq_out == wm8400->fll_out) in wm8400_set_dai_pll()
938 /* Bodge GCC 4.4.0 uninitialised variable warning - it in wm8400_set_dai_pll()
944 wm8400->fll_out = freq_out; in wm8400_set_dai_pll()
945 wm8400->fll_in = freq_in; in wm8400_set_dai_pll()
981 struct snd_soc_component *component = codec_dai->component; in wm8400_set_dai_fmt()
996 return -EINVAL; in wm8400_set_dai_fmt()
1023 return -EINVAL; in wm8400_set_dai_fmt()
1034 struct snd_soc_component *component = codec_dai->component; in wm8400_set_dai_clkdiv()
1059 return -EINVAL; in wm8400_set_dai_clkdiv()
1072 struct snd_soc_component *component = dai->component; in wm8400_hw_params()
1097 struct snd_soc_component *component = dai->component; in wm8400_mute()
1132 dev_err(wm8400->wm8400->dev, in wm8400_set_bias_level()
1242 .name = "wm8400-hifi",
1262 struct wm8400 *wm8400 = dev_get_platdata(component->dev); in wm8400_component_probe()
1267 priv = devm_kzalloc(component->dev, sizeof(struct wm8400_priv), in wm8400_component_probe()
1270 return -ENOMEM; in wm8400_component_probe()
1272 snd_soc_component_init_regmap(component, wm8400->regmap); in wm8400_component_probe()
1274 priv->wm8400 = wm8400; in wm8400_component_probe()
1276 ret = devm_regulator_bulk_get(wm8400->dev, in wm8400_component_probe()
1279 dev_err(component->dev, "Failed to get regulators: %d\n", ret); in wm8400_component_probe()
1329 return devm_snd_soc_register_component(&pdev->dev, in wm8400_probe()
1336 .name = "wm8400-codec",
1346 MODULE_ALIAS("platform:wm8400-codec");