Lines Matching refs:codec

158 	struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);  in mic_bias_event()  local
159 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in mic_bias_event()
164 snd_soc_update_bits(codec, SGTL5000_CHIP_MIC_CTRL, in mic_bias_event()
170 snd_soc_update_bits(codec, SGTL5000_CHIP_MIC_CTRL, in mic_bias_event()
185 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in power_vag_event() local
190 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in power_vag_event()
201 if ((snd_soc_read(codec, SGTL5000_CHIP_ANA_POWER) & in power_vag_event()
203 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in power_vag_event()
329 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in dac_get_volsw() local
334 reg = snd_soc_read(codec, SGTL5000_CHIP_DAC_VOL); in dac_get_volsw()
382 struct snd_soc_codec *codec = snd_soc_kcontrol_codec(kcontrol); in dac_put_volsw() local
402 snd_soc_write(codec, SGTL5000_CHIP_DAC_VOL, reg); in dac_put_volsw()
451 struct snd_soc_codec *codec = codec_dai->codec; in sgtl5000_digital_mute() local
454 snd_soc_update_bits(codec, SGTL5000_CHIP_ADCDAC_CTRL, in sgtl5000_digital_mute()
463 struct snd_soc_codec *codec = codec_dai->codec; in sgtl5000_set_dai_fmt() local
464 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_set_dai_fmt()
522 snd_soc_write(codec, SGTL5000_CHIP_I2S_CTRL, i2sctl); in sgtl5000_set_dai_fmt()
531 struct snd_soc_codec *codec = codec_dai->codec; in sgtl5000_set_dai_sysclk() local
532 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_set_dai_sysclk()
558 static int sgtl5000_set_clock(struct snd_soc_codec *codec, int frame_rate) in sgtl5000_set_clock() argument
560 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_set_clock()
613 dev_err(codec->dev, "frame rate %d not supported\n", in sgtl5000_set_clock()
642 dev_err(codec->dev, in sgtl5000_set_clock()
644 dev_err(codec->dev, "%d ratio is not supported. " in sgtl5000_set_clock()
677 snd_soc_write(codec, SGTL5000_CHIP_PLL_CTRL, pll_ctl); in sgtl5000_set_clock()
679 snd_soc_update_bits(codec, in sgtl5000_set_clock()
684 snd_soc_update_bits(codec, in sgtl5000_set_clock()
690 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in sgtl5000_set_clock()
695 snd_soc_write(codec, SGTL5000_CHIP_CLK_CTRL, clk_ctl); in sgtl5000_set_clock()
698 snd_soc_write(codec, SGTL5000_CHIP_CLK_CTRL, clk_ctl); in sgtl5000_set_clock()
701 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in sgtl5000_set_clock()
717 struct snd_soc_codec *codec = dai->codec; in sgtl5000_pcm_hw_params() local
718 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_pcm_hw_params()
726 dev_err(codec->dev, "%s: set sysclk first!\n", __func__); in sgtl5000_pcm_hw_params()
736 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, stereo, in sgtl5000_pcm_hw_params()
740 ret = sgtl5000_set_clock(codec, params_rate(params)); in sgtl5000_pcm_hw_params()
774 snd_soc_update_bits(codec, SGTL5000_CHIP_I2S_CTRL, in sgtl5000_pcm_hw_params()
792 struct snd_soc_codec *codec = (struct snd_soc_codec *)ldo->codec_data; in ldo_regulator_enable() local
806 snd_soc_update_bits(codec, SGTL5000_CHIP_LINREG_CTRL, in ldo_regulator_enable()
809 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in ldo_regulator_enable()
814 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in ldo_regulator_enable()
825 struct snd_soc_codec *codec = (struct snd_soc_codec *)ldo->codec_data; in ldo_regulator_disable() local
827 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in ldo_regulator_disable()
832 snd_soc_update_bits(codec, SGTL5000_CHIP_LINREG_CTRL, in ldo_regulator_disable()
854 static int ldo_regulator_register(struct snd_soc_codec *codec, in ldo_regulator_register() argument
859 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in ldo_regulator_register()
867 ldo->desc.name = kstrdup(dev_name(codec->dev), GFP_KERNEL); in ldo_regulator_register()
870 dev_err(codec->dev, "failed to allocate decs name memory\n"); in ldo_regulator_register()
879 ldo->codec_data = codec; in ldo_regulator_register()
882 config.dev = codec->dev; in ldo_regulator_register()
890 dev_err(codec->dev, "failed to register regulator\n"); in ldo_regulator_register()
901 static int ldo_regulator_remove(struct snd_soc_codec *codec) in ldo_regulator_remove() argument
903 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in ldo_regulator_remove()
916 static int ldo_regulator_register(struct snd_soc_codec *codec, in ldo_regulator_register() argument
920 dev_err(codec->dev, "this setup needs regulator support in the kernel\n"); in ldo_regulator_register()
924 static int ldo_regulator_remove(struct snd_soc_codec *codec) in ldo_regulator_remove() argument
940 static int sgtl5000_set_bias_level(struct snd_soc_codec *codec, in sgtl5000_set_bias_level() argument
944 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_set_bias_level()
951 if (snd_soc_codec_get_bias_level(codec) == SND_SOC_BIAS_OFF) { in sgtl5000_set_bias_level()
963 dev_err(codec->dev, in sgtl5000_set_bias_level()
1118 static int sgtl5000_set_power_regs(struct snd_soc_codec *codec) in sgtl5000_set_power_regs() argument
1130 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_set_power_regs()
1141 dev_err(codec->dev, "regulator voltage not set correctly\n"); in sgtl5000_set_power_regs()
1148 dev_err(codec->dev, in sgtl5000_set_power_regs()
1156 ana_pwr = snd_soc_read(codec, SGTL5000_CHIP_ANA_POWER); in sgtl5000_set_power_regs()
1160 lreg_ctrl = snd_soc_read(codec, SGTL5000_CHIP_LINREG_CTRL); in sgtl5000_set_power_regs()
1164 snd_soc_update_bits(codec, SGTL5000_CHIP_CLK_TOP_CTRL, in sgtl5000_set_power_regs()
1177 snd_soc_write(codec, SGTL5000_CHIP_LINREG_CTRL, lreg_ctrl); in sgtl5000_set_power_regs()
1179 snd_soc_write(codec, SGTL5000_CHIP_ANA_POWER, ana_pwr); in sgtl5000_set_power_regs()
1182 snd_soc_update_bits(codec, SGTL5000_CHIP_LINREG_CTRL, in sgtl5000_set_power_regs()
1191 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in sgtl5000_set_power_regs()
1195 snd_soc_update_bits(codec, SGTL5000_CHIP_ANA_POWER, in sgtl5000_set_power_regs()
1213 snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL, in sgtl5000_set_power_regs()
1227 snd_soc_update_bits(codec, SGTL5000_CHIP_LINE_OUT_CTRL, in sgtl5000_set_power_regs()
1250 snd_soc_update_bits(codec, SGTL5000_CHIP_LINE_OUT_VOL, in sgtl5000_set_power_regs()
1259 static int sgtl5000_replace_vddd_with_ldo(struct snd_soc_codec *codec) in sgtl5000_replace_vddd_with_ldo() argument
1261 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_replace_vddd_with_ldo()
1265 ret = ldo_regulator_register(codec, &ldo_init_data, LDO_VOLTAGE); in sgtl5000_replace_vddd_with_ldo()
1267 dev_err(codec->dev, in sgtl5000_replace_vddd_with_ldo()
1274 dev_info(codec->dev, "Using internal LDO instead of VDDD\n"); in sgtl5000_replace_vddd_with_ldo()
1278 static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) in sgtl5000_enable_regulators() argument
1283 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_enable_regulators()
1291 vddd = regulator_get_optional(codec->dev, "VDDD"); in sgtl5000_enable_regulators()
1303 ret = sgtl5000_replace_vddd_with_ldo(codec); in sgtl5000_enable_regulators()
1308 ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies), in sgtl5000_enable_regulators()
1328 ldo_regulator_remove(codec); in sgtl5000_enable_regulators()
1333 static int sgtl5000_probe(struct snd_soc_codec *codec) in sgtl5000_probe() argument
1336 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_probe()
1338 ret = sgtl5000_enable_regulators(codec); in sgtl5000_probe()
1343 ret = sgtl5000_set_power_regs(codec); in sgtl5000_probe()
1348 snd_soc_update_bits(codec, SGTL5000_CHIP_REF_CTRL, in sgtl5000_probe()
1352 snd_soc_write(codec, SGTL5000_CHIP_SHORT_CTRL, 0); in sgtl5000_probe()
1358 snd_soc_write(codec, SGTL5000_CHIP_SSS_CTRL, in sgtl5000_probe()
1360 snd_soc_write(codec, SGTL5000_CHIP_DIG_POWER, in sgtl5000_probe()
1364 snd_soc_write(codec, SGTL5000_CHIP_ADCDAC_CTRL, in sgtl5000_probe()
1369 snd_soc_write(codec, SGTL5000_CHIP_PAD_STRENGTH, 0x015f); in sgtl5000_probe()
1371 snd_soc_write(codec, SGTL5000_CHIP_ANA_CTRL, in sgtl5000_probe()
1375 snd_soc_update_bits(codec, SGTL5000_CHIP_MIC_CTRL, in sgtl5000_probe()
1379 snd_soc_update_bits(codec, SGTL5000_CHIP_MIC_CTRL, in sgtl5000_probe()
1387 snd_soc_write(codec, SGTL5000_DAP_CTRL, 0); in sgtl5000_probe()
1396 ldo_regulator_remove(codec); in sgtl5000_probe()
1401 static int sgtl5000_remove(struct snd_soc_codec *codec) in sgtl5000_remove() argument
1403 struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); in sgtl5000_remove()
1409 ldo_regulator_remove(codec); in sgtl5000_remove()