Lines Matching refs:codec
378 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in set_dmic_clk() local
379 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in set_dmic_clk()
386 dev_err(codec->dev, "Failed to set DMIC clock\n"); in set_dmic_clk()
388 snd_soc_update_bits(codec, RT5651_DMIC, RT5651_DMIC_CLK_MASK, in set_dmic_clk()
397 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(source->dapm); in is_sysclk_from_pll() local
400 val = snd_soc_read(codec, RT5651_GLB_CLK); in is_sysclk_from_pll()
735 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in rt5651_amp_power_event() local
736 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_amp_power_event()
773 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in rt5651_hp_event() local
774 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_hp_event()
818 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in rt5651_hp_post_event() local
819 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_hp_post_event()
838 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in rt5651_bst1_event() local
842 snd_soc_update_bits(codec, RT5651_PWR_ANLG2, in rt5651_bst1_event()
847 snd_soc_update_bits(codec, RT5651_PWR_ANLG2, in rt5651_bst1_event()
861 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in rt5651_bst2_event() local
865 snd_soc_update_bits(codec, RT5651_PWR_ANLG2, in rt5651_bst2_event()
870 snd_soc_update_bits(codec, RT5651_PWR_ANLG2, in rt5651_bst2_event()
884 struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm); in rt5651_bst3_event() local
888 snd_soc_update_bits(codec, RT5651_PWR_ANLG2, in rt5651_bst3_event()
893 snd_soc_update_bits(codec, RT5651_PWR_ANLG2, in rt5651_bst3_event()
1346 struct snd_soc_codec *codec = dai->codec; in rt5651_hw_params() local
1347 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_hw_params()
1355 dev_err(codec->dev, "Unsupported clock setting\n"); in rt5651_hw_params()
1360 dev_err(codec->dev, "Unsupported frame size: %d\n", frame_size); in rt5651_hw_params()
1391 snd_soc_update_bits(codec, RT5651_I2S1_SDP, in rt5651_hw_params()
1393 snd_soc_update_bits(codec, RT5651_ADDA_CLK1, mask_clk, val_clk); in rt5651_hw_params()
1398 snd_soc_update_bits(codec, RT5651_I2S2_SDP, in rt5651_hw_params()
1400 snd_soc_update_bits(codec, RT5651_ADDA_CLK1, mask_clk, val_clk); in rt5651_hw_params()
1403 dev_err(codec->dev, "Wrong dai->id: %d\n", dai->id); in rt5651_hw_params()
1412 struct snd_soc_codec *codec = dai->codec; in rt5651_set_dai_fmt() local
1413 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_set_dai_fmt()
1456 snd_soc_update_bits(codec, RT5651_I2S1_SDP, in rt5651_set_dai_fmt()
1461 snd_soc_update_bits(codec, RT5651_I2S2_SDP, in rt5651_set_dai_fmt()
1466 dev_err(codec->dev, "Wrong dai->id: %d\n", dai->id); in rt5651_set_dai_fmt()
1475 struct snd_soc_codec *codec = dai->codec; in rt5651_set_dai_sysclk() local
1476 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_set_dai_sysclk()
1493 dev_err(codec->dev, "Invalid clock id (%d)\n", clk_id); in rt5651_set_dai_sysclk()
1496 snd_soc_update_bits(codec, RT5651_GLB_CLK, in rt5651_set_dai_sysclk()
1509 struct snd_soc_codec *codec = dai->codec; in rt5651_set_dai_pll() local
1510 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_set_dai_pll()
1519 dev_dbg(codec->dev, "PLL disabled\n"); in rt5651_set_dai_pll()
1523 snd_soc_update_bits(codec, RT5651_GLB_CLK, in rt5651_set_dai_pll()
1530 snd_soc_update_bits(codec, RT5651_GLB_CLK, in rt5651_set_dai_pll()
1534 snd_soc_update_bits(codec, RT5651_GLB_CLK, in rt5651_set_dai_pll()
1538 snd_soc_update_bits(codec, RT5651_GLB_CLK, in rt5651_set_dai_pll()
1542 dev_err(codec->dev, "Unknown PLL source %d\n", source); in rt5651_set_dai_pll()
1548 dev_err(codec->dev, "Unsupport input clock %d\n", freq_in); in rt5651_set_dai_pll()
1552 dev_dbg(codec->dev, "bypass=%d m=%d n=%d k=%d\n", in rt5651_set_dai_pll()
1556 snd_soc_write(codec, RT5651_PLL_CTRL1, in rt5651_set_dai_pll()
1558 snd_soc_write(codec, RT5651_PLL_CTRL2, in rt5651_set_dai_pll()
1569 static int rt5651_set_bias_level(struct snd_soc_codec *codec, in rt5651_set_bias_level() argument
1574 if (SND_SOC_BIAS_STANDBY == snd_soc_codec_get_bias_level(codec)) { in rt5651_set_bias_level()
1575 snd_soc_update_bits(codec, RT5651_PWR_ANLG1, in rt5651_set_bias_level()
1581 snd_soc_update_bits(codec, RT5651_PWR_ANLG1, in rt5651_set_bias_level()
1584 snd_soc_update_bits(codec, RT5651_PWR_ANLG1, in rt5651_set_bias_level()
1587 snd_soc_update_bits(codec, RT5651_D_MISC, 0x1, 0x1); in rt5651_set_bias_level()
1588 if (snd_soc_read(codec, RT5651_PLL_MODE_1) & 0x9200) in rt5651_set_bias_level()
1589 snd_soc_update_bits(codec, RT5651_D_MISC, in rt5651_set_bias_level()
1595 snd_soc_write(codec, RT5651_D_MISC, 0x0010); in rt5651_set_bias_level()
1596 snd_soc_write(codec, RT5651_PWR_DIG1, 0x0000); in rt5651_set_bias_level()
1597 snd_soc_write(codec, RT5651_PWR_DIG2, 0x0000); in rt5651_set_bias_level()
1598 snd_soc_write(codec, RT5651_PWR_VOL, 0x0000); in rt5651_set_bias_level()
1599 snd_soc_write(codec, RT5651_PWR_MIXER, 0x0000); in rt5651_set_bias_level()
1600 snd_soc_write(codec, RT5651_PWR_ANLG1, 0x0000); in rt5651_set_bias_level()
1601 snd_soc_write(codec, RT5651_PWR_ANLG2, 0x0000); in rt5651_set_bias_level()
1611 static int rt5651_probe(struct snd_soc_codec *codec) in rt5651_probe() argument
1613 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_probe()
1615 rt5651->codec = codec; in rt5651_probe()
1617 snd_soc_update_bits(codec, RT5651_PWR_ANLG1, in rt5651_probe()
1623 snd_soc_update_bits(codec, RT5651_PWR_ANLG1, in rt5651_probe()
1627 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF); in rt5651_probe()
1633 static int rt5651_suspend(struct snd_soc_codec *codec) in rt5651_suspend() argument
1635 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_suspend()
1642 static int rt5651_resume(struct snd_soc_codec *codec) in rt5651_resume() argument
1644 struct rt5651_priv *rt5651 = snd_soc_codec_get_drvdata(codec); in rt5651_resume()
1647 snd_soc_cache_sync(codec); in rt5651_resume()