Lines Matching refs:codec
32 static unsigned int ac97_read(struct snd_soc_codec *codec,
34 static int ac97_write(struct snd_soc_codec *codec,
181 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in wm9712_hp_mixer_put() local
182 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in wm9712_hp_mixer_put()
225 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(dapm); in wm9712_hp_mixer_get() local
226 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in wm9712_hp_mixer_get()
485 static unsigned int ac97_read(struct snd_soc_codec *codec, in ac97_read() argument
488 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in ac97_read()
489 u16 *cache = codec->reg_cache; in ac97_read()
505 static int ac97_write(struct snd_soc_codec *codec, unsigned int reg, in ac97_write() argument
508 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in ac97_write()
509 u16 *cache = codec->reg_cache; in ac97_write()
522 struct snd_soc_codec *codec = dai->codec; in ac97_prepare() local
527 vra = ac97_read(codec, AC97_EXTENDED_STATUS); in ac97_prepare()
528 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); in ac97_prepare()
535 return ac97_write(codec, reg, runtime->rate); in ac97_prepare()
541 struct snd_soc_codec *codec = dai->codec; in ac97_aux_prepare() local
545 vra = ac97_read(codec, AC97_EXTENDED_STATUS); in ac97_aux_prepare()
546 ac97_write(codec, AC97_EXTENDED_STATUS, vra | 0x1); in ac97_aux_prepare()
547 xsle = ac97_read(codec, AC97_PCI_SID); in ac97_aux_prepare()
548 ac97_write(codec, AC97_PCI_SID, xsle | 0x8000); in ac97_aux_prepare()
553 return ac97_write(codec, AC97_PCM_SURR_DAC_RATE, runtime->rate); in ac97_aux_prepare()
597 static int wm9712_set_bias_level(struct snd_soc_codec *codec, in wm9712_set_bias_level() argument
605 ac97_write(codec, AC97_POWERDOWN, 0x0000); in wm9712_set_bias_level()
609 ac97_write(codec, AC97_EXTENDED_MSTATUS, 0xffff); in wm9712_set_bias_level()
610 ac97_write(codec, AC97_POWERDOWN, 0xffff); in wm9712_set_bias_level()
613 codec->dapm.bias_level = level; in wm9712_set_bias_level()
617 static int wm9712_reset(struct snd_soc_codec *codec, int try_warm) in wm9712_reset() argument
619 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in wm9712_reset()
623 if (ac97_read(codec, 0) == wm9712_reg[0]) in wm9712_reset()
630 if (ac97_read(codec, 0) != wm9712_reg[0]) in wm9712_reset()
635 dev_err(codec->dev, "Failed to reset: AC97 link error\n"); in wm9712_reset()
639 static int wm9712_soc_resume(struct snd_soc_codec *codec) in wm9712_soc_resume() argument
641 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in wm9712_soc_resume()
643 u16 *cache = codec->reg_cache; in wm9712_soc_resume()
645 ret = wm9712_reset(codec, 1); in wm9712_soc_resume()
649 wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm9712_soc_resume()
664 static int wm9712_soc_probe(struct snd_soc_codec *codec) in wm9712_soc_probe() argument
666 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in wm9712_soc_probe()
669 wm9712->ac97 = snd_soc_alloc_ac97_codec(codec); in wm9712_soc_probe()
672 dev_err(codec->dev, "Failed to register AC97 codec: %d\n", ret); in wm9712_soc_probe()
676 ret = wm9712_reset(codec, 0); in wm9712_soc_probe()
685 ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000); in wm9712_soc_probe()
694 static int wm9712_soc_remove(struct snd_soc_codec *codec) in wm9712_soc_remove() argument
696 struct wm9712_priv *wm9712 = snd_soc_codec_get_drvdata(codec); in wm9712_soc_remove()