aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-08 23:30:43 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-06-25 04:53:43 -0400
commitfd88759a42dc10f8230b3933a1ceb40bd88fccea (patch)
tree9c722f91d46315fcfd8bc4f875f99f8768dab450 /sound
parentd1e16c1a61d68692dba346f4a841315343b085f4 (diff)
ASoC: wm8904: Rely entirely on the core for bias level management
Even though the WM8904 is able to use idle_bias_off during both probe and resume we were needlessly leaving the device in standby mode. Instead power the device down as soon as we've confirmed that we can talk to it and don't manage the bias level at all over suspend and resume, the core will take us down to our minimum power level. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/wm8904.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 5417b1183acb..ecab871573b1 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1945,25 +1945,6 @@ static struct snd_soc_dai_driver wm8904_dai = {
1945 .symmetric_rates = 1, 1945 .symmetric_rates = 1,
1946}; 1946};
1947 1947
1948#ifdef CONFIG_PM
1949static int wm8904_suspend(struct snd_soc_codec *codec)
1950{
1951 wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF);
1952
1953 return 0;
1954}
1955
1956static int wm8904_resume(struct snd_soc_codec *codec)
1957{
1958 wm8904_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
1959
1960 return 0;
1961}
1962#else
1963#define wm8904_suspend NULL
1964#define wm8904_resume NULL
1965#endif
1966
1967static void wm8904_handle_retune_mobile_pdata(struct snd_soc_codec *codec) 1948static void wm8904_handle_retune_mobile_pdata(struct snd_soc_codec *codec)
1968{ 1949{
1969 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 1950 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
@@ -2143,7 +2124,10 @@ static int wm8904_probe(struct snd_soc_codec *codec)
2143 goto err_enable; 2124 goto err_enable;
2144 } 2125 }
2145 2126
2127 /* Can leave the device powered off until we need it */
2146 regcache_cache_only(wm8904->regmap, true); 2128 regcache_cache_only(wm8904->regmap, true);
2129 regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904->supplies);
2130
2147 /* Change some default settings - latch VU and enable ZC */ 2131 /* Change some default settings - latch VU and enable ZC */
2148 snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT, 2132 snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT,
2149 WM8904_ADC_VU, WM8904_ADC_VU); 2133 WM8904_ADC_VU, WM8904_ADC_VU);
@@ -2198,11 +2182,6 @@ static int wm8904_probe(struct snd_soc_codec *codec)
2198 snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, 2182 snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0,
2199 WM8904_POBCTRL, 0); 2183 WM8904_POBCTRL, 0);
2200 2184
2201 wm8904_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
2202
2203 /* Bias level configuration will have done an extra enable */
2204 regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), wm8904->supplies);
2205
2206 wm8904_handle_pdata(codec); 2185 wm8904_handle_pdata(codec);
2207 2186
2208 wm8904_add_widgets(codec); 2187 wm8904_add_widgets(codec);
@@ -2220,7 +2199,6 @@ static int wm8904_remove(struct snd_soc_codec *codec)
2220{ 2199{
2221 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 2200 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
2222 2201
2223 wm8904_set_bias_level(codec, SND_SOC_BIAS_OFF);
2224 regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies); 2202 regulator_bulk_free(ARRAY_SIZE(wm8904->supplies), wm8904->supplies);
2225 kfree(wm8904->retune_mobile_texts); 2203 kfree(wm8904->retune_mobile_texts);
2226 kfree(wm8904->drc_texts); 2204 kfree(wm8904->drc_texts);
@@ -2231,8 +2209,6 @@ static int wm8904_remove(struct snd_soc_codec *codec)
2231static struct snd_soc_codec_driver soc_codec_dev_wm8904 = { 2209static struct snd_soc_codec_driver soc_codec_dev_wm8904 = {
2232 .probe = wm8904_probe, 2210 .probe = wm8904_probe,
2233 .remove = wm8904_remove, 2211 .remove = wm8904_remove,
2234 .suspend = wm8904_suspend,
2235 .resume = wm8904_resume,
2236 .set_bias_level = wm8904_set_bias_level, 2212 .set_bias_level = wm8904_set_bias_level,
2237 .idle_bias_off = true, 2213 .idle_bias_off = true,
2238}; 2214};