Lines Matching refs:codec
154 static int wm8960_set_deemph(struct snd_soc_codec *codec) in wm8960_set_deemph() argument
156 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_set_deemph()
175 dev_dbg(codec->dev, "Set deemphasis %d\n", val); in wm8960_set_deemph()
177 return snd_soc_update_bits(codec, WM8960_DACCTL1, in wm8960_set_deemph()
184 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8960_get_deemph() local
185 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_get_deemph()
194 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8960_put_deemph() local
195 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_put_deemph()
203 return wm8960_set_deemph(codec); in wm8960_put_deemph()
444 static int wm8960_add_widgets(struct snd_soc_codec *codec) in wm8960_add_widgets() argument
446 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_add_widgets()
448 struct snd_soc_dapm_context *dapm = &codec->dapm; in wm8960_add_widgets()
478 list_for_each_entry(w, &codec->component.card->widgets, list) { in wm8960_add_widgets()
479 if (w->dapm != &codec->dapm) in wm8960_add_widgets()
495 struct snd_soc_codec *codec = codec_dai->codec; in wm8960_set_dai_fmt() local
547 snd_soc_write(codec, WM8960_IFACE1, iface); in wm8960_set_dai_fmt()
570 struct snd_soc_codec *codec = dai->codec; in wm8960_hw_params() local
571 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_hw_params()
572 u16 iface = snd_soc_read(codec, WM8960_IFACE1) & 0xfff3; in wm8960_hw_params()
586 dev_err(codec->dev, "unsupported width %d\n", in wm8960_hw_params()
594 wm8960_set_deemph(codec); in wm8960_hw_params()
598 snd_soc_update_bits(codec, in wm8960_hw_params()
604 snd_soc_write(codec, WM8960_IFACE1, iface); in wm8960_hw_params()
610 struct snd_soc_codec *codec = dai->codec; in wm8960_mute() local
613 snd_soc_update_bits(codec, WM8960_DACCTL1, 0x8, 0x8); in wm8960_mute()
615 snd_soc_update_bits(codec, WM8960_DACCTL1, 0x8, 0); in wm8960_mute()
619 static int wm8960_set_bias_level_out3(struct snd_soc_codec *codec, in wm8960_set_bias_level_out3() argument
622 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_set_bias_level_out3()
630 switch (codec->dapm.bias_level) { in wm8960_set_bias_level_out3()
635 dev_err(codec->dev, in wm8960_set_bias_level_out3()
643 snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x80); in wm8960_set_bias_level_out3()
658 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in wm8960_set_bias_level_out3()
662 snd_soc_write(codec, WM8960_APOP1, in wm8960_set_bias_level_out3()
667 snd_soc_update_bits(codec, WM8960_POWER1, 0x80, 0x80); in wm8960_set_bias_level_out3()
671 snd_soc_update_bits(codec, WM8960_POWER1, WM8960_VREF, in wm8960_set_bias_level_out3()
675 snd_soc_write(codec, WM8960_APOP1, WM8960_BUFIOEN); in wm8960_set_bias_level_out3()
679 snd_soc_update_bits(codec, WM8960_POWER1, 0x180, 0x100); in wm8960_set_bias_level_out3()
684 snd_soc_write(codec, WM8960_APOP1, in wm8960_set_bias_level_out3()
689 snd_soc_write(codec, WM8960_POWER1, 0); in wm8960_set_bias_level_out3()
694 codec->dapm.bias_level = level; in wm8960_set_bias_level_out3()
699 static int wm8960_set_bias_level_capless(struct snd_soc_codec *codec, in wm8960_set_bias_level_capless() argument
702 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_set_bias_level_capless()
710 switch (codec->dapm.bias_level) { in wm8960_set_bias_level_capless()
713 snd_soc_update_bits(codec, WM8960_APOP1, in wm8960_set_bias_level_capless()
727 snd_soc_update_bits(codec, WM8960_POWER2, in wm8960_set_bias_level_capless()
733 snd_soc_update_bits(codec, WM8960_POWER1, in wm8960_set_bias_level_capless()
740 snd_soc_update_bits(codec, WM8960_POWER1, in wm8960_set_bias_level_capless()
748 dev_err(codec->dev, in wm8960_set_bias_level_capless()
761 snd_soc_update_bits(codec, WM8960_APOP1, in wm8960_set_bias_level_capless()
768 snd_soc_update_bits(codec, WM8960_POWER1, in wm8960_set_bias_level_capless()
781 switch (codec->dapm.bias_level) { in wm8960_set_bias_level_capless()
784 snd_soc_update_bits(codec, WM8960_APOP2, in wm8960_set_bias_level_capless()
789 snd_soc_update_bits(codec, WM8960_APOP1, in wm8960_set_bias_level_capless()
805 codec->dapm.bias_level = level; in wm8960_set_bias_level_capless()
871 struct snd_soc_codec *codec = codec_dai->codec; in wm8960_set_dai_pll() local
884 snd_soc_update_bits(codec, WM8960_CLOCK1, 0x1, 0); in wm8960_set_dai_pll()
885 snd_soc_update_bits(codec, WM8960_POWER2, 0x1, 0); in wm8960_set_dai_pll()
890 reg = snd_soc_read(codec, WM8960_PLL1) & ~0x3f; in wm8960_set_dai_pll()
897 snd_soc_write(codec, WM8960_PLL2, (pll_div.k >> 16) & 0xff); in wm8960_set_dai_pll()
898 snd_soc_write(codec, WM8960_PLL3, (pll_div.k >> 8) & 0xff); in wm8960_set_dai_pll()
899 snd_soc_write(codec, WM8960_PLL4, pll_div.k & 0xff); in wm8960_set_dai_pll()
901 snd_soc_write(codec, WM8960_PLL1, reg); in wm8960_set_dai_pll()
904 snd_soc_update_bits(codec, WM8960_POWER2, 0x1, 0x1); in wm8960_set_dai_pll()
906 snd_soc_update_bits(codec, WM8960_CLOCK1, 0x1, 0x1); in wm8960_set_dai_pll()
914 struct snd_soc_codec *codec = codec_dai->codec; in wm8960_set_dai_clkdiv() local
919 reg = snd_soc_read(codec, WM8960_CLOCK1) & 0x1f9; in wm8960_set_dai_clkdiv()
920 snd_soc_write(codec, WM8960_CLOCK1, reg | div); in wm8960_set_dai_clkdiv()
923 reg = snd_soc_read(codec, WM8960_CLOCK1) & 0x1c7; in wm8960_set_dai_clkdiv()
924 snd_soc_write(codec, WM8960_CLOCK1, reg | div); in wm8960_set_dai_clkdiv()
927 reg = snd_soc_read(codec, WM8960_PLL1) & 0x03f; in wm8960_set_dai_clkdiv()
928 snd_soc_write(codec, WM8960_PLL1, reg | div); in wm8960_set_dai_clkdiv()
931 reg = snd_soc_read(codec, WM8960_CLOCK2) & 0x03f; in wm8960_set_dai_clkdiv()
932 snd_soc_write(codec, WM8960_CLOCK2, reg | div); in wm8960_set_dai_clkdiv()
935 reg = snd_soc_read(codec, WM8960_ADDCTL1) & 0x1fd; in wm8960_set_dai_clkdiv()
936 snd_soc_write(codec, WM8960_ADDCTL1, reg | div); in wm8960_set_dai_clkdiv()
945 static int wm8960_set_bias_level(struct snd_soc_codec *codec, in wm8960_set_bias_level() argument
948 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_set_bias_level()
950 return wm8960->set_bias_level(codec, level); in wm8960_set_bias_level()
985 static int wm8960_probe(struct snd_soc_codec *codec) in wm8960_probe() argument
987 struct wm8960_priv *wm8960 = snd_soc_codec_get_drvdata(codec); in wm8960_probe()
995 snd_soc_add_codec_controls(codec, wm8960_snd_controls, in wm8960_probe()
997 wm8960_add_widgets(codec); in wm8960_probe()