Lines Matching +full:boost +full:- +full:bypass

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * wm9712.c -- ALSA Soc WM9712 codec support
5 * Copyright 2006-12 Wolfson Microelectronics PLC.
106 static const char *wm9712_base[] = {"Linear Control", "Adaptive Boost"};
115 static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0);
166 SOC_SINGLE("PCBeep Bypass Headphone Volume", AC97_PC_BEEP, 12, 7, 1),
167 SOC_SINGLE("PCBeep Bypass Speaker Volume", AC97_PC_BEEP, 8, 7, 1),
168 SOC_SINGLE("PCBeep Bypass Phone Volume", AC97_PC_BEEP, 4, 7, 1),
177 SOC_SINGLE_TLV("Capture Boost Switch", AC97_REC_SEL, 14, 1, 0, boost_tlv),
178 SOC_SINGLE_TLV("Capture to Phone Boost Switch", AC97_REC_SEL, 11, 1, 1,
181 SOC_SINGLE("3D Upper Cut-off Switch", AC97_3D_CONTROL, 5, 1, 1),
182 SOC_SINGLE("3D Lower Cut-off Switch", AC97_3D_CONTROL, 4, 1, 1),
186 SOC_SINGLE("Bass Cut-off Switch", AC97_MASTER_TONE, 12, 1, 1),
187 SOC_SINGLE("Tone Cut-off Switch", AC97_MASTER_TONE, 4, 1, 1),
188 SOC_SINGLE("Playback Attenuate (-6dB) Switch", AC97_MASTER_TONE, 6, 1, 0),
199 SOC_SINGLE_TLV("Mic Boost Volume", AC97_MIC, 7, 1, 0, boost_tlv),
221 unsigned int val = ucontrol->value.integer.value[0]; in wm9712_hp_mixer_put()
223 (struct soc_mixer_control *)kcontrol->private_value; in wm9712_hp_mixer_put()
228 mixer = mc->shift >> 8; in wm9712_hp_mixer_put()
229 shift = mc->shift & 0xff; in wm9712_hp_mixer_put()
232 mutex_lock(&wm9712->lock); in wm9712_hp_mixer_put()
233 old = wm9712->hp_mixer[mixer]; in wm9712_hp_mixer_put()
234 if (ucontrol->value.integer.value[0]) in wm9712_hp_mixer_put()
235 wm9712->hp_mixer[mixer] |= mask; in wm9712_hp_mixer_put()
237 wm9712->hp_mixer[mixer] &= ~mask; in wm9712_hp_mixer_put()
239 change = old != wm9712->hp_mixer[mixer]; in wm9712_hp_mixer_put()
244 if ((wm9712->hp_mixer[0] & mask) || in wm9712_hp_mixer_put()
245 (wm9712->hp_mixer[1] & mask)) in wm9712_hp_mixer_put()
254 mutex_unlock(&wm9712->lock); in wm9712_hp_mixer_put()
266 (struct soc_mixer_control *)kcontrol->private_value; in wm9712_hp_mixer_get()
269 mixer = mc->shift >> 8; in wm9712_hp_mixer_get()
270 shift = mc->shift & 0xff; in wm9712_hp_mixer_get()
272 ucontrol->value.integer.value[0] = in wm9712_hp_mixer_get()
273 (wm9712->hp_mixer[mixer] >> shift) & 1; in wm9712_hp_mixer_get()
288 WM9712_HP_MIXER_CTRL("PCBeep Bypass Switch", HPL_MIXER, 5),
290 WM9712_HP_MIXER_CTRL("Phone Bypass Switch", HPL_MIXER, 3),
291 WM9712_HP_MIXER_CTRL("Line Bypass Switch", HPL_MIXER, 2),
298 WM9712_HP_MIXER_CTRL("PCBeep Bypass Switch", HPR_MIXER, 5),
300 WM9712_HP_MIXER_CTRL("Phone Bypass Switch", HPR_MIXER, 3),
301 WM9712_HP_MIXER_CTRL("Line Bypass Switch", HPR_MIXER, 2),
308 SOC_DAPM_SINGLE("PCBeep Bypass Switch", AC97_PC_BEEP, 11, 1, 1),
310 SOC_DAPM_SINGLE("Phone Bypass Switch", AC97_PHONE, 14, 1, 1),
311 SOC_DAPM_SINGLE("Line Bypass Switch", AC97_LINE, 14, 1, 1),
317 SOC_DAPM_SINGLE("PCBeep Bypass Switch", AC97_PC_BEEP, 7, 1, 1),
319 SOC_DAPM_SINGLE("Line Bypass Switch", AC97_LINE, 13, 1, 1),
415 /* virtual mixer - mixes left & right channels for spk and mono */
420 {"Left HP Mixer", "PCBeep Bypass Switch", "PCBEEP"},
422 {"Left HP Mixer", "Phone Bypass Switch", "Phone PGA"},
423 {"Left HP Mixer", "Line Bypass Switch", "Line PGA"},
429 {"Right HP Mixer", "PCBeep Bypass Switch", "PCBEEP"},
431 {"Right HP Mixer", "Phone Bypass Switch", "Phone PGA"},
432 {"Right HP Mixer", "Line Bypass Switch", "Line PGA"},
438 {"Speaker Mixer", "PCBeep Bypass Switch", "PCBEEP"},
439 {"Speaker Mixer", "Line Bypass Switch", "Line PGA"},
441 {"Speaker Mixer", "Phone Bypass Switch", "Phone PGA"},
445 {"Phone Mixer", "PCBeep Bypass Switch", "PCBEEP"},
446 {"Phone Mixer", "Line Bypass Switch", "Line PGA"},
526 struct snd_soc_component *component = dai->component; in ac97_prepare()
528 struct snd_pcm_runtime *runtime = substream->runtime; in ac97_prepare()
532 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in ac97_prepare()
537 return snd_soc_component_write(component, reg, runtime->rate); in ac97_prepare()
543 struct snd_soc_component *component = dai->component; in ac97_aux_prepare()
544 struct snd_pcm_runtime *runtime = substream->runtime; in ac97_aux_prepare()
549 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) in ac97_aux_prepare()
550 return -ENODEV; in ac97_aux_prepare()
552 return snd_soc_component_write(component, AC97_PCM_SURR_DAC_RATE, runtime->rate); in ac97_aux_prepare()
569 .name = "wm9712-hifi",
585 .name = "wm9712-aux",
620 ret = snd_ac97_reset(wm9712->ac97, true, WM9712_VENDOR_ID, in wm9712_soc_resume()
638 if (wm9712->mfd_pdata) { in wm9712_soc_probe()
639 wm9712->ac97 = wm9712->mfd_pdata->ac97; in wm9712_soc_probe()
640 regmap = wm9712->mfd_pdata->regmap; in wm9712_soc_probe()
644 wm9712->ac97 = snd_soc_new_ac97_component(component, WM9712_VENDOR_ID, in wm9712_soc_probe()
646 if (IS_ERR(wm9712->ac97)) { in wm9712_soc_probe()
647 ret = PTR_ERR(wm9712->ac97); in wm9712_soc_probe()
648 dev_err(component->dev, in wm9712_soc_probe()
653 regmap = regmap_init_ac97(wm9712->ac97, &wm9712_regmap_config); in wm9712_soc_probe()
655 snd_soc_free_ac97_component(wm9712->ac97); in wm9712_soc_probe()
659 return -ENXIO; in wm9712_soc_probe()
674 if (IS_ENABLED(CONFIG_SND_SOC_AC97_BUS) && !wm9712->mfd_pdata) { in wm9712_soc_remove()
676 snd_soc_free_ac97_component(wm9712->ac97); in wm9712_soc_remove()
702 wm9712 = devm_kzalloc(&pdev->dev, sizeof(*wm9712), GFP_KERNEL); in wm9712_probe()
704 return -ENOMEM; in wm9712_probe()
706 mutex_init(&wm9712->lock); in wm9712_probe()
708 wm9712->mfd_pdata = dev_get_platdata(&pdev->dev); in wm9712_probe()
711 return devm_snd_soc_register_component(&pdev->dev, in wm9712_probe()
717 .name = "wm9712-codec",