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

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * wm8971.c -- WM8971 ALSA SoC Audio driver
47 { 4, 0x0000 },
94 static const char *wm8971_treble[] = { "8kHz", "4kHz" };
115 SOC_ENUM_SINGLE(WM8971_ALC1, 7, 4, wm8971_alc_func),
116 SOC_ENUM_SINGLE(WM8971_NGATE, 1, 2, wm8971_ng_type), /* 4 */
117 SOC_ENUM_SINGLE(WM8971_ADCDAC, 1, 4, wm8971_deemp),
118 SOC_ENUM_SINGLE(WM8971_ADCTL1, 4, 4, wm8971_mono_mux),
122 SOC_ENUM_SINGLE(WM8971_LADCIN, 6, 4, wm8971_lpga_sel),
123 SOC_ENUM_SINGLE(WM8971_RADCIN, 6, 4, wm8971_rpga_sel),
124 SOC_ENUM_SINGLE(WM8971_ADCDAC, 5, 4, wm8971_adcpol), /* 12 */
125 SOC_ENUM_SINGLE(WM8971_ADCIN, 6, 4, wm8971_mono_mux),
130 SOC_DOUBLE_R("Capture ZC Switch", WM8971_LINVOL, WM8971_RINVOL,
132 SOC_DOUBLE_R("Capture Switch", WM8971_LINVOL, WM8971_RINVOL, 7, 1, 1),
134 SOC_DOUBLE_R("Headphone Playback ZC Switch", WM8971_LOUT1V,
136 SOC_DOUBLE_R("Speaker Playback ZC Switch", WM8971_LOUT2V,
138 SOC_SINGLE("Mono Playback ZC Switch", WM8971_MOUTV, 7, 1, 0),
143 WM8971_LOUTM2, 4, 7, 1),
145 WM8971_ROUTM2, 4, 7, 1),
147 WM8971_MOUTM2, 4, 7, 1),
159 SOC_ENUM("Treble Cut-off", wm8971_enum[2]),
161 SOC_SINGLE("Capture Filter Switch", WM8971_ADCDAC, 0, 1, 1),
164 SOC_SINGLE("ALC Max Volume", WM8971_ALC1, 4, 7, 0),
167 SOC_SINGLE("ALC Capture Max Volume", WM8971_ALC1, 4, 7, 0),
169 SOC_SINGLE("ALC Capture ZC Switch", WM8971_ALC2, 7, 1, 0),
171 SOC_SINGLE("ALC Capture Decay Time", WM8971_ALC3, 4, 15, 0),
174 SOC_ENUM("ALC Capture NG Type", wm8971_enum[4]),
175 SOC_SINGLE("ALC Capture NG Switch", WM8971_NGATE, 0, 1, 0),
180 SOC_ENUM("Playback De-emphasis", wm8971_enum[5]),
184 SOC_DOUBLE_R("Mic Boost", WM8971_LADCIN, WM8971_RADCIN, 4, 3, 0),
193 SOC_DAPM_SINGLE("Playback Switch", WM8971_LOUTM1, 8, 1, 0),
194 SOC_DAPM_SINGLE("Left Bypass Switch", WM8971_LOUTM1, 7, 1, 0),
195 SOC_DAPM_SINGLE("Right Playback Switch", WM8971_LOUTM2, 8, 1, 0),
196 SOC_DAPM_SINGLE("Right Bypass Switch", WM8971_LOUTM2, 7, 1, 0),
201 SOC_DAPM_SINGLE("Left Playback Switch", WM8971_ROUTM1, 8, 1, 0),
202 SOC_DAPM_SINGLE("Left Bypass Switch", WM8971_ROUTM1, 7, 1, 0),
203 SOC_DAPM_SINGLE("Playback Switch", WM8971_ROUTM2, 8, 1, 0),
204 SOC_DAPM_SINGLE("Right Bypass Switch", WM8971_ROUTM2, 7, 1, 0),
209 SOC_DAPM_SINGLE("Left Playback Switch", WM8971_MOUTM1, 8, 1, 0),
210 SOC_DAPM_SINGLE("Left Bypass Switch", WM8971_MOUTM1, 7, 1, 0),
211 SOC_DAPM_SINGLE("Right Playback Switch", WM8971_MOUTM2, 8, 1, 0),
212 SOC_DAPM_SINGLE("Right Bypass Switch", WM8971_MOUTM2, 7, 1, 0),
247 SND_SOC_DAPM_PGA("Left Out 2", WM8971_PWR2, 4, 0, NULL, 0),
260 SND_SOC_DAPM_MUX("Right PGA Mux", WM8971_PWR1, 4, 0,
285 {"Left Mixer", "Playback Switch", "Left DAC"},
286 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
287 {"Left Mixer", "Right Playback Switch", "Right DAC"},
288 {"Left Mixer", "Right Bypass Switch", "Right Line Mux"},
291 {"Right Mixer", "Left Playback Switch", "Left DAC"},
292 {"Right Mixer", "Left Bypass Switch", "Left Line Mux"},
293 {"Right Mixer", "Playback Switch", "Right DAC"},
294 {"Right Mixer", "Right Bypass Switch", "Right Line Mux"},
313 {"Mono Mixer", "Left Playback Switch", "Left DAC"},
314 {"Mono Mixer", "Left Bypass Switch", "Left Line Mux"},
315 {"Mono Mixer", "Right Playback Switch", "Right DAC"},
316 {"Mono Mixer", "Right Bypass Switch", "Right Line Mux"},
426 return -EINVAL; in get_coeff()
432 struct snd_soc_component *component = codec_dai->component; in wm8971_set_dai_sysclk()
435 switch (freq) { in wm8971_set_dai_sysclk()
441 wm8971->sysclk = freq; in wm8971_set_dai_sysclk()
444 return -EINVAL; in wm8971_set_dai_sysclk()
450 struct snd_soc_component *component = codec_dai->component; in wm8971_set_dai_fmt()
454 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { in wm8971_set_dai_fmt()
461 return -EINVAL; in wm8971_set_dai_fmt()
465 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in wm8971_set_dai_fmt()
481 return -EINVAL; in wm8971_set_dai_fmt()
485 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { in wm8971_set_dai_fmt()
498 return -EINVAL; in wm8971_set_dai_fmt()
509 struct snd_soc_component *component = dai->component; in wm8971_pcm_hw_params()
513 int coeff = get_coeff(wm8971->sysclk, params_rate(params)); in wm8971_pcm_hw_params()
516 switch (params_width(params)) { in wm8971_pcm_hw_params()
541 struct snd_soc_component *component = dai->component; in wm8971_mute()
557 regmap_update_bits(wm8971->regmap, WM8971_PWR1, 0x0180, 0x0100); in wm8971_charge_work()
566 switch (level) { in wm8971_set_bias_level()
573 flush_delayed_work(&wm8971->charge_work); in wm8971_set_bias_level()
578 /* charge output caps - set vmid to 5k for quick power up */ in wm8971_set_bias_level()
581 &wm8971->charge_work, msecs_to_jiffies(1000)); in wm8971_set_bias_level()
589 cancel_delayed_work_sync(&wm8971->charge_work); in wm8971_set_bias_level()
612 .name = "wm8971-hifi",
632 INIT_DELAYED_WORK(&wm8971->charge_work, wm8971_charge_work); in wm8971_probe()
678 wm8971 = devm_kzalloc(&i2c->dev, sizeof(struct wm8971_priv), in wm8971_i2c_probe()
681 return -ENOMEM; in wm8971_i2c_probe()
683 wm8971->regmap = devm_regmap_init_i2c(i2c, &wm8971_regmap); in wm8971_i2c_probe()
684 if (IS_ERR(wm8971->regmap)) in wm8971_i2c_probe()
685 return PTR_ERR(wm8971->regmap); in wm8971_i2c_probe()
689 return devm_snd_soc_register_component(&i2c->dev, in wm8971_i2c_probe()