Lines Matching refs:codec
131 static int wm8955_reset(struct snd_soc_codec *codec) in wm8955_reset() argument
133 return snd_soc_write(codec, WM8955_RESET, 0); in wm8955_reset()
245 static int wm8955_configure_clocking(struct snd_soc_codec *codec) in wm8955_configure_clocking() argument
247 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_configure_clocking()
270 dev_err(codec->dev, "Sample rate %dHz unsupported\n", in wm8955_configure_clocking()
285 ret = wm8995_pll_factors(codec->dev, wm8955->mclk_rate, in wm8955_configure_clocking()
288 dev_err(codec->dev, in wm8955_configure_clocking()
294 snd_soc_update_bits(codec, WM8955_PLL_CONTROL_1, in wm8955_configure_clocking()
298 snd_soc_update_bits(codec, WM8955_PLL_CONTROL_2, in wm8955_configure_clocking()
301 snd_soc_update_bits(codec, WM8955_PLL_CONTROL_3, in wm8955_configure_clocking()
305 snd_soc_update_bits(codec, WM8955_PLL_CONTROL_4, in wm8955_configure_clocking()
308 snd_soc_update_bits(codec, WM8955_PLL_CONTROL_4, in wm8955_configure_clocking()
317 snd_soc_update_bits(codec, WM8955_CLOCKING_PLL, in wm8955_configure_clocking()
319 snd_soc_update_bits(codec, WM8955_CLOCKING_PLL, in wm8955_configure_clocking()
325 snd_soc_update_bits(codec, WM8955_SAMPLE_RATE, in wm8955_configure_clocking()
327 snd_soc_update_bits(codec, WM8955_CLOCKING_PLL, in wm8955_configure_clocking()
336 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in wm8955_sysclk() local
342 snd_soc_update_bits(codec, WM8955_POWER_MANAGEMENT_1, in wm8955_sysclk()
344 snd_soc_update_bits(codec, WM8955_CLOCKING_PLL, in wm8955_sysclk()
351 ret = wm8955_configure_clocking(codec); in wm8955_sysclk()
363 static int wm8955_set_deemph(struct snd_soc_codec *codec) in wm8955_set_deemph() argument
365 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_set_deemph()
384 dev_dbg(codec->dev, "Set deemphasis %d\n", val); in wm8955_set_deemph()
386 return snd_soc_update_bits(codec, WM8955_DAC_CONTROL, in wm8955_set_deemph()
393 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8955_get_deemph() local
394 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_get_deemph()
403 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in wm8955_put_deemph() local
404 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_put_deemph()
412 return wm8955_set_deemph(codec); in wm8955_put_deemph()
595 struct snd_soc_codec *codec = dai->codec; in wm8955_hw_params() local
596 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_hw_params()
616 snd_soc_update_bits(codec, WM8955_AUDIO_INTERFACE, in wm8955_hw_params()
620 wm8955_set_deemph(codec); in wm8955_hw_params()
625 ret = snd_soc_read(codec, WM8955_POWER_MANAGEMENT_1); in wm8955_hw_params()
629 snd_soc_update_bits(codec, WM8955_POWER_MANAGEMENT_1, in wm8955_hw_params()
631 snd_soc_update_bits(codec, WM8955_CLOCKING_PLL, in wm8955_hw_params()
634 wm8955_configure_clocking(codec); in wm8955_hw_params()
644 struct snd_soc_codec *codec = dai->codec; in wm8955_set_sysclk() local
645 struct wm8955_priv *priv = snd_soc_codec_get_drvdata(codec); in wm8955_set_sysclk()
658 snd_soc_update_bits(codec, WM8955_SAMPLE_RATE, in wm8955_set_sysclk()
673 struct snd_soc_codec *codec = dai->codec; in wm8955_set_fmt() local
742 snd_soc_update_bits(codec, WM8955_AUDIO_INTERFACE, in wm8955_set_fmt()
752 struct snd_soc_codec *codec = codec_dai->codec; in wm8955_digital_mute() local
760 snd_soc_update_bits(codec, WM8955_DAC_CONTROL, WM8955_DACMU, val); in wm8955_digital_mute()
765 static int wm8955_set_bias_level(struct snd_soc_codec *codec, in wm8955_set_bias_level() argument
768 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_set_bias_level()
777 snd_soc_update_bits(codec, WM8955_POWER_MANAGEMENT_1, in wm8955_set_bias_level()
782 snd_soc_update_bits(codec, WM8955_ADDITIONAL_CONTROL_1, in wm8955_set_bias_level()
788 if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) { in wm8955_set_bias_level()
792 dev_err(codec->dev, in wm8955_set_bias_level()
801 snd_soc_update_bits(codec, WM8955_POWER_MANAGEMENT_1, in wm8955_set_bias_level()
811 snd_soc_update_bits(codec, in wm8955_set_bias_level()
817 snd_soc_update_bits(codec, WM8955_POWER_MANAGEMENT_1, in wm8955_set_bias_level()
822 snd_soc_update_bits(codec, WM8955_ADDITIONAL_CONTROL_1, in wm8955_set_bias_level()
828 snd_soc_update_bits(codec, in wm8955_set_bias_level()
833 snd_soc_update_bits(codec, WM8955_POWER_MANAGEMENT_1, in wm8955_set_bias_level()
841 codec->dapm.bias_level = level; in wm8955_set_bias_level()
869 static int wm8955_probe(struct snd_soc_codec *codec) in wm8955_probe() argument
871 struct wm8955_priv *wm8955 = snd_soc_codec_get_drvdata(codec); in wm8955_probe()
872 struct wm8955_pdata *pdata = dev_get_platdata(codec->dev); in wm8955_probe()
878 ret = devm_regulator_bulk_get(codec->dev, ARRAY_SIZE(wm8955->supplies), in wm8955_probe()
881 dev_err(codec->dev, "Failed to request supplies: %d\n", ret); in wm8955_probe()
888 dev_err(codec->dev, "Failed to enable supplies: %d\n", ret); in wm8955_probe()
892 ret = wm8955_reset(codec); in wm8955_probe()
894 dev_err(codec->dev, "Failed to issue reset: %d\n", ret); in wm8955_probe()
899 snd_soc_update_bits(codec, WM8955_LEFT_DAC_VOLUME, in wm8955_probe()
901 snd_soc_update_bits(codec, WM8955_RIGHT_DAC_VOLUME, in wm8955_probe()
903 snd_soc_update_bits(codec, WM8955_LOUT1_VOLUME, in wm8955_probe()
906 snd_soc_update_bits(codec, WM8955_ROUT1_VOLUME, in wm8955_probe()
909 snd_soc_update_bits(codec, WM8955_LOUT2_VOLUME, in wm8955_probe()
912 snd_soc_update_bits(codec, WM8955_ROUT2_VOLUME, in wm8955_probe()
915 snd_soc_update_bits(codec, WM8955_MONOOUT_VOLUME, in wm8955_probe()
919 snd_soc_update_bits(codec, WM8955_BASS_CONTROL, WM8955_BB, WM8955_BB); in wm8955_probe()
924 snd_soc_update_bits(codec, WM8955_ADDITIONAL_CONTROL_2, in wm8955_probe()
928 snd_soc_update_bits(codec, WM8955_MONO_OUT_MIX_1, in wm8955_probe()
932 wm8955_set_bias_level(codec, SND_SOC_BIAS_STANDBY); in wm8955_probe()