Lines Matching refs:codec

42 static unsigned int ac97_read(struct snd_soc_codec *codec,
44 static int ac97_write(struct snd_soc_codec *codec,
222 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in wm9713_voice_shutdown() local
229 status = ac97_read(codec, AC97_EXTENDED_MID) | 0x1000; in wm9713_voice_shutdown()
230 rate = ac97_read(codec, AC97_HANDSET_RATE) & 0xF0FF; in wm9713_voice_shutdown()
231 ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0200); in wm9713_voice_shutdown()
233 ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0F00); in wm9713_voice_shutdown()
234 ac97_write(codec, AC97_EXTENDED_MID, status); in wm9713_voice_shutdown()
258 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in wm9713_hp_mixer_put() local
259 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_hp_mixer_put()
302 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in wm9713_hp_mixer_get() local
303 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_hp_mixer_get()
677 static unsigned int ac97_read(struct snd_soc_codec *codec, in ac97_read() argument
680 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in ac97_read()
681 u16 *cache = codec->reg_cache; in ac97_read()
697 static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, in ac97_write() argument
700 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in ac97_write()
702 u16 *cache = codec->reg_cache; in ac97_write()
724 static void pll_factors(struct snd_soc_codec *codec, in pll_factors() argument
760 dev_warn(codec->dev, in pll_factors()
786 static int wm9713_set_pll(struct snd_soc_codec *codec, in wm9713_set_pll() argument
789 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_set_pll()
796 reg = ac97_read(codec, AC97_HANDSET_RATE); in wm9713_set_pll()
797 ac97_write(codec, AC97_HANDSET_RATE, reg | 0x0080); in wm9713_set_pll()
798 reg = ac97_read(codec, AC97_EXTENDED_MID); in wm9713_set_pll()
799 ac97_write(codec, AC97_EXTENDED_MID, reg | 0x0200); in wm9713_set_pll()
804 pll_factors(codec, &pll_div, freq_in); in wm9713_set_pll()
809 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
817 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
821 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
825 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
829 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
833 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
836 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
840 reg = ac97_read(codec, AC97_EXTENDED_MID); in wm9713_set_pll()
841 ac97_write(codec, AC97_EXTENDED_MID, reg & 0xfdff); in wm9713_set_pll()
842 reg = ac97_read(codec, AC97_HANDSET_RATE); in wm9713_set_pll()
843 ac97_write(codec, AC97_HANDSET_RATE, reg & 0xff7f); in wm9713_set_pll()
854 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_pll() local
855 return wm9713_set_pll(codec, pll_id, freq_in, freq_out); in wm9713_set_dai_pll()
865 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_tristate() local
866 u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0x9fff; in wm9713_set_dai_tristate()
869 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg); in wm9713_set_dai_tristate()
881 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_clkdiv() local
886 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0xf0ff; in wm9713_set_dai_clkdiv()
887 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
890 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0xfffd; in wm9713_set_dai_clkdiv()
891 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
894 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0xfffb; in wm9713_set_dai_clkdiv()
895 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
898 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0x8fff; in wm9713_set_dai_clkdiv()
899 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
902 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xf1ff; in wm9713_set_dai_clkdiv()
903 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg | div); in wm9713_set_dai_clkdiv()
906 reg = ac97_read(codec, AC97_LINE1_LEVEL) & 0xff80; in wm9713_set_dai_clkdiv()
907 ac97_write(codec, AC97_LINE1_LEVEL, reg | 0x60 | div); in wm9713_set_dai_clkdiv()
910 reg = ac97_read(codec, AC97_LINE1_LEVEL) & 0xff80; in wm9713_set_dai_clkdiv()
911 ac97_write(codec, AC97_LINE1_LEVEL, reg | 0x70 | div); in wm9713_set_dai_clkdiv()
923 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_fmt() local
924 u16 gpio = ac97_read(codec, AC97_GPIO_CFG) & 0xffc5; in wm9713_set_dai_fmt()
977 ac97_write(codec, AC97_GPIO_CFG, gpio); in wm9713_set_dai_fmt()
978 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg); in wm9713_set_dai_fmt()
986 struct snd_soc_codec *codec = dai->codec; in wm9713_pcm_hw_params() local
987 u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xfff3; in wm9713_pcm_hw_params()
1004 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg); in wm9713_pcm_hw_params()
1011 struct snd_soc_codec *codec = dai->codec; in ac97_hifi_prepare() local
1016 vra = ac97_read(codec, AC97_EXTENDED_STATUS); in ac97_hifi_prepare()
1017 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); in ac97_hifi_prepare()
1024 return ac97_write(codec, reg, runtime->rate); in ac97_hifi_prepare()
1030 struct snd_soc_codec *codec = dai->codec; in ac97_aux_prepare() local
1034 vra = ac97_read(codec, AC97_EXTENDED_STATUS); in ac97_aux_prepare()
1035 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); in ac97_aux_prepare()
1036 xsle = ac97_read(codec, AC97_PCI_SID); in ac97_aux_prepare()
1037 ac97_write(codec, AC97_PCI_SID, xsle | 0x8000); in ac97_aux_prepare()
1042 return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate); in ac97_aux_prepare()
1128 static int wm9713_set_bias_level(struct snd_soc_codec *codec, in wm9713_set_bias_level() argument
1136 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x1bff; in wm9713_set_bias_level()
1137 ac97_write(codec, AC97_EXTENDED_MID, reg); in wm9713_set_bias_level()
1143 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x3bff; in wm9713_set_bias_level()
1144 ac97_write(codec, AC97_EXTENDED_MID, reg); in wm9713_set_bias_level()
1145 ac97_write(codec, AC97_POWERDOWN, 0x0000); in wm9713_set_bias_level()
1149 ac97_write(codec, AC97_EXTENDED_MID, 0xffff); in wm9713_set_bias_level()
1150 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_set_bias_level()
1151 ac97_write(codec, AC97_POWERDOWN, 0xffff); in wm9713_set_bias_level()
1157 static int wm9713_soc_suspend(struct snd_soc_codec *codec) in wm9713_soc_suspend() argument
1164 reg = ac97_read(codec, AC97_EXTENDED_MID); in wm9713_soc_suspend()
1165 ac97_write(codec, AC97_EXTENDED_MID, reg | 0x7fff); in wm9713_soc_suspend()
1166 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_soc_suspend()
1167 ac97_write(codec, AC97_POWERDOWN, 0x6f00); in wm9713_soc_suspend()
1168 ac97_write(codec, AC97_POWERDOWN, 0xffff); in wm9713_soc_suspend()
1173 static int wm9713_soc_resume(struct snd_soc_codec *codec) in wm9713_soc_resume() argument
1175 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_soc_resume()
1177 u16 *cache = codec->reg_cache; in wm9713_soc_resume()
1184 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm9713_soc_resume()
1188 wm9713_set_pll(codec, 0, wm9713->pll_in, 0); in wm9713_soc_resume()
1203 static int wm9713_soc_probe(struct snd_soc_codec *codec) in wm9713_soc_probe() argument
1205 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_soc_probe()
1208 wm9713->ac97 = snd_soc_new_ac97_codec(codec, WM9713_VENDOR_ID, in wm9713_soc_probe()
1214 reg = ac97_read(codec, AC97_CD) & 0x7fff; in wm9713_soc_probe()
1215 ac97_write(codec, AC97_CD, reg); in wm9713_soc_probe()
1220 static int wm9713_soc_remove(struct snd_soc_codec *codec) in wm9713_soc_remove() argument
1222 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_soc_remove()