Lines Matching refs:codec

39 static unsigned int ac97_read(struct snd_soc_codec *codec,
41 static int ac97_write(struct snd_soc_codec *codec,
220 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in wm9713_voice_shutdown() local
227 status = ac97_read(codec, AC97_EXTENDED_MID) | 0x1000; in wm9713_voice_shutdown()
228 rate = ac97_read(codec, AC97_HANDSET_RATE) & 0xF0FF; in wm9713_voice_shutdown()
229 ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0200); in wm9713_voice_shutdown()
231 ac97_write(codec, AC97_HANDSET_RATE, rate | 0x0F00); in wm9713_voice_shutdown()
232 ac97_write(codec, AC97_EXTENDED_MID, status); in wm9713_voice_shutdown()
256 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in wm9713_hp_mixer_put() local
257 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_hp_mixer_put()
300 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in wm9713_hp_mixer_get() local
301 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_hp_mixer_get()
675 static unsigned int ac97_read(struct snd_soc_codec *codec, in ac97_read() argument
678 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in ac97_read()
679 u16 *cache = codec->reg_cache; in ac97_read()
695 static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, in ac97_write() argument
698 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in ac97_write()
700 u16 *cache = codec->reg_cache; in ac97_write()
722 static void pll_factors(struct snd_soc_codec *codec, in pll_factors() argument
758 dev_warn(codec->dev, in pll_factors()
784 static int wm9713_set_pll(struct snd_soc_codec *codec, in wm9713_set_pll() argument
787 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_set_pll()
794 reg = ac97_read(codec, AC97_HANDSET_RATE); in wm9713_set_pll()
795 ac97_write(codec, AC97_HANDSET_RATE, reg | 0x0080); in wm9713_set_pll()
796 reg = ac97_read(codec, AC97_EXTENDED_MID); in wm9713_set_pll()
797 ac97_write(codec, AC97_EXTENDED_MID, reg | 0x0200); in wm9713_set_pll()
802 pll_factors(codec, &pll_div, freq_in); in wm9713_set_pll()
807 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
815 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
819 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
823 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
827 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
831 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
834 ac97_write(codec, AC97_LINE1_LEVEL, reg); in wm9713_set_pll()
838 reg = ac97_read(codec, AC97_EXTENDED_MID); in wm9713_set_pll()
839 ac97_write(codec, AC97_EXTENDED_MID, reg & 0xfdff); in wm9713_set_pll()
840 reg = ac97_read(codec, AC97_HANDSET_RATE); in wm9713_set_pll()
841 ac97_write(codec, AC97_HANDSET_RATE, reg & 0xff7f); in wm9713_set_pll()
852 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_pll() local
853 return wm9713_set_pll(codec, pll_id, freq_in, freq_out); in wm9713_set_dai_pll()
863 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_tristate() local
864 u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0x9fff; in wm9713_set_dai_tristate()
867 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg); in wm9713_set_dai_tristate()
879 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_clkdiv() local
884 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0xf0ff; in wm9713_set_dai_clkdiv()
885 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
888 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0xfffd; in wm9713_set_dai_clkdiv()
889 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
892 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0xfffb; in wm9713_set_dai_clkdiv()
893 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
896 reg = ac97_read(codec, AC97_HANDSET_RATE) & 0x8fff; in wm9713_set_dai_clkdiv()
897 ac97_write(codec, AC97_HANDSET_RATE, reg | div); in wm9713_set_dai_clkdiv()
900 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xf1ff; in wm9713_set_dai_clkdiv()
901 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg | div); in wm9713_set_dai_clkdiv()
904 reg = ac97_read(codec, AC97_LINE1_LEVEL) & 0xff80; in wm9713_set_dai_clkdiv()
905 ac97_write(codec, AC97_LINE1_LEVEL, reg | 0x60 | div); in wm9713_set_dai_clkdiv()
908 reg = ac97_read(codec, AC97_LINE1_LEVEL) & 0xff80; in wm9713_set_dai_clkdiv()
909 ac97_write(codec, AC97_LINE1_LEVEL, reg | 0x70 | div); in wm9713_set_dai_clkdiv()
921 struct snd_soc_codec *codec = codec_dai->codec; in wm9713_set_dai_fmt() local
922 u16 gpio = ac97_read(codec, AC97_GPIO_CFG) & 0xffc5; in wm9713_set_dai_fmt()
975 ac97_write(codec, AC97_GPIO_CFG, gpio); in wm9713_set_dai_fmt()
976 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg); in wm9713_set_dai_fmt()
984 struct snd_soc_codec *codec = dai->codec; in wm9713_pcm_hw_params() local
985 u16 reg = ac97_read(codec, AC97_CENTER_LFE_MASTER) & 0xfff3; in wm9713_pcm_hw_params()
1002 ac97_write(codec, AC97_CENTER_LFE_MASTER, reg); in wm9713_pcm_hw_params()
1009 struct snd_soc_codec *codec = dai->codec; in ac97_hifi_prepare() local
1014 vra = ac97_read(codec, AC97_EXTENDED_STATUS); in ac97_hifi_prepare()
1015 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); in ac97_hifi_prepare()
1022 return ac97_write(codec, reg, runtime->rate); in ac97_hifi_prepare()
1028 struct snd_soc_codec *codec = dai->codec; in ac97_aux_prepare() local
1032 vra = ac97_read(codec, AC97_EXTENDED_STATUS); in ac97_aux_prepare()
1033 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); in ac97_aux_prepare()
1034 xsle = ac97_read(codec, AC97_PCI_SID); in ac97_aux_prepare()
1035 ac97_write(codec, AC97_PCI_SID, xsle | 0x8000); in ac97_aux_prepare()
1040 return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate); in ac97_aux_prepare()
1126 int wm9713_reset(struct snd_soc_codec *codec, int try_warm) in wm9713_reset() argument
1128 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_reset()
1132 if (ac97_read(codec, 0) == wm9713_reg[0]) in wm9713_reset()
1139 if (ac97_read(codec, 0) != wm9713_reg[0]) { in wm9713_reset()
1140 dev_err(codec->dev, "Failed to reset: AC97 link error\n"); in wm9713_reset()
1148 static int wm9713_set_bias_level(struct snd_soc_codec *codec, in wm9713_set_bias_level() argument
1156 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x1bff; in wm9713_set_bias_level()
1157 ac97_write(codec, AC97_EXTENDED_MID, reg); in wm9713_set_bias_level()
1163 reg = ac97_read(codec, AC97_EXTENDED_MID) & 0x3bff; in wm9713_set_bias_level()
1164 ac97_write(codec, AC97_EXTENDED_MID, reg); in wm9713_set_bias_level()
1165 ac97_write(codec, AC97_POWERDOWN, 0x0000); in wm9713_set_bias_level()
1169 ac97_write(codec, AC97_EXTENDED_MID, 0xffff); in wm9713_set_bias_level()
1170 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_set_bias_level()
1171 ac97_write(codec, AC97_POWERDOWN, 0xffff); in wm9713_set_bias_level()
1174 codec->dapm.bias_level = level; in wm9713_set_bias_level()
1178 static int wm9713_soc_suspend(struct snd_soc_codec *codec) in wm9713_soc_suspend() argument
1185 reg = ac97_read(codec, AC97_EXTENDED_MID); in wm9713_soc_suspend()
1186 ac97_write(codec, AC97_EXTENDED_MID, reg | 0x7fff); in wm9713_soc_suspend()
1187 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); in wm9713_soc_suspend()
1188 ac97_write(codec, AC97_POWERDOWN, 0x6f00); in wm9713_soc_suspend()
1189 ac97_write(codec, AC97_POWERDOWN, 0xffff); in wm9713_soc_suspend()
1194 static int wm9713_soc_resume(struct snd_soc_codec *codec) in wm9713_soc_resume() argument
1196 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_soc_resume()
1198 u16 *cache = codec->reg_cache; in wm9713_soc_resume()
1200 ret = wm9713_reset(codec, 1); in wm9713_soc_resume()
1204 wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm9713_soc_resume()
1208 wm9713_set_pll(codec, 0, wm9713->pll_in, 0); in wm9713_soc_resume()
1223 static int wm9713_soc_probe(struct snd_soc_codec *codec) in wm9713_soc_probe() argument
1225 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_soc_probe()
1228 wm9713->ac97 = snd_soc_alloc_ac97_codec(codec); in wm9713_soc_probe()
1234 wm9713_reset(codec, 0); in wm9713_soc_probe()
1235 ret = wm9713_reset(codec, 1); in wm9713_soc_probe()
1244 reg = ac97_read(codec, AC97_CD) & 0x7fff; in wm9713_soc_probe()
1245 ac97_write(codec, AC97_CD, reg); in wm9713_soc_probe()
1254 static int wm9713_soc_remove(struct snd_soc_codec *codec) in wm9713_soc_remove() argument
1256 struct wm9713_priv *wm9713 = snd_soc_codec_get_drvdata(codec); in wm9713_soc_remove()