Lines Matching +full:4 +full:- +full:switch
1 // SPDX-License-Identifier: GPL-2.0-only
3 * wm8750.c -- WM8750 ALSA SoC audio driver
40 { 4, 0x0000 },
93 static const char *wm8750_treble[] = {"8kHz", "4kHz"};
120 SOC_ENUM_SINGLE(WM8750_ALC1, 7, 4, wm8750_alc_func),
124 SOC_ENUM_SINGLE(WM8750_LADCIN, 6, 4, wm8750_pga_sel), /* 10 */
125 SOC_ENUM_SINGLE(WM8750_RADCIN, 6, 4, wm8750_pga_sel),
126 SOC_ENUM_SINGLE(WM8750_ADCTL2, 7, 4, wm8750_out3),
128 SOC_ENUM_SINGLE(WM8750_ADCDAC, 5, 4, wm8750_adcpol),
129 SOC_ENUM_SINGLE(WM8750_ADCDAC, 1, 4, wm8750_deemph),
130 SOC_ENUM_SINGLE(WM8750_ADCIN, 6, 4, wm8750_mono_mux), /* 16 */
137 SOC_DOUBLE_R("Capture ZC Switch", WM8750_LINVOL, WM8750_RINVOL, 6, 1, 0),
138 SOC_DOUBLE_R("Capture Switch", WM8750_LINVOL, WM8750_RINVOL, 7, 1, 1),
140 SOC_DOUBLE_R("Headphone Playback ZC Switch", WM8750_LOUT1V,
142 SOC_DOUBLE_R("Speaker Playback ZC Switch", WM8750_LOUT2V,
145 SOC_ENUM("Playback De-emphasis", wm8750_enum[15]),
158 SOC_ENUM("Treble Cut-off", wm8750_enum[2]),
160 SOC_SINGLE("3D Switch", WM8750_3D, 0, 1, 0),
162 SOC_ENUM("3D Lower Cut-off", wm8750_enum[3]),
163 SOC_ENUM("3D Upper Cut-off", wm8750_enum[4]),
167 SOC_SINGLE("ALC Capture Max Volume", WM8750_ALC1, 4, 7, 0),
169 SOC_SINGLE("ALC Capture ZC Switch", WM8750_ALC2, 7, 1, 0),
171 SOC_SINGLE("ALC Capture Decay Time", WM8750_ALC3, 4, 15, 0),
174 SOC_ENUM("ALC Capture NG Type", wm8750_enum[4]),
175 SOC_SINGLE("ALC Capture NG Switch", WM8750_NGATE, 0, 1, 0),
180 SOC_SINGLE("ZC Timeout Switch", WM8750_ADCTL1, 0, 1, 0),
181 SOC_SINGLE("Playback Invert Switch", WM8750_ADCTL1, 1, 1, 0),
183 SOC_SINGLE("Right Speaker Playback Invert Switch", WM8750_ADCTL2, 4, 1, 0),
186 /* ADCDAC Bit 0 - ADCHPD */
187 /* ADCDAC Bit 4 - HPOR */
188 /* ADCTL1 Bit 2,3 - DATSEL */
189 /* ADCTL1 Bit 4,5 - DMONOMIX */
190 /* ADCTL1 Bit 6,7 - VSEL */
191 /* ADCTL2 Bit 2 - LRCM */
192 /* ADCTL2 Bit 3 - TRI */
193 /* ADCTL3 Bit 5 - HPFLREN */
194 /* ADCTL3 Bit 6 - VROI */
195 /* ADCTL3 Bit 7,8 - ADCLRM */
196 /* ADCIN Bit 4 - LDCM */
197 /* ADCIN Bit 5 - RDCM */
199 SOC_DOUBLE_R("Mic Boost", WM8750_LADCIN, WM8750_RADCIN, 4, 3, 0),
202 WM8750_LOUTM2, 4, 7, 1),
204 WM8750_ROUTM2, 4, 7, 1),
206 WM8750_MOUTM2, 4, 7, 1),
208 SOC_SINGLE("Mono Playback ZC Switch", WM8750_MOUTV, 7, 1, 0),
225 SOC_DAPM_SINGLE("Playback Switch", WM8750_LOUTM1, 8, 1, 0),
226 SOC_DAPM_SINGLE("Left Bypass Switch", WM8750_LOUTM1, 7, 1, 0),
227 SOC_DAPM_SINGLE("Right Playback Switch", WM8750_LOUTM2, 8, 1, 0),
228 SOC_DAPM_SINGLE("Right Bypass Switch", WM8750_LOUTM2, 7, 1, 0),
233 SOC_DAPM_SINGLE("Left Playback Switch", WM8750_ROUTM1, 8, 1, 0),
234 SOC_DAPM_SINGLE("Left Bypass Switch", WM8750_ROUTM1, 7, 1, 0),
235 SOC_DAPM_SINGLE("Playback Switch", WM8750_ROUTM2, 8, 1, 0),
236 SOC_DAPM_SINGLE("Right Bypass Switch", WM8750_ROUTM2, 7, 1, 0),
241 SOC_DAPM_SINGLE("Left Playback Switch", WM8750_MOUTM1, 8, 1, 0),
242 SOC_DAPM_SINGLE("Left Bypass Switch", WM8750_MOUTM1, 7, 1, 0),
243 SOC_DAPM_SINGLE("Right Playback Switch", WM8750_MOUTM2, 8, 1, 0),
244 SOC_DAPM_SINGLE("Right Bypass Switch", WM8750_MOUTM2, 7, 1, 0),
287 SND_SOC_DAPM_PGA("Left Out 2", WM8750_PWR2, 4, 0, NULL, 0),
299 SND_SOC_DAPM_MUX("Right PGA Mux", WM8750_PWR1, 4, 0,
335 {"Left Mixer", "Playback Switch", "Left DAC"},
336 {"Left Mixer", "Left Bypass Switch", "Left Line Mux"},
337 {"Left Mixer", "Right Playback Switch", "Right DAC"},
338 {"Left Mixer", "Right Bypass Switch", "Right Line Mux"},
341 {"Right Mixer", "Left Playback Switch", "Left DAC"},
342 {"Right Mixer", "Left Bypass Switch", "Left Line Mux"},
343 {"Right Mixer", "Playback Switch", "Right DAC"},
344 {"Right Mixer", "Right Bypass Switch", "Right Line Mux"},
363 {"Mono Mixer", "Left Playback Switch", "Left DAC"},
364 {"Mono Mixer", "Left Bypass Switch", "Left Line Mux"},
365 {"Mono Mixer", "Right Playback Switch", "Right DAC"},
366 {"Mono Mixer", "Right Bypass Switch", "Right Line Mux"},
496 return -EINVAL; in get_coeff()
502 struct snd_soc_component *component = codec_dai->component; in wm8750_set_dai_sysclk()
505 switch (freq) { in wm8750_set_dai_sysclk()
511 wm8750->sysclk = freq; in wm8750_set_dai_sysclk()
514 return -EINVAL; in wm8750_set_dai_sysclk()
520 struct snd_soc_component *component = codec_dai->component; in wm8750_set_dai_fmt()
524 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { in wm8750_set_dai_fmt()
531 return -EINVAL; in wm8750_set_dai_fmt()
535 switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) { in wm8750_set_dai_fmt()
551 return -EINVAL; in wm8750_set_dai_fmt()
555 switch (fmt & SND_SOC_DAIFMT_INV_MASK) { in wm8750_set_dai_fmt()
568 return -EINVAL; in wm8750_set_dai_fmt()
579 struct snd_soc_component *component = dai->component; in wm8750_pcm_hw_params()
583 int coeff = get_coeff(wm8750->sysclk, params_rate(params)); in wm8750_pcm_hw_params()
586 switch (params_width(params)) { in wm8750_pcm_hw_params()
611 struct snd_soc_component *component = dai->component; in wm8750_mute()
626 switch (level) { in wm8750_set_bias_level()
670 .name = "wm8750-hifi",
748 wm8750 = devm_kzalloc(&spi->dev, sizeof(struct wm8750_priv), in wm8750_spi_probe()
751 return -ENOMEM; in wm8750_spi_probe()
759 ret = devm_snd_soc_register_component(&spi->dev, in wm8750_spi_probe()
788 wm8750 = devm_kzalloc(&i2c->dev, sizeof(struct wm8750_priv), in wm8750_i2c_probe()
791 return -ENOMEM; in wm8750_i2c_probe()
799 ret = devm_snd_soc_register_component(&i2c->dev, in wm8750_i2c_probe()