Lines Matching refs:codec
162 struct snd_soc_codec *codec; member
352 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in aic31xx_dapm_power_event() local
353 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_dapm_power_event()
381 dev_err(codec->dev, "Unknown widget '%s' calling %s\n", in aic31xx_dapm_power_event()
392 dev_dbg(codec->dev, in aic31xx_dapm_power_event()
437 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in mic_bias_event() local
438 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in mic_bias_event()
443 snd_soc_update_bits(codec, AIC31XX_MICBIAS, in mic_bias_event()
447 dev_dbg(codec->dev, "%s: turned on\n", __func__); in mic_bias_event()
451 snd_soc_update_bits(codec, AIC31XX_MICBIAS, in mic_bias_event()
453 dev_dbg(codec->dev, "%s: turned off\n", __func__); in mic_bias_event()
630 static int aic31xx_add_controls(struct snd_soc_codec *codec) in aic31xx_add_controls() argument
633 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_add_controls()
637 codec, aic311x_snd_controls, in aic31xx_add_controls()
641 codec, aic310x_snd_controls, in aic31xx_add_controls()
647 static int aic31xx_add_widgets(struct snd_soc_codec *codec) in aic31xx_add_widgets() argument
649 struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); in aic31xx_add_widgets()
650 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_add_widgets()
680 static int aic31xx_setup_pll(struct snd_soc_codec *codec, in aic31xx_setup_pll() argument
683 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_setup_pll()
691 snd_soc_update_bits(codec, AIC31XX_CLKMUX, in aic31xx_setup_pll()
693 snd_soc_update_bits(codec, AIC31XX_IFACE2, in aic31xx_setup_pll()
712 dev_err(codec->dev, in aic31xx_setup_pll()
719 dev_warn(codec->dev, "Can not produce exact bitclock"); in aic31xx_setup_pll()
731 snd_soc_update_bits(codec, AIC31XX_PLLPR, AIC31XX_PLL_MASK, in aic31xx_setup_pll()
733 snd_soc_write(codec, AIC31XX_PLLJ, aic31xx_divs[i].pll_j); in aic31xx_setup_pll()
735 snd_soc_write(codec, AIC31XX_PLLDMSB, in aic31xx_setup_pll()
737 snd_soc_write(codec, AIC31XX_PLLDLSB, in aic31xx_setup_pll()
741 snd_soc_update_bits(codec, AIC31XX_NDAC, AIC31XX_PLL_MASK, in aic31xx_setup_pll()
743 snd_soc_update_bits(codec, AIC31XX_MDAC, AIC31XX_PLL_MASK, in aic31xx_setup_pll()
746 snd_soc_write(codec, AIC31XX_DOSRMSB, aic31xx_divs[i].dosr >> 8); in aic31xx_setup_pll()
747 snd_soc_write(codec, AIC31XX_DOSRLSB, aic31xx_divs[i].dosr & 0xff); in aic31xx_setup_pll()
750 snd_soc_update_bits(codec, AIC31XX_NADC, AIC31XX_PLL_MASK, in aic31xx_setup_pll()
752 snd_soc_update_bits(codec, AIC31XX_MADC, AIC31XX_PLL_MASK, in aic31xx_setup_pll()
755 snd_soc_write(codec, AIC31XX_AOSR, aic31xx_divs[i].aosr); in aic31xx_setup_pll()
758 snd_soc_update_bits(codec, AIC31XX_BCLKN, in aic31xx_setup_pll()
763 dev_dbg(codec->dev, in aic31xx_setup_pll()
778 struct snd_soc_codec *codec = dai->codec; in aic31xx_hw_params() local
781 dev_dbg(codec->dev, "## %s: width %d rate %d\n", in aic31xx_hw_params()
801 dev_err(codec->dev, "%s: Unsupported width %d\n", in aic31xx_hw_params()
806 snd_soc_update_bits(codec, AIC31XX_IFACE1, in aic31xx_hw_params()
810 return aic31xx_setup_pll(codec, params); in aic31xx_hw_params()
815 struct snd_soc_codec *codec = codec_dai->codec; in aic31xx_dac_mute() local
818 snd_soc_update_bits(codec, AIC31XX_DACMUTE, in aic31xx_dac_mute()
822 snd_soc_update_bits(codec, AIC31XX_DACMUTE, in aic31xx_dac_mute()
832 struct snd_soc_codec *codec = codec_dai->codec; in aic31xx_set_dai_fmt() local
837 dev_dbg(codec->dev, "## %s: fmt = 0x%x\n", __func__, fmt); in aic31xx_set_dai_fmt()
845 dev_alert(codec->dev, "Invalid DAI master/slave interface\n"); in aic31xx_set_dai_fmt()
878 dev_err(codec->dev, "Invalid DAI interface format\n"); in aic31xx_set_dai_fmt()
882 snd_soc_update_bits(codec, AIC31XX_IFACE1, in aic31xx_set_dai_fmt()
886 snd_soc_update_bits(codec, AIC31XX_DATA_OFFSET, in aic31xx_set_dai_fmt()
889 snd_soc_update_bits(codec, AIC31XX_IFACE2, in aic31xx_set_dai_fmt()
899 struct snd_soc_codec *codec = codec_dai->codec; in aic31xx_set_dai_sysclk() local
900 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_set_dai_sysclk()
903 dev_dbg(codec->dev, "## %s: clk_id = %d, freq = %d, dir = %d\n", in aic31xx_set_dai_sysclk()
925 snd_soc_update_bits(codec, AIC31XX_CLKMUX, AIC31XX_PLL_CLKIN_MASK, in aic31xx_set_dai_sysclk()
954 static void aic31xx_clk_on(struct snd_soc_codec *codec) in aic31xx_clk_on() argument
956 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_clk_on()
960 dev_dbg(codec->dev, "codec clock -> on (rate %d)\n", in aic31xx_clk_on()
962 snd_soc_update_bits(codec, AIC31XX_PLLPR, mask, on); in aic31xx_clk_on()
964 snd_soc_update_bits(codec, AIC31XX_NDAC, mask, on); in aic31xx_clk_on()
965 snd_soc_update_bits(codec, AIC31XX_MDAC, mask, on); in aic31xx_clk_on()
967 snd_soc_update_bits(codec, AIC31XX_NADC, mask, on); in aic31xx_clk_on()
969 snd_soc_update_bits(codec, AIC31XX_MADC, mask, on); in aic31xx_clk_on()
970 snd_soc_update_bits(codec, AIC31XX_BCLKN, mask, on); in aic31xx_clk_on()
973 static void aic31xx_clk_off(struct snd_soc_codec *codec) in aic31xx_clk_off() argument
978 dev_dbg(codec->dev, "codec clock -> off\n"); in aic31xx_clk_off()
979 snd_soc_update_bits(codec, AIC31XX_BCLKN, mask, off); in aic31xx_clk_off()
980 snd_soc_update_bits(codec, AIC31XX_MADC, mask, off); in aic31xx_clk_off()
981 snd_soc_update_bits(codec, AIC31XX_NADC, mask, off); in aic31xx_clk_off()
982 snd_soc_update_bits(codec, AIC31XX_MDAC, mask, off); in aic31xx_clk_off()
983 snd_soc_update_bits(codec, AIC31XX_NDAC, mask, off); in aic31xx_clk_off()
984 snd_soc_update_bits(codec, AIC31XX_PLLPR, mask, off); in aic31xx_clk_off()
987 static int aic31xx_power_on(struct snd_soc_codec *codec) in aic31xx_power_on() argument
989 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_power_on()
1004 dev_err(codec->dev, in aic31xx_power_on()
1014 static int aic31xx_power_off(struct snd_soc_codec *codec) in aic31xx_power_off() argument
1016 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_power_off()
1026 static int aic31xx_set_bias_level(struct snd_soc_codec *codec, in aic31xx_set_bias_level() argument
1029 dev_dbg(codec->dev, "## %s: %d -> %d\n", __func__, in aic31xx_set_bias_level()
1030 snd_soc_codec_get_bias_level(codec), level); in aic31xx_set_bias_level()
1036 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_STANDBY) in aic31xx_set_bias_level()
1037 aic31xx_clk_on(codec); in aic31xx_set_bias_level()
1040 switch (snd_soc_codec_get_bias_level(codec)) { in aic31xx_set_bias_level()
1042 aic31xx_power_on(codec); in aic31xx_set_bias_level()
1045 aic31xx_clk_off(codec); in aic31xx_set_bias_level()
1052 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_STANDBY) in aic31xx_set_bias_level()
1053 aic31xx_power_off(codec); in aic31xx_set_bias_level()
1060 static int aic31xx_codec_probe(struct snd_soc_codec *codec) in aic31xx_codec_probe() argument
1063 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_codec_probe()
1068 aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_codec_probe()
1070 aic31xx->codec = codec; in aic31xx_codec_probe()
1079 dev_err(codec->dev, in aic31xx_codec_probe()
1089 ret = aic31xx_add_controls(codec); in aic31xx_codec_probe()
1093 ret = aic31xx_add_widgets(codec); in aic31xx_codec_probe()
1098 static int aic31xx_codec_remove(struct snd_soc_codec *codec) in aic31xx_codec_remove() argument
1100 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); in aic31xx_codec_remove()