Lines Matching +full:gpio +full:- +full:mux +full:- +full:clock
2 * wm9713.c -- ALSA Soc WM9713 codec support
12 * Features:-
96 SOC_ENUM_SINGLE(AC97_VIDEO, 14, 4, wm9713_rec_mux), /* record mux hp 1 */
97 SOC_ENUM_SINGLE(AC97_VIDEO, 9, 4, wm9713_rec_mux), /* record mux mono 2 */
98 SOC_ENUM_SINGLE(AC97_VIDEO, 3, 8, wm9713_rec_src), /* record mux left 3 */
99 SOC_ENUM_SINGLE(AC97_VIDEO, 0, 8, wm9713_rec_src), /* record mux right 4*/
117 static const DECLARE_TLV_DB_SCALE(out_tlv, -4650, 150, 0);
118 static const DECLARE_TLV_DB_SCALE(main_tlv, -3450, 150, 0);
119 static const DECLARE_TLV_DB_SCALE(misc_tlv, -1500, 300, 0);
207 SOC_SINGLE("Bass Cut-off Switch", AC97_GENERAL_PURPOSE, 12, 1, 1),
208 SOC_SINGLE("Tone Cut-off Switch", AC97_GENERAL_PURPOSE, 4, 1, 1),
209 SOC_SINGLE("Playback Attenuate (-6dB) Switch", AC97_GENERAL_PURPOSE, 6, 1, 0),
213 SOC_SINGLE("3D Upper Cut-off Switch", AC97_REC_GAIN_MIC, 5, 1, 0),
214 SOC_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0),
221 struct snd_soc_codec *codec = w->codec; in wm9713_voice_shutdown()
249 l = ac97_read(w->codec, HPL_MIXER); in mixer_event()
250 r = ac97_read(w->codec, HPR_MIXER); in mixer_event()
251 beep = ac97_read(w->codec, AC97_PC_BEEP); in mixer_event()
252 tone = ac97_read(w->codec, AC97_MASTER_TONE); in mixer_event()
253 phone = ac97_read(w->codec, AC97_PHONE); in mixer_event()
254 rec = ac97_read(w->codec, AC97_REC_SEL); in mixer_event()
255 pcm = ac97_read(w->codec, AC97_PCM); in mixer_event()
256 aux = ac97_read(w->codec, AC97_AUX); in mixer_event()
261 ac97_write(w->codec, AC97_PC_BEEP, beep & 0x7fff); in mixer_event()
263 ac97_write(w->codec, AC97_PC_BEEP, beep | 0x8000); in mixer_event()
266 ac97_write(w->codec, AC97_MASTER_TONE, tone & 0x7fff); in mixer_event()
268 ac97_write(w->codec, AC97_MASTER_TONE, tone | 0x8000); in mixer_event()
271 ac97_write(w->codec, AC97_PHONE, phone & 0x7fff); in mixer_event()
273 ac97_write(w->codec, AC97_PHONE, phone | 0x8000); in mixer_event()
276 ac97_write(w->codec, AC97_REC_SEL, rec & 0x7fff); in mixer_event()
278 ac97_write(w->codec, AC97_REC_SEL, rec | 0x8000); in mixer_event()
281 ac97_write(w->codec, AC97_PCM, pcm & 0x7fff); in mixer_event()
283 ac97_write(w->codec, AC97_PCM, pcm | 0x8000); in mixer_event()
286 ac97_write(w->codec, AC97_AUX, aux & 0x7fff); in mixer_event()
288 ac97_write(w->codec, AC97_AUX, aux | 0x8000); in mixer_event()
313 /* headphone capture mux */
317 /* headphone mic mux */
343 /* mono mic mux */
347 /* mono output mux */
351 /* speaker left output mux */
355 /* speaker right output mux */
359 /* headphone left output mux */
363 /* headphone right output mux */
367 /* Out3 mux */
371 /* Out4 mux */
375 /* DAC inv mux 1 */
379 /* DAC inv mux 2 */
400 SND_SOC_DAPM_MUX("Capture Headphone Mux", SND_SOC_NOPM, 0, 0,
402 SND_SOC_DAPM_MUX("Sidetone Mux", SND_SOC_NOPM, 0, 0,
404 SND_SOC_DAPM_MUX("Capture Mono Mux", SND_SOC_NOPM, 0, 0,
406 SND_SOC_DAPM_MUX("Mono Out Mux", SND_SOC_NOPM, 0, 0,
408 SND_SOC_DAPM_MUX("Left Speaker Out Mux", SND_SOC_NOPM, 0, 0,
410 SND_SOC_DAPM_MUX("Right Speaker Out Mux", SND_SOC_NOPM, 0, 0,
412 SND_SOC_DAPM_MUX("Left Headphone Out Mux", SND_SOC_NOPM, 0, 0,
414 SND_SOC_DAPM_MUX("Right Headphone Out Mux", SND_SOC_NOPM, 0, 0,
416 SND_SOC_DAPM_MUX("Out 3 Mux", SND_SOC_NOPM, 0, 0,
418 SND_SOC_DAPM_MUX("Out 4 Mux", SND_SOC_NOPM, 0, 0,
420 SND_SOC_DAPM_MUX("DAC Inv Mux 1", SND_SOC_NOPM, 0, 0,
422 SND_SOC_DAPM_MUX("DAC Inv Mux 2", SND_SOC_NOPM, 0, 0,
498 {"Left HP Mixer", NULL, "Capture Headphone Mux"},
507 {"Right HP Mixer", NULL, "Capture Headphone Mux"},
509 /* virtual mixer - mixes left & right channels for spk and mono */
535 {"Mono Mixer", NULL, "Capture Mono Mux"},
537 /* DAC inv mux 1 */
538 {"DAC Inv Mux 1", "Mono", "Mono Mixer"},
539 {"DAC Inv Mux 1", "Speaker", "Speaker Mixer"},
540 {"DAC Inv Mux 1", "Left Headphone", "Left HP Mixer"},
541 {"DAC Inv Mux 1", "Right Headphone", "Right HP Mixer"},
542 {"DAC Inv Mux 1", "Headphone Mono", "HP Mixer"},
544 /* DAC inv mux 2 */
545 {"DAC Inv Mux 2", "Mono", "Mono Mixer"},
546 {"DAC Inv Mux 2", "Speaker", "Speaker Mixer"},
547 {"DAC Inv Mux 2", "Left Headphone", "Left HP Mixer"},
548 {"DAC Inv Mux 2", "Right Headphone", "Right HP Mixer"},
549 {"DAC Inv Mux 2", "Headphone Mono", "HP Mixer"},
551 /* headphone left mux */
552 {"Left Headphone Out Mux", "Headphone", "Left HP Mixer"},
554 /* headphone right mux */
555 {"Right Headphone Out Mux", "Headphone", "Right HP Mixer"},
557 /* speaker left mux */
558 {"Left Speaker Out Mux", "Headphone", "Left HP Mixer"},
559 {"Left Speaker Out Mux", "Speaker", "Speaker Mixer"},
560 {"Left Speaker Out Mux", "Inv", "DAC Inv Mux 1"},
562 /* speaker right mux */
563 {"Right Speaker Out Mux", "Headphone", "Right HP Mixer"},
564 {"Right Speaker Out Mux", "Speaker", "Speaker Mixer"},
565 {"Right Speaker Out Mux", "Inv", "DAC Inv Mux 2"},
567 /* mono mux */
568 {"Mono Out Mux", "Mono", "Mono Mixer"},
569 {"Mono Out Mux", "Inv", "DAC Inv Mux 1"},
571 /* out 3 mux */
572 {"Out 3 Mux", "Inv 1", "DAC Inv Mux 1"},
574 /* out 4 mux */
575 {"Out 4 Mux", "Inv 2", "DAC Inv Mux 2"},
579 {"Left Headphone", NULL, "Left Headphone Out Mux"},
581 {"Right Headphone", NULL, "Right Headphone Out Mux"},
583 {"Out 3", NULL, "Out 3 Mux"},
585 {"Out 4", NULL, "Out 4 Mux"},
587 {"Left Speaker", NULL, "Left Speaker Out Mux"},
589 {"Right Speaker", NULL, "Right Speaker Out Mux"},
591 {"Mono Out", NULL, "Mono Out Mux"},
637 {"Capture Headphone Mux", "Stereo", "Capture Mixer"},
638 {"Capture Headphone Mux", "Left", "Left Capture Source"},
639 {"Capture Headphone Mux", "Right", "Right Capture Source"},
642 {"Capture Mono Mux", "Stereo", "Capture Mixer"},
643 {"Capture Mono Mux", "Left", "Left Capture Source"},
644 {"Capture Mono Mux", "Right", "Right Capture Source"},
650 u16 *cache = codec->reg_cache; in ac97_read()
655 return soc_ac97_ops.read(codec->ac97, reg); in ac97_read()
660 return -EIO; in ac97_read()
669 u16 *cache = codec->reg_cache; in ac97_write()
671 soc_ac97_ops.write(codec->ac97, reg, val); in ac97_write()
703 pll_div->divsel = 1; in pll_factors()
707 pll_div->divctl = 1; in pll_factors()
709 pll_div->divctl = 0; in pll_factors()
712 pll_div->divsel = 0; in pll_factors()
713 pll_div->divctl = 0; in pll_factors()
720 pll_div->lf = 1; in pll_factors()
723 pll_div->lf = 0; in pll_factors()
731 pll_div->n = Ndiv; in pll_factors()
746 pll_div->k = K; in pll_factors()
767 wm9713->pll_in = 0; in wm9713_set_pll()
811 wm9713->pll_in = freq_in; in wm9713_set_pll()
821 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_pll()
832 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_tristate()
842 * Configure WM9713 clock dividers.
848 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_clkdiv()
881 return -EINVAL; in wm9713_set_dai_clkdiv()
890 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_fmt()
891 u16 gpio = ac97_read(codec, AC97_GPIO_CFG) & 0xffc5; in wm9713_set_dai_fmt() local
894 /* clock masters */ in wm9713_set_dai_fmt()
898 gpio |= 0x0010; in wm9713_set_dai_fmt()
902 gpio |= 0x0018; in wm9713_set_dai_fmt()
906 gpio |= 0x001a; in wm9713_set_dai_fmt()
909 gpio |= 0x0012; in wm9713_set_dai_fmt()
913 /* clock inversion */ in wm9713_set_dai_fmt()
944 ac97_write(codec, AC97_GPIO_CFG, gpio); in wm9713_set_dai_fmt()
953 struct snd_soc_codec *codec = dai->codec; in wm9713_pcm_hw_params()
978 struct snd_soc_codec *codec = dai->codec; in ac97_hifi_prepare()
979 struct snd_pcm_runtime *runtime = substream->runtime; in ac97_hifi_prepare()
986 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in ac97_hifi_prepare()
991 return ac97_write(codec, reg, runtime->rate); in ac97_hifi_prepare()
997 struct snd_soc_codec *codec = dai->codec; in ac97_aux_prepare()
998 struct snd_pcm_runtime *runtime = substream->runtime; in ac97_aux_prepare()
1006 if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) in ac97_aux_prepare()
1007 return -ENODEV; in ac97_aux_prepare()
1009 return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate); in ac97_aux_prepare()
1051 .name = "wm9713-hifi",
1068 .name = "wm9713-aux",
1078 .name = "wm9713-voice",
1099 soc_ac97_ops.warm_reset(codec->ac97); in wm9713_reset()
1104 soc_ac97_ops.reset(codec->ac97); in wm9713_reset()
1106 soc_ac97_ops.warm_reset(codec->ac97); in wm9713_reset()
1108 return -EIO; in wm9713_reset()
1139 codec->dapm.bias_level = level; in wm9713_set_bias_level()
1147 /* Disable everything except touchpanel - that will be handled in wm9713_soc_suspend()
1163 u16 *cache = codec->reg_cache; in wm9713_soc_resume()
1173 /* do we need to re-start the PLL ? */ in wm9713_soc_resume()
1174 if (wm9713->pll_in) in wm9713_soc_resume()
1175 wm9713_set_pll(codec, 0, wm9713->pll_in, 0); in wm9713_soc_resume()
1183 soc_ac97_ops.write(codec->ac97, i, cache[i>>1]); in wm9713_soc_resume()
1197 return -ENOMEM; in wm9713_soc_probe()
1215 /* unmute the adc - move to kcontrol */ in wm9713_soc_probe()
1259 return snd_soc_register_codec(&pdev->dev, in wm9713_probe()
1265 snd_soc_unregister_codec(&pdev->dev); in wm9713_remove()
1271 .name = "wm9713-codec",