• Home
  • Raw
  • Download

Lines Matching +full:out +full:- +full:mono

2  * wm9713.c  --  ALSA Soc WM9713 codec support
4 * Copyright 2006-10 Wolfson Microelectronics PLC.
12 * Features:-
53 {"Mic 1", "Mic 2", "Line", "Mono In", "Headphone", "Speaker",
54 "Mono Out", "Zh"};
57 static const char *wm9713_mono_pga[] = {"Vmid", "Zh", "Mono", "Inv"};
66 {"Off", "Mono", "Speaker", "Left Headphone", "Right Headphone",
67 "Headphone Mono", "NC", "Vmid"};
76 SOC_ENUM_SINGLE(AC97_VIDEO, 9, 4, wm9713_rec_mux), /* record mux mono 2 */
81 SOC_ENUM_SINGLE(AC97_REC_GAIN, 14, 4, wm9713_mono_pga), /* mono input select 7 */
86 SOC_ENUM_SINGLE(AC97_REC_GAIN, 2, 4, wm9713_out3_pga), /* out 3 source 12 */
87 SOC_ENUM_SINGLE(AC97_REC_GAIN, 0, 4, wm9713_out4_pga), /* out 4 source 13 */
96 static const DECLARE_TLV_DB_SCALE(out_tlv, -4650, 150, 0);
97 static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0);
98 static const DECLARE_TLV_DB_SCALE(misc_tlv, -1500, 300, 0);
126 SOC_SINGLE("Capture to Mono Boost (+20dB) Switch", AC97_VIDEO, 8, 1, 0),
152 SOC_SINGLE_TLV("Mono Capture Volume", AC97_MASTER_TONE, 8, 31, 1, main_tlv),
153 SOC_SINGLE("Mono Playback Switch", AC97_MASTER_TONE, 7, 1, 1),
154 SOC_SINGLE("Mono Playback ZC Switch", AC97_MASTER_TONE, 6, 1, 0),
155 SOC_SINGLE_TLV("Mono Playback Volume", AC97_MASTER_TONE, 0, 31, 1, out_tlv),
161 SOC_SINGLE_TLV("Mono Mixer Beep Playback Volume", AC97_AUX, 4, 7, 1, misc_tlv),
166 SOC_SINGLE("Voice Playback Mono Volume", AC97_PCM, 4, 7, 1),
176 SOC_SINGLE_TLV("Mono Mixer Voice Playback Volume", AC97_PCM, 4, 7, 1,
178 SOC_SINGLE_TLV("Mono Mixer Aux Playback Volume", AC97_REC_SEL, 4, 7, 1,
185 SOC_SINGLE("Bass Cut-off Switch", AC97_GENERAL_PURPOSE, 12, 1, 1),
186 SOC_SINGLE("Tone Cut-off Switch", AC97_GENERAL_PURPOSE, 4, 1, 1),
187 SOC_SINGLE("Playback Attenuate (-6dB) Switch", AC97_GENERAL_PURPOSE, 6, 1, 0),
191 SOC_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
192 SOC_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
199 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); in wm9713_voice_shutdown()
202 return -EINVAL; in wm9713_voice_shutdown()
234 unsigned int val = ucontrol->value.integer.value[0]; in wm9713_hp_mixer_put()
236 (struct soc_mixer_control *)kcontrol->private_value; in wm9713_hp_mixer_put()
241 mixer = mc->shift >> 8; in wm9713_hp_mixer_put()
242 shift = mc->shift & 0xff; in wm9713_hp_mixer_put()
245 mutex_lock(&wm9713->lock); in wm9713_hp_mixer_put()
246 old = wm9713->hp_mixer[mixer]; in wm9713_hp_mixer_put()
247 if (ucontrol->value.integer.value[0]) in wm9713_hp_mixer_put()
248 wm9713->hp_mixer[mixer] |= mask; in wm9713_hp_mixer_put()
250 wm9713->hp_mixer[mixer] &= ~mask; in wm9713_hp_mixer_put()
252 change = old != wm9713->hp_mixer[mixer]; in wm9713_hp_mixer_put()
257 if ((wm9713->hp_mixer[0] & mask) || in wm9713_hp_mixer_put()
258 (wm9713->hp_mixer[1] & mask)) in wm9713_hp_mixer_put()
267 mutex_unlock(&wm9713->lock); in wm9713_hp_mixer_put()
279 (struct soc_mixer_control *)kcontrol->private_value; in wm9713_hp_mixer_get()
282 mixer = mc->shift >> 8; in wm9713_hp_mixer_get()
283 shift = mc->shift & 0xff; in wm9713_hp_mixer_get()
285 ucontrol->value.integer.value[0] = in wm9713_hp_mixer_get()
286 (wm9713->hp_mixer[mixer] >> shift) & 1; in wm9713_hp_mixer_get()
337 /* Mono Mixer */
349 /* mono mic mux */
353 /* mono output mux */
410 SND_SOC_DAPM_MUX("Capture Mono Mux", SND_SOC_NOPM, 0, 0,
412 SND_SOC_DAPM_MUX("Mono Out Mux", SND_SOC_NOPM, 0, 0,
414 SND_SOC_DAPM_MUX("Left Speaker Out Mux", SND_SOC_NOPM, 0, 0,
416 SND_SOC_DAPM_MUX("Right Speaker Out Mux", SND_SOC_NOPM, 0, 0,
418 SND_SOC_DAPM_MUX("Left Headphone Out Mux", SND_SOC_NOPM, 0, 0,
420 SND_SOC_DAPM_MUX("Right Headphone Out Mux", SND_SOC_NOPM, 0, 0,
422 SND_SOC_DAPM_MUX("Out 3 Mux", SND_SOC_NOPM, 0, 0,
424 SND_SOC_DAPM_MUX("Out 4 Mux", SND_SOC_NOPM, 0, 0,
442 SND_SOC_DAPM_MIXER("Mono Mixer", AC97_EXTENDED_MID, 0, 1,
466 SND_SOC_DAPM_PGA("Out 3", AC97_EXTENDED_MSTATUS, 11, 1, NULL, 0),
467 SND_SOC_DAPM_PGA("Out 4", AC97_EXTENDED_MSTATUS, 12, 1, NULL, 0),
468 SND_SOC_DAPM_PGA("Mono Out", AC97_EXTENDED_MSTATUS, 13, 1, NULL, 0),
471 SND_SOC_DAPM_PGA("Mono In", AC97_EXTENDED_MSTATUS, 4, 1, NULL, 0),
477 SND_SOC_DAPM_OUTPUT("MONO"),
501 {"Left HP Mixer", "MonoIn Playback Switch", "Mono In"},
510 {"Right HP Mixer", "MonoIn Playback Switch", "Mono In"},
513 /* virtual mixer - mixes left & right channels for spk and mono */
529 {"Speaker Mixer", "MonoIn Playback Switch", "Mono In"},
531 /* mono mixer */
532 {"Mono Mixer", "Beep Playback Switch", "PCBEEP"},
533 {"Mono Mixer", "Voice Playback Switch", "Voice DAC"},
534 {"Mono Mixer", "Aux Playback Switch", "Aux DAC"},
535 {"Mono Mixer", "Bypass Playback Switch", "Line Mixer"},
536 {"Mono Mixer", "PCM Playback Switch", "AC97 Mixer"},
537 {"Mono Mixer", "Mic 1 Sidetone Switch", "Mic A PGA"},
538 {"Mono Mixer", "Mic 2 Sidetone Switch", "Mic B PGA"},
539 {"Mono Mixer", NULL, "Capture Mono Mux"},
542 {"DAC Inv Mux 1", "Mono", "Mono Mixer"},
546 {"DAC Inv Mux 1", "Headphone Mono", "HP Mixer"},
549 {"DAC Inv Mux 2", "Mono", "Mono Mixer"},
553 {"DAC Inv Mux 2", "Headphone Mono", "HP Mixer"},
556 {"Left Headphone Out Mux", "Headphone", "Left HP Mixer"},
559 {"Right Headphone Out Mux", "Headphone", "Right HP Mixer"},
562 {"Left Speaker Out Mux", "Headphone", "Left HP Mixer"},
563 {"Left Speaker Out Mux", "Speaker", "Speaker Mixer"},
564 {"Left Speaker Out Mux", "Inv", "DAC Inv Mux 1"},
567 {"Right Speaker Out Mux", "Headphone", "Right HP Mixer"},
568 {"Right Speaker Out Mux", "Speaker", "Speaker Mixer"},
569 {"Right Speaker Out Mux", "Inv", "DAC Inv Mux 2"},
571 /* mono mux */
572 {"Mono Out Mux", "Mono", "Mono Mixer"},
573 {"Mono Out Mux", "Inv", "DAC Inv Mux 1"},
575 /* out 3 mux */
576 {"Out 3 Mux", "Inv 1", "DAC Inv Mux 1"},
578 /* out 4 mux */
579 {"Out 4 Mux", "Inv 2", "DAC Inv Mux 2"},
583 {"Left Headphone", NULL, "Left Headphone Out Mux"},
585 {"Right Headphone", NULL, "Right Headphone Out Mux"},
586 {"OUT3", NULL, "Out 3"},
587 {"Out 3", NULL, "Out 3 Mux"},
588 {"OUT4", NULL, "Out 4"},
589 {"Out 4", NULL, "Out 4 Mux"},
591 {"Left Speaker", NULL, "Left Speaker Out Mux"},
593 {"Right Speaker", NULL, "Right Speaker Out Mux"},
594 {"MONO", NULL, "Mono Out"},
595 {"Mono Out", NULL, "Mono Out Mux"},
600 {"Mono In", NULL, "MONOIN"},
608 {"Left Capture Source", "Mono In", "MONOIN"},
611 {"Left Capture Source", "Mono Out", "Mono Mixer"},
617 {"Right Capture Source", "Mono In", "MONOIN"},
620 {"Right Capture Source", "Mono Out", "Mono Mixer"},
645 /* mono capture */
646 {"Capture Mono Mux", "Stereo", "Capture Mixer"},
647 {"Capture Mono Mux", "Left", "Left Capture Source"},
648 {"Capture Mono Mux", "Right", "Right Capture Source"},
682 { 0x08, 0xc880 }, /* Mono Volume */
708 { 0x42, 0x0000 }, /* Fast Power-Up Control */
714 { 0x52, 0x0000 }, /* GPIO Pin Wake-Up */
768 pll_div->divsel = 1; in pll_factors()
772 pll_div->divctl = 1; in pll_factors()
774 pll_div->divctl = 0; in pll_factors()
777 pll_div->divsel = 0; in pll_factors()
778 pll_div->divctl = 0; in pll_factors()
785 pll_div->lf = 1; in pll_factors()
788 pll_div->lf = 0; in pll_factors()
792 dev_warn(component->dev, in pll_factors()
793 "WM9713 PLL N value %u out of recommended range!\n", in pll_factors()
796 pll_div->n = Ndiv; in pll_factors()
811 pll_div->k = K; in pll_factors()
830 wm9713->pll_in = 0; in wm9713_set_pll()
872 wm9713->pll_in = freq_in; in wm9713_set_pll()
882 struct snd_soc_component *component = codec_dai->component; in wm9713_set_dai_pll()
893 struct snd_soc_component *component = codec_dai->component; in wm9713_set_dai_tristate()
909 struct snd_soc_component *component = codec_dai->component; in wm9713_set_dai_clkdiv()
936 return -EINVAL; in wm9713_set_dai_clkdiv()
945 struct snd_soc_component *component = codec_dai->component; in wm9713_set_dai_fmt()
1008 struct snd_soc_component *component = dai->component; in wm9713_pcm_hw_params()
1033 struct snd_soc_component *component = dai->component; in ac97_hifi_prepare()
1034 struct snd_pcm_runtime *runtime = substream->runtime; in ac97_hifi_prepare()
1039 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in ac97_hifi_prepare()
1044 return snd_soc_component_write(component, reg, runtime->rate); in ac97_hifi_prepare()
1050 struct snd_soc_component *component = dai->component; in ac97_aux_prepare()
1051 struct snd_pcm_runtime *runtime = substream->runtime; in ac97_aux_prepare()
1056 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) in ac97_aux_prepare()
1057 return -ENODEV; in ac97_aux_prepare()
1059 return snd_soc_component_write(component, AC97_PCM_SURR_DAC_RATE, runtime->rate); in ac97_aux_prepare()
1101 .name = "wm9713-hifi",
1117 .name = "wm9713-aux",
1127 .name = "wm9713-voice",
1172 /* Disable everything except touchpanel - that will be handled in wm9713_soc_suspend()
1189 ret = snd_ac97_reset(wm9713->ac97, true, WM9713_VENDOR_ID, in wm9713_soc_resume()
1196 /* do we need to re-start the PLL ? */ in wm9713_soc_resume()
1197 if (wm9713->pll_in) in wm9713_soc_resume()
1198 wm9713_set_pll(component, 0, wm9713->pll_in, 0); in wm9713_soc_resume()
1202 regcache_mark_dirty(component->regmap); in wm9713_soc_resume()
1214 if (wm9713->mfd_pdata) { in wm9713_soc_probe()
1215 wm9713->ac97 = wm9713->mfd_pdata->ac97; in wm9713_soc_probe()
1216 regmap = wm9713->mfd_pdata->regmap; in wm9713_soc_probe()
1218 wm9713->ac97 = snd_soc_new_ac97_component(component, WM9713_VENDOR_ID, in wm9713_soc_probe()
1220 if (IS_ERR(wm9713->ac97)) in wm9713_soc_probe()
1221 return PTR_ERR(wm9713->ac97); in wm9713_soc_probe()
1222 regmap = regmap_init_ac97(wm9713->ac97, &wm9713_regmap_config); in wm9713_soc_probe()
1224 snd_soc_free_ac97_component(wm9713->ac97); in wm9713_soc_probe()
1228 return -ENXIO; in wm9713_soc_probe()
1233 /* unmute the adc - move to kcontrol */ in wm9713_soc_probe()
1243 if (IS_ENABLED(CONFIG_SND_SOC_AC97_BUS) && !wm9713->mfd_pdata) { in wm9713_soc_remove()
1245 snd_soc_free_ac97_component(wm9713->ac97); in wm9713_soc_remove()
1271 wm9713 = devm_kzalloc(&pdev->dev, sizeof(*wm9713), GFP_KERNEL); in wm9713_probe()
1273 return -ENOMEM; in wm9713_probe()
1275 mutex_init(&wm9713->lock); in wm9713_probe()
1277 wm9713->mfd_pdata = dev_get_platdata(&pdev->dev); in wm9713_probe()
1280 return devm_snd_soc_register_component(&pdev->dev, in wm9713_probe()
1286 .name = "wm9713-codec",