Lines Matching +full:4 +full:- +full:switch

1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8510.c -- WM8510 ALSA Soc Audio driver
38 { 4, 0x0050 },
95 switch (reg) { in wm8510_volatile()
113 static const char *wm8510_companding[] = { "Off", "NC", "u-law", "A-law" };
118 SOC_ENUM_SINGLE(WM8510_COMP, 1, 4, wm8510_companding), /* adc */
119 SOC_ENUM_SINGLE(WM8510_COMP, 3, 4, wm8510_companding), /* dac */
120 SOC_ENUM_SINGLE(WM8510_DAC, 4, 4, wm8510_deemp),
126 SOC_SINGLE("Digital Loopback Switch", WM8510_COMP, 0, 1, 0),
131 SOC_ENUM("Playback De-emphasis", wm8510_enum[2]),
132 SOC_SINGLE("DAC Inversion Switch", WM8510_DAC, 0, 1, 0),
136 SOC_SINGLE("High Pass Filter Switch", WM8510_ADC, 8, 1, 0),
137 SOC_SINGLE("High Pass Cut Off", WM8510_ADC, 4, 7, 0),
138 SOC_SINGLE("ADC Inversion Switch", WM8510_COMP, 0, 1, 0),
142 SOC_SINGLE("DAC Playback Limiter Switch", WM8510_DACLIM1, 8, 1, 0),
143 SOC_SINGLE("DAC Playback Limiter Decay", WM8510_DACLIM1, 4, 15, 0),
146 SOC_SINGLE("DAC Playback Limiter Threshold", WM8510_DACLIM2, 4, 7, 0),
149 SOC_SINGLE("ALC Enable Switch", WM8510_ALC1, 8, 1, 0),
153 SOC_SINGLE("ALC Capture ZC Switch", WM8510_ALC2, 8, 1, 0),
154 SOC_SINGLE("ALC Capture Hold", WM8510_ALC2, 4, 7, 0),
158 SOC_SINGLE("ALC Capture Decay", WM8510_ALC3, 4, 15, 0),
161 SOC_SINGLE("ALC Capture Noise Gate Switch", WM8510_NGATE, 3, 1, 0),
164 SOC_SINGLE("Capture PGA ZC Switch", WM8510_INPPGA, 7, 1, 0),
167 SOC_SINGLE("Speaker Playback ZC Switch", WM8510_SPKVOL, 7, 1, 0),
168 SOC_SINGLE("Speaker Playback Switch", WM8510_SPKVOL, 6, 1, 1),
173 SOC_SINGLE("Mono Playback Switch", WM8510_MONOMIX, 6, 1, 1),
178 SOC_DAPM_SINGLE("Line Bypass Switch", WM8510_SPKMIX, 1, 1, 0),
179 SOC_DAPM_SINGLE("Aux Playback Switch", WM8510_SPKMIX, 5, 1, 0),
180 SOC_DAPM_SINGLE("PCM Playback Switch", WM8510_SPKMIX, 0, 1, 0),
185 SOC_DAPM_SINGLE("Line Bypass Switch", WM8510_MONOMIX, 1, 1, 0),
186 SOC_DAPM_SINGLE("Aux Playback Switch", WM8510_MONOMIX, 2, 1, 0),
187 SOC_DAPM_SINGLE("PCM Playback Switch", WM8510_MONOMIX, 0, 1, 0),
191 SOC_DAPM_SINGLE("Mic PGA Switch", WM8510_INPPGA, 6, 1, 1),
193 SOC_DAPM_SINGLE("Mic Volume", WM8510_ADCBOOST, 4, 7, 0),
197 SOC_DAPM_SINGLE("MICP Switch", WM8510_INPUT, 0, 1, 0),
198 SOC_DAPM_SINGLE("MICN Switch", WM8510_INPUT, 1, 1, 0),
199 SOC_DAPM_SINGLE("AUX Switch", WM8510_INPUT, 2, 1, 0),
219 SND_SOC_DAPM_MIXER("Boost Mixer", WM8510_POWER2, 4, 0,
223 SND_SOC_DAPM_MICBIAS("Mic Bias", WM8510_POWER1, 4, 0),
235 {"Mono Mixer", "PCM Playback Switch", "DAC"},
236 {"Mono Mixer", "Aux Playback Switch", "Aux Input"},
237 {"Mono Mixer", "Line Bypass Switch", "Boost Mixer"},
240 {"Speaker Mixer", "PCM Playback Switch", "DAC"},
241 {"Speaker Mixer", "Aux Playback Switch", "Aux Input"},
242 {"Speaker Mixer", "Line Bypass Switch", "Boost Mixer"},
253 {"Mic PGA", "MICN Switch", "MICN"},
254 {"Mic PGA", "MICP Switch", "MICP"},
255 { "Mic PGA", "AUX Switch", "Aux Input" },
258 {"Boost Mixer", "Mic PGA Switch", "Mic PGA"},
266 unsigned int pre_div:4; /* prescale - 1 */
267 unsigned int n:4;
316 struct snd_soc_component *component = codec_dai->component; in wm8510_set_dai_pll()
330 pll_factors(freq_out*4, freq_in); in wm8510_set_dai_pll()
332 snd_soc_component_write(component, WM8510_PLLN, (pll_div.pre_div << 4) | pll_div.n); in wm8510_set_dai_pll()
352 struct snd_soc_component *component = codec_dai->component; in wm8510_set_dai_clkdiv()
355 switch (div_id) { in wm8510_set_dai_clkdiv()
377 return -EINVAL; in wm8510_set_dai_clkdiv()
386 struct snd_soc_component *component = codec_dai->component; in wm8510_set_dai_fmt()
391 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { in wm8510_set_dai_fmt()
398 return -EINVAL; in wm8510_set_dai_fmt()
402 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in wm8510_set_dai_fmt()
415 return -EINVAL; in wm8510_set_dai_fmt()
419 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { in wm8510_set_dai_fmt()
432 return -EINVAL; in wm8510_set_dai_fmt()
444 struct snd_soc_component *component = dai->component; in wm8510_pcm_hw_params()
449 switch (params_width(params)) { in wm8510_pcm_hw_params()
464 switch (params_rate(params)) { in wm8510_pcm_hw_params()
492 struct snd_soc_component *component = dai->component; in wm8510_mute()
509 switch (level) { in wm8510_set_bias_level()
520 regcache_sync(wm8510->regmap); in wm8510_set_bias_level()
558 .name = "wm8510-hifi",
621 wm8510 = devm_kzalloc(&spi->dev, sizeof(struct wm8510_priv), in wm8510_spi_probe()
624 return -ENOMEM; in wm8510_spi_probe()
626 wm8510->regmap = devm_regmap_init_spi(spi, &wm8510_regmap); in wm8510_spi_probe()
627 if (IS_ERR(wm8510->regmap)) in wm8510_spi_probe()
628 return PTR_ERR(wm8510->regmap); in wm8510_spi_probe()
632 ret = devm_snd_soc_register_component(&spi->dev, in wm8510_spi_probe()
653 wm8510 = devm_kzalloc(&i2c->dev, sizeof(struct wm8510_priv), in wm8510_i2c_probe()
656 return -ENOMEM; in wm8510_i2c_probe()
658 wm8510->regmap = devm_regmap_init_i2c(i2c, &wm8510_regmap); in wm8510_i2c_probe()
659 if (IS_ERR(wm8510->regmap)) in wm8510_i2c_probe()
660 return PTR_ERR(wm8510->regmap); in wm8510_i2c_probe()
664 ret = devm_snd_soc_register_component(&i2c->dev, in wm8510_i2c_probe()