aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-04-27 16:13:24 -0400
committerMark Brown <broonie@kernel.org>2015-04-27 16:34:45 -0400
commitbd1204cb51f15d202f95222e873a94ed5d07b784 (patch)
tree1613bc56de735f9b572c9eb579c999439fed4d3f
parentfa880775ab0d5a8d540972f7b6800fad1af16b75 (diff)
ASoC: Route all bias level updates through the core
Use the new snd_soc_codec_force_bias_level() helper function to invoke the bias_level callback of a driver instead of calling the callback by hand. Currently the effect of this is the same, but having all bias level updates go through a central place will allow us to move more of the bias level management into the DAPM core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/max98095.c4
-rw-r--r--sound/soc/codecs/rt5640.c4
-rw-r--r--sound/soc/codecs/rt5645.c2
-rw-r--r--sound/soc/codecs/rt5651.c2
-rw-r--r--sound/soc/codecs/rt5677.c2
-rw-r--r--sound/soc/codecs/sta32x.c2
-rw-r--r--sound/soc/codecs/sta350.c2
-rw-r--r--sound/soc/codecs/twl6040.c2
-rw-r--r--sound/soc/codecs/wm8731.c2
-rw-r--r--sound/soc/codecs/wm8737.c2
-rw-r--r--sound/soc/codecs/wm8900.c6
-rw-r--r--sound/soc/codecs/wm8940.c2
-rw-r--r--sound/soc/codecs/wm8955.c2
-rw-r--r--sound/soc/codecs/wm8978.c4
-rw-r--r--sound/soc/codecs/wm8990.c2
-rw-r--r--sound/soc/codecs/wm8993.c4
-rw-r--r--sound/soc/codecs/wm8994.c2
-rw-r--r--sound/soc/codecs/wm9712.c2
-rw-r--r--sound/soc/codecs/wm9713.c2
19 files changed, 25 insertions, 25 deletions
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 8fba0c3db798..d6e80a932ec3 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -2198,7 +2198,7 @@ static int max98095_suspend(struct snd_soc_codec *codec)
2198 if (max98095->headphone_jack || max98095->mic_jack) 2198 if (max98095->headphone_jack || max98095->mic_jack)
2199 max98095_jack_detect_disable(codec); 2199 max98095_jack_detect_disable(codec);
2200 2200
2201 max98095_set_bias_level(codec, SND_SOC_BIAS_OFF); 2201 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
2202 2202
2203 return 0; 2203 return 0;
2204} 2204}
@@ -2208,7 +2208,7 @@ static int max98095_resume(struct snd_soc_codec *codec)
2208 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec); 2208 struct max98095_priv *max98095 = snd_soc_codec_get_drvdata(codec);
2209 struct i2c_client *client = to_i2c_client(codec->dev); 2209 struct i2c_client *client = to_i2c_client(codec->dev);
2210 2210
2211 max98095_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 2211 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
2212 2212
2213 if (max98095->headphone_jack || max98095->mic_jack) { 2213 if (max98095->headphone_jack || max98095->mic_jack) {
2214 max98095_jack_detect_enable(codec); 2214 max98095_jack_detect_enable(codec);
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c
index 178e55d4d481..d39b25cd62ef 100644
--- a/sound/soc/codecs/rt5640.c
+++ b/sound/soc/codecs/rt5640.c
@@ -1939,7 +1939,7 @@ static int rt5640_probe(struct snd_soc_codec *codec)
1939 1939
1940 rt5640->codec = codec; 1940 rt5640->codec = codec;
1941 1941
1942 rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); 1942 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
1943 1943
1944 snd_soc_update_bits(codec, RT5640_DUMMY1, 0x0301, 0x0301); 1944 snd_soc_update_bits(codec, RT5640_DUMMY1, 0x0301, 0x0301);
1945 snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030); 1945 snd_soc_update_bits(codec, RT5640_MICBIAS, 0x0030, 0x0030);
@@ -1991,7 +1991,7 @@ static int rt5640_suspend(struct snd_soc_codec *codec)
1991{ 1991{
1992 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec); 1992 struct rt5640_priv *rt5640 = snd_soc_codec_get_drvdata(codec);
1993 1993
1994 rt5640_set_bias_level(codec, SND_SOC_BIAS_OFF); 1994 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
1995 rt5640_reset(codec); 1995 rt5640_reset(codec);
1996 regcache_cache_only(rt5640->regmap, true); 1996 regcache_cache_only(rt5640->regmap, true);
1997 regcache_mark_dirty(rt5640->regmap); 1997 regcache_mark_dirty(rt5640->regmap);
diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index 69528ae5410c..b1e681a3e8db 100644
--- a/sound/soc/codecs/rt5645.c
+++ b/sound/soc/codecs/rt5645.c
@@ -2520,7 +2520,7 @@ static int rt5645_probe(struct snd_soc_codec *codec)
2520 break; 2520 break;
2521 } 2521 }
2522 2522
2523 rt5645_set_bias_level(codec, SND_SOC_BIAS_OFF); 2523 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
2524 2524
2525 snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200); 2525 snd_soc_update_bits(codec, RT5645_CHARGE_PUMP, 0x0300, 0x0200);
2526 2526
diff --git a/sound/soc/codecs/rt5651.c b/sound/soc/codecs/rt5651.c
index 9f4c7be6d798..35c972505948 100644
--- a/sound/soc/codecs/rt5651.c
+++ b/sound/soc/codecs/rt5651.c
@@ -1625,7 +1625,7 @@ static int rt5651_probe(struct snd_soc_codec *codec)
1625 RT5651_PWR_FV1 | RT5651_PWR_FV2, 1625 RT5651_PWR_FV1 | RT5651_PWR_FV2,
1626 RT5651_PWR_FV1 | RT5651_PWR_FV2); 1626 RT5651_PWR_FV1 | RT5651_PWR_FV2);
1627 1627
1628 rt5651_set_bias_level(codec, SND_SOC_BIAS_OFF); 1628 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
1629 1629
1630 return 0; 1630 return 0;
1631} 1631}
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index af182586712d..ba408ad23457 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4618,7 +4618,7 @@ static int rt5677_probe(struct snd_soc_codec *codec)
4618 ARRAY_SIZE(rt5677_dmic2_clk_1)); 4618 ARRAY_SIZE(rt5677_dmic2_clk_1));
4619 } 4619 }
4620 4620
4621 rt5677_set_bias_level(codec, SND_SOC_BIAS_OFF); 4621 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
4622 4622
4623 regmap_write(rt5677->regmap, RT5677_DIG_MISC, 0x0020); 4623 regmap_write(rt5677->regmap, RT5677_DIG_MISC, 0x0020);
4624 regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00); 4624 regmap_write(rt5677->regmap, RT5677_PWR_DSP2, 0x0c00);
diff --git a/sound/soc/codecs/sta32x.c b/sound/soc/codecs/sta32x.c
index 007a0e3bc273..686ec765ea0e 100644
--- a/sound/soc/codecs/sta32x.c
+++ b/sound/soc/codecs/sta32x.c
@@ -970,7 +970,7 @@ static int sta32x_probe(struct snd_soc_codec *codec)
970 if (sta32x->pdata->needs_esd_watchdog) 970 if (sta32x->pdata->needs_esd_watchdog)
971 INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_watchdog); 971 INIT_DELAYED_WORK(&sta32x->watchdog_work, sta32x_watchdog);
972 972
973 sta32x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 973 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
974 /* Bias level configuration will have done an extra enable */ 974 /* Bias level configuration will have done an extra enable */
975 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies); 975 regulator_bulk_disable(ARRAY_SIZE(sta32x->supplies), sta32x->supplies);
976 976
diff --git a/sound/soc/codecs/sta350.c b/sound/soc/codecs/sta350.c
index 669e3228241e..46fc07a94fcd 100644
--- a/sound/soc/codecs/sta350.c
+++ b/sound/soc/codecs/sta350.c
@@ -1037,7 +1037,7 @@ static int sta350_probe(struct snd_soc_codec *codec)
1037 sta350->coef_shadow[60] = 0x400000; 1037 sta350->coef_shadow[60] = 0x400000;
1038 sta350->coef_shadow[61] = 0x400000; 1038 sta350->coef_shadow[61] = 0x400000;
1039 1039
1040 sta350_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1040 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1041 /* Bias level configuration will have done an extra enable */ 1041 /* Bias level configuration will have done an extra enable */
1042 regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies); 1042 regulator_bulk_disable(ARRAY_SIZE(sta350->supplies), sta350->supplies);
1043 1043
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index aeec27b6f1af..9bd887ed7f44 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1130,7 +1130,7 @@ static int twl6040_probe(struct snd_soc_codec *codec)
1130 return ret; 1130 return ret;
1131 } 1131 }
1132 1132
1133 twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1133 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1134 twl6040_init_chip(codec); 1134 twl6040_init_chip(codec);
1135 1135
1136 return 0; 1136 return 0;
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
index 2245b6a32f3d..00898d9d977d 100644
--- a/sound/soc/codecs/wm8731.c
+++ b/sound/soc/codecs/wm8731.c
@@ -599,7 +599,7 @@ static int wm8731_probe(struct snd_soc_codec *codec)
599 goto err_regulator_enable; 599 goto err_regulator_enable;
600 } 600 }
601 601
602 wm8731_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 602 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
603 603
604 /* Latch the update bits */ 604 /* Latch the update bits */
605 snd_soc_update_bits(codec, WM8731_LOUT1V, 0x100, 0); 605 snd_soc_update_bits(codec, WM8731_LOUT1V, 0x100, 0);
diff --git a/sound/soc/codecs/wm8737.c b/sound/soc/codecs/wm8737.c
index ada9ac1ba2c6..40e6acb4f3f4 100644
--- a/sound/soc/codecs/wm8737.c
+++ b/sound/soc/codecs/wm8737.c
@@ -560,7 +560,7 @@ static int wm8737_probe(struct snd_soc_codec *codec)
560 snd_soc_update_bits(codec, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU, 560 snd_soc_update_bits(codec, WM8737_RIGHT_PGA_VOLUME, WM8737_RVU,
561 WM8737_RVU); 561 WM8737_RVU);
562 562
563 wm8737_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 563 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
564 564
565 /* Bias level configuration will have done an extra enable */ 565 /* Bias level configuration will have done an extra enable */
566 regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies); 566 regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
diff --git a/sound/soc/codecs/wm8900.c b/sound/soc/codecs/wm8900.c
index 2eb986c19b88..065da37bbf21 100644
--- a/sound/soc/codecs/wm8900.c
+++ b/sound/soc/codecs/wm8900.c
@@ -1138,7 +1138,7 @@ static int wm8900_suspend(struct snd_soc_codec *codec)
1138 wm8900->fll_out = fll_out; 1138 wm8900->fll_out = fll_out;
1139 wm8900->fll_in = fll_in; 1139 wm8900->fll_in = fll_in;
1140 1140
1141 wm8900_set_bias_level(codec, SND_SOC_BIAS_OFF); 1141 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
1142 1142
1143 return 0; 1143 return 0;
1144} 1144}
@@ -1156,7 +1156,7 @@ static int wm8900_resume(struct snd_soc_codec *codec)
1156 return ret; 1156 return ret;
1157 } 1157 }
1158 1158
1159 wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1159 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1160 1160
1161 /* Restart the FLL? */ 1161 /* Restart the FLL? */
1162 if (wm8900->fll_out) { 1162 if (wm8900->fll_out) {
@@ -1189,7 +1189,7 @@ static int wm8900_probe(struct snd_soc_codec *codec)
1189 wm8900_reset(codec); 1189 wm8900_reset(codec);
1190 1190
1191 /* Turn the chip on */ 1191 /* Turn the chip on */
1192 wm8900_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1192 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1193 1193
1194 /* Latch the volume update bits */ 1194 /* Latch the volume update bits */
1195 snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100); 1195 snd_soc_update_bits(codec, WM8900_REG_LINVOL, 0x100, 0x100);
diff --git a/sound/soc/codecs/wm8940.c b/sound/soc/codecs/wm8940.c
index e4142b4309eb..4b4b9973c740 100644
--- a/sound/soc/codecs/wm8940.c
+++ b/sound/soc/codecs/wm8940.c
@@ -707,7 +707,7 @@ static int wm8940_probe(struct snd_soc_codec *codec)
707 return ret; 707 return ret;
708 } 708 }
709 709
710 wm8940_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 710 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
711 711
712 ret = snd_soc_write(codec, WM8940_POWER1, 0x180); 712 ret = snd_soc_write(codec, WM8940_POWER1, 0x180);
713 if (ret < 0) 713 if (ret < 0)
diff --git a/sound/soc/codecs/wm8955.c b/sound/soc/codecs/wm8955.c
index 00bec915d652..8080eabf63bd 100644
--- a/sound/soc/codecs/wm8955.c
+++ b/sound/soc/codecs/wm8955.c
@@ -929,7 +929,7 @@ static int wm8955_probe(struct snd_soc_codec *codec)
929 WM8955_DMEN, WM8955_DMEN); 929 WM8955_DMEN, WM8955_DMEN);
930 } 930 }
931 931
932 wm8955_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 932 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
933 933
934 /* Bias level configuration will have done an extra enable */ 934 /* Bias level configuration will have done an extra enable */
935 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies); 935 regulator_bulk_disable(ARRAY_SIZE(wm8955->supplies), wm8955->supplies);
diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index cf7032911721..572b1bf07d6c 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -928,7 +928,7 @@ static int wm8978_suspend(struct snd_soc_codec *codec)
928{ 928{
929 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec); 929 struct wm8978_priv *wm8978 = snd_soc_codec_get_drvdata(codec);
930 930
931 wm8978_set_bias_level(codec, SND_SOC_BIAS_OFF); 931 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
932 /* Also switch PLL off */ 932 /* Also switch PLL off */
933 snd_soc_write(codec, WM8978_POWER_MANAGEMENT_1, 0); 933 snd_soc_write(codec, WM8978_POWER_MANAGEMENT_1, 0);
934 934
@@ -944,7 +944,7 @@ static int wm8978_resume(struct snd_soc_codec *codec)
944 /* Sync reg_cache with the hardware */ 944 /* Sync reg_cache with the hardware */
945 regcache_sync(wm8978->regmap); 945 regcache_sync(wm8978->regmap);
946 946
947 wm8978_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 947 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
948 948
949 if (wm8978->f_pllout) 949 if (wm8978->f_pllout)
950 /* Switch PLL on */ 950 /* Switch PLL on */
diff --git a/sound/soc/codecs/wm8990.c b/sound/soc/codecs/wm8990.c
index c93bffcb3cfb..c642b3abba5d 100644
--- a/sound/soc/codecs/wm8990.c
+++ b/sound/soc/codecs/wm8990.c
@@ -1281,7 +1281,7 @@ static int wm8990_probe(struct snd_soc_codec *codec)
1281 wm8990_reset(codec); 1281 wm8990_reset(codec);
1282 1282
1283 /* charge output caps */ 1283 /* charge output caps */
1284 wm8990_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1284 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1285 1285
1286 snd_soc_update_bits(codec, WM8990_AUDIO_INTERFACE_4, 1286 snd_soc_update_bits(codec, WM8990_AUDIO_INTERFACE_4,
1287 WM8990_ALRCGPIO1, WM8990_ALRCGPIO1); 1287 WM8990_ALRCGPIO1, WM8990_ALRCGPIO1);
diff --git a/sound/soc/codecs/wm8993.c b/sound/soc/codecs/wm8993.c
index 2e70a270eb28..b8385ac26b90 100644
--- a/sound/soc/codecs/wm8993.c
+++ b/sound/soc/codecs/wm8993.c
@@ -1563,7 +1563,7 @@ static int wm8993_suspend(struct snd_soc_codec *codec)
1563 wm8993->fll_fout = fll_fout; 1563 wm8993->fll_fout = fll_fout;
1564 wm8993->fll_fref = fll_fref; 1564 wm8993->fll_fref = fll_fref;
1565 1565
1566 wm8993_set_bias_level(codec, SND_SOC_BIAS_OFF); 1566 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
1567 1567
1568 return 0; 1568 return 0;
1569} 1569}
@@ -1573,7 +1573,7 @@ static int wm8993_resume(struct snd_soc_codec *codec)
1573 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec); 1573 struct wm8993_priv *wm8993 = snd_soc_codec_get_drvdata(codec);
1574 int ret; 1574 int ret;
1575 1575
1576 wm8993_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1576 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1577 1577
1578 /* Restart the FLL? */ 1578 /* Restart the FLL? */
1579 if (wm8993->fll_fout) { 1579 if (wm8993->fll_fout) {
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index 4fbc7689339a..fedf48d8e7ae 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3163,7 +3163,7 @@ static int wm8994_codec_suspend(struct snd_soc_codec *codec)
3163 i + 1, ret); 3163 i + 1, ret);
3164 } 3164 }
3165 3165
3166 wm8994_set_bias_level(codec, SND_SOC_BIAS_OFF); 3166 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_OFF);
3167 3167
3168 return 0; 3168 return 0;
3169} 3169}
diff --git a/sound/soc/codecs/wm9712.c b/sound/soc/codecs/wm9712.c
index 98c9525bd751..9119a779f728 100644
--- a/sound/soc/codecs/wm9712.c
+++ b/sound/soc/codecs/wm9712.c
@@ -646,7 +646,7 @@ static int wm9712_soc_resume(struct snd_soc_codec *codec)
646 if (ret < 0) 646 if (ret < 0)
647 return ret; 647 return ret;
648 648
649 wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 649 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
650 650
651 if (ret == 0) { 651 if (ret == 0) {
652 /* Sync reg_cache with the hardware after cold reset */ 652 /* Sync reg_cache with the hardware after cold reset */
diff --git a/sound/soc/codecs/wm9713.c b/sound/soc/codecs/wm9713.c
index 79552953e1bd..39c3e717c577 100644
--- a/sound/soc/codecs/wm9713.c
+++ b/sound/soc/codecs/wm9713.c
@@ -1201,7 +1201,7 @@ static int wm9713_soc_resume(struct snd_soc_codec *codec)
1201 if (ret < 0) 1201 if (ret < 0)
1202 return ret; 1202 return ret;
1203 1203
1204 wm9713_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 1204 snd_soc_codec_force_bias_level(codec, SND_SOC_BIAS_STANDBY);
1205 1205
1206 /* do we need to re-start the PLL ? */ 1206 /* do we need to re-start the PLL ? */
1207 if (wm9713->pll_in) 1207 if (wm9713->pll_in)