Lines Matching refs:codec

342 	struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol);  in speaker_mode_get()  local
345 reg = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); in speaker_mode_get()
363 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in speaker_mode_put() local
364 unsigned int reg_pwr = snd_soc_read(codec, WM9081_POWER_MANAGEMENT); in speaker_mode_put()
365 unsigned int reg2 = snd_soc_read(codec, WM9081_ANALOGUE_SPEAKER_2); in speaker_mode_put()
386 snd_soc_write(codec, WM9081_ANALOGUE_SPEAKER_2, reg2); in speaker_mode_put()
549 static int wm9081_set_fll(struct snd_soc_codec *codec, int fll_id, in wm9081_set_fll() argument
552 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_set_fll()
564 dev_dbg(codec->dev, "FLL disabled\n"); in wm9081_set_fll()
575 reg5 = snd_soc_read(codec, WM9081_FLL_CONTROL_5); in wm9081_set_fll()
584 dev_err(codec->dev, "Unknown FLL ID %d\n", fll_id); in wm9081_set_fll()
589 clk_sys_reg = snd_soc_read(codec, WM9081_CLOCK_CONTROL_3); in wm9081_set_fll()
591 snd_soc_write(codec, WM9081_CLOCK_CONTROL_3, in wm9081_set_fll()
596 reg1 = snd_soc_read(codec, WM9081_FLL_CONTROL_1); in wm9081_set_fll()
598 snd_soc_write(codec, WM9081_FLL_CONTROL_1, reg1); in wm9081_set_fll()
605 snd_soc_write(codec, WM9081_FLL_CONTROL_1, reg1); in wm9081_set_fll()
607 snd_soc_write(codec, WM9081_FLL_CONTROL_2, in wm9081_set_fll()
610 snd_soc_write(codec, WM9081_FLL_CONTROL_3, fll_div.k); in wm9081_set_fll()
612 reg4 = snd_soc_read(codec, WM9081_FLL_CONTROL_4); in wm9081_set_fll()
615 snd_soc_write(codec, WM9081_FLL_CONTROL_4, reg4); in wm9081_set_fll()
619 snd_soc_write(codec, WM9081_FLL_CONTROL_5, reg5); in wm9081_set_fll()
622 snd_soc_update_bits(codec, WM9081_FLL_CONTROL_4, in wm9081_set_fll()
626 snd_soc_write(codec, WM9081_FLL_CONTROL_1, reg1 | WM9081_FLL_ENA); in wm9081_set_fll()
630 snd_soc_write(codec, WM9081_CLOCK_CONTROL_3, clk_sys_reg); in wm9081_set_fll()
632 dev_dbg(codec->dev, "FLL enabled at %dHz->%dHz\n", Fref, Fout); in wm9081_set_fll()
640 static int configure_clock(struct snd_soc_codec *codec) in configure_clock() argument
642 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in configure_clock()
657 wm9081_set_fll(codec, WM9081_SYSCLK_FLL_MCLK, 0, 0); in configure_clock()
698 ret = wm9081_set_fll(codec, WM9081_SYSCLK_FLL_MCLK, in configure_clock()
714 reg = snd_soc_read(codec, WM9081_CLOCK_CONTROL_1); in configure_clock()
719 snd_soc_write(codec, WM9081_CLOCK_CONTROL_1, reg); in configure_clock()
721 reg = snd_soc_read(codec, WM9081_CLOCK_CONTROL_3); in configure_clock()
726 snd_soc_write(codec, WM9081_CLOCK_CONTROL_3, reg); in configure_clock()
728 dev_dbg(codec->dev, "CLK_SYS is %dHz\n", wm9081->sysclk_rate); in configure_clock()
736 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in clk_sys_event() local
737 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in clk_sys_event()
742 dev_dbg(codec->dev, "Using %dHz MCLK\n", wm9081->mclk_rate); in clk_sys_event()
745 dev_dbg(codec->dev, "Using %dHz MCLK with FLL\n", in clk_sys_event()
749 dev_err(codec->dev, "System clock not configured\n"); in clk_sys_event()
755 configure_clock(codec); in clk_sys_event()
760 wm9081_set_fll(codec, 0, 0, 0); in clk_sys_event()
819 static int wm9081_set_bias_level(struct snd_soc_codec *codec, in wm9081_set_bias_level() argument
822 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_set_bias_level()
830 snd_soc_update_bits(codec, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
834 snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
840 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { in wm9081_set_bias_level()
845 snd_soc_update_bits(codec, WM9081_ANTI_POP_CONTROL, in wm9081_set_bias_level()
849 snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
854 snd_soc_update_bits(codec, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
862 snd_soc_update_bits(codec, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
866 snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
871 snd_soc_update_bits(codec, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
875 snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
882 snd_soc_update_bits(codec, WM9081_BIAS_CONTROL_1, in wm9081_set_bias_level()
887 snd_soc_update_bits(codec, WM9081_VMID_CONTROL, in wm9081_set_bias_level()
892 snd_soc_update_bits(codec, WM9081_ANTI_POP_CONTROL, in wm9081_set_bias_level()
906 struct snd_soc_codec *codec = dai->codec; in wm9081_set_dai_fmt() local
907 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_set_dai_fmt()
908 unsigned int aif2 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_2); in wm9081_set_dai_fmt()
989 snd_soc_write(codec, WM9081_AUDIO_INTERFACE_2, aif2); in wm9081_set_dai_fmt()
998 struct snd_soc_codec *codec = dai->codec; in wm9081_hw_params() local
999 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_hw_params()
1003 clk_ctrl2 = snd_soc_read(codec, WM9081_CLOCK_CONTROL_2); in wm9081_hw_params()
1006 aif1 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_1); in wm9081_hw_params()
1008 aif2 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_2); in wm9081_hw_params()
1011 aif3 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_3); in wm9081_hw_params()
1014 aif4 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_4); in wm9081_hw_params()
1050 dev_dbg(codec->dev, "Target BCLK is %dHz\n", wm9081->bclk); in wm9081_hw_params()
1052 ret = configure_clock(codec); in wm9081_hw_params()
1068 dev_dbg(codec->dev, "Selected CLK_SYS_RATIO of %d\n", in wm9081_hw_params()
1084 dev_dbg(codec->dev, "Selected SAMPLE_RATE of %dHz\n", in wm9081_hw_params()
1103 dev_dbg(codec->dev, "Selected BCLK_DIV of %d for %dHz BCLK\n", in wm9081_hw_params()
1108 dev_dbg(codec->dev, "LRCLK_RATE is %d\n", wm9081->bclk / wm9081->fs); in wm9081_hw_params()
1129 dev_dbg(codec->dev, "ReTune Mobile %s tuned for %dHz\n", in wm9081_hw_params()
1133 eq1 = snd_soc_read(codec, WM9081_EQ_1) & WM9081_EQ_ENA; in wm9081_hw_params()
1135 snd_soc_write(codec, WM9081_EQ_1, 0); in wm9081_hw_params()
1139 snd_soc_write(codec, WM9081_EQ_1 + i, s->config[i]); in wm9081_hw_params()
1142 snd_soc_write(codec, WM9081_EQ_1, eq1); in wm9081_hw_params()
1145 snd_soc_write(codec, WM9081_CLOCK_CONTROL_2, clk_ctrl2); in wm9081_hw_params()
1146 snd_soc_write(codec, WM9081_AUDIO_INTERFACE_2, aif2); in wm9081_hw_params()
1147 snd_soc_write(codec, WM9081_AUDIO_INTERFACE_3, aif3); in wm9081_hw_params()
1148 snd_soc_write(codec, WM9081_AUDIO_INTERFACE_4, aif4); in wm9081_hw_params()
1155 struct snd_soc_codec *codec = codec_dai->codec; in wm9081_digital_mute() local
1158 reg = snd_soc_read(codec, WM9081_DAC_DIGITAL_2); in wm9081_digital_mute()
1165 snd_soc_write(codec, WM9081_DAC_DIGITAL_2, reg); in wm9081_digital_mute()
1170 static int wm9081_set_sysclk(struct snd_soc_codec *codec, int clk_id, in wm9081_set_sysclk() argument
1173 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_set_sysclk()
1192 struct snd_soc_codec *codec = dai->codec; in wm9081_set_tdm_slot() local
1193 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_set_tdm_slot()
1194 unsigned int aif1 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_1); in wm9081_set_tdm_slot()
1224 snd_soc_write(codec, WM9081_AUDIO_INTERFACE_1, aif1); in wm9081_set_tdm_slot()
1257 static int wm9081_probe(struct snd_soc_codec *codec) in wm9081_probe() argument
1259 struct wm9081_priv *wm9081 = snd_soc_codec_get_drvdata(codec); in wm9081_probe()
1262 snd_soc_update_bits(codec, WM9081_ANALOGUE_LINEOUT, in wm9081_probe()
1264 snd_soc_update_bits(codec, WM9081_ANALOGUE_SPEAKER_PGA, in wm9081_probe()
1268 dev_dbg(codec->dev, in wm9081_probe()
1270 snd_soc_add_codec_controls(codec, wm9081_eq_controls, in wm9081_probe()