Lines Matching +full:spk +full:- +full:mono

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * wm9712.c -- ALSA Soc WM9712 codec support
5 * Copyright 2006-12 Wolfson Microelectronics PLC.
103 "Mono"};
115 static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0);
143 SOC_SINGLE("Mono Playback ZC Switch", AC97_MASTER_MONO, 7, 1, 0),
144 SOC_SINGLE("Mono Playback Volume", AC97_MASTER_MONO, 0, 31, 1),
145 SOC_SINGLE("Mono Playback Switch", AC97_MASTER_MONO, 15, 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),
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()
333 /* spk mux */
386 SND_SOC_DAPM_MIXER("Mono Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),
415 /* virtual mixer - mixes left & right channels for spk and mono */
504 /* mono mixer */
505 {"Mono Mixer", NULL, "Left HP Mixer"},
506 {"Mono Mixer", NULL, "Right HP Mixer"},
510 {"Out3 Mux", "Mono", "Phone Mixer"},
511 {"Out3 Mux", "Left + Right", "Mono Mixer"},
517 {"Speaker Mux", "Headphone Mix", "Mono Mixer"},
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()
701 wm9712 = devm_kzalloc(&pdev->dev, sizeof(*wm9712), GFP_KERNEL); in wm9712_probe()
703 return -ENOMEM; in wm9712_probe()
705 mutex_init(&wm9712->lock); in wm9712_probe()
707 wm9712->mfd_pdata = dev_get_platdata(&pdev->dev); in wm9712_probe()
710 return devm_snd_soc_register_component(&pdev->dev, in wm9712_probe()
716 .name = "wm9712-codec",