aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic31xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/tlv320aic31xx.c')
-rw-r--r--sound/soc/codecs/tlv320aic31xx.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/sound/soc/codecs/tlv320aic31xx.c b/sound/soc/codecs/tlv320aic31xx.c
index 145fe5b253d4..dc3223d6eca1 100644
--- a/sound/soc/codecs/tlv320aic31xx.c
+++ b/sound/soc/codecs/tlv320aic31xx.c
@@ -911,12 +911,13 @@ static int aic31xx_set_dai_sysclk(struct snd_soc_dai *codec_dai,
911 } 911 }
912 aic31xx->p_div = i; 912 aic31xx->p_div = i;
913 913
914 for (i = 0; aic31xx_divs[i].mclk_p != freq/aic31xx->p_div; i++) { 914 for (i = 0; i < ARRAY_SIZE(aic31xx_divs) &&
915 if (i == ARRAY_SIZE(aic31xx_divs)) { 915 aic31xx_divs[i].mclk_p != freq/aic31xx->p_div; i++)
916 dev_err(aic31xx->dev, "%s: Unsupported frequency %d\n", 916 ;
917 __func__, freq); 917 if (i == ARRAY_SIZE(aic31xx_divs)) {
918 return -EINVAL; 918 dev_err(aic31xx->dev, "%s: Unsupported frequency %d\n",
919 } 919 __func__, freq);
920 return -EINVAL;
920 } 921 }
921 922
922 /* set clock on MCLK, BCLK, or GPIO1 as PLL input */ 923 /* set clock on MCLK, BCLK, or GPIO1 as PLL input */
@@ -1056,18 +1057,6 @@ static int aic31xx_set_bias_level(struct snd_soc_codec *codec,
1056 return 0; 1057 return 0;
1057} 1058}
1058 1059
1059static int aic31xx_suspend(struct snd_soc_codec *codec)
1060{
1061 aic31xx_set_bias_level(codec, SND_SOC_BIAS_OFF);
1062 return 0;
1063}
1064
1065static int aic31xx_resume(struct snd_soc_codec *codec)
1066{
1067 aic31xx_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1068 return 0;
1069}
1070
1071static int aic31xx_codec_probe(struct snd_soc_codec *codec) 1060static int aic31xx_codec_probe(struct snd_soc_codec *codec)
1072{ 1061{
1073 int ret = 0; 1062 int ret = 0;
@@ -1110,8 +1099,6 @@ static int aic31xx_codec_remove(struct snd_soc_codec *codec)
1110{ 1099{
1111 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec); 1100 struct aic31xx_priv *aic31xx = snd_soc_codec_get_drvdata(codec);
1112 int i; 1101 int i;
1113 /* power down chip */
1114 aic31xx_set_bias_level(codec, SND_SOC_BIAS_OFF);
1115 1102
1116 for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++) 1103 for (i = 0; i < ARRAY_SIZE(aic31xx->supplies); i++)
1117 regulator_unregister_notifier(aic31xx->supplies[i].consumer, 1104 regulator_unregister_notifier(aic31xx->supplies[i].consumer,
@@ -1123,9 +1110,9 @@ static int aic31xx_codec_remove(struct snd_soc_codec *codec)
1123static struct snd_soc_codec_driver soc_codec_driver_aic31xx = { 1110static struct snd_soc_codec_driver soc_codec_driver_aic31xx = {
1124 .probe = aic31xx_codec_probe, 1111 .probe = aic31xx_codec_probe,
1125 .remove = aic31xx_codec_remove, 1112 .remove = aic31xx_codec_remove,
1126 .suspend = aic31xx_suspend,
1127 .resume = aic31xx_resume,
1128 .set_bias_level = aic31xx_set_bias_level, 1113 .set_bias_level = aic31xx_set_bias_level,
1114 .suspend_bias_off = true,
1115
1129 .controls = aic31xx_snd_controls, 1116 .controls = aic31xx_snd_controls,
1130 .num_controls = ARRAY_SIZE(aic31xx_snd_controls), 1117 .num_controls = ARRAY_SIZE(aic31xx_snd_controls),
1131 .dapm_widgets = aic31xx_dapm_widgets, 1118 .dapm_widgets = aic31xx_dapm_widgets,