aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8904.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/wm8904.c')
-rw-r--r--sound/soc/codecs/wm8904.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c
index 65d525d74c54..812acd83fb48 100644
--- a/sound/soc/codecs/wm8904.c
+++ b/sound/soc/codecs/wm8904.c
@@ -1863,6 +1863,7 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,
1863 return ret; 1863 return ret;
1864 } 1864 }
1865 1865
1866 regcache_cache_only(wm8904->regmap, false);
1866 regcache_sync(wm8904->regmap); 1867 regcache_sync(wm8904->regmap);
1867 1868
1868 /* Enable bias */ 1869 /* Enable bias */
@@ -1899,14 +1900,8 @@ static int wm8904_set_bias_level(struct snd_soc_codec *codec,
1899 snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0, 1900 snd_soc_update_bits(codec, WM8904_BIAS_CONTROL_0,
1900 WM8904_BIAS_ENA, 0); 1901 WM8904_BIAS_ENA, 0);
1901 1902
1902#ifdef CONFIG_REGULATOR 1903 regcache_cache_only(wm8904->regmap, true);
1903 /* Post 2.6.34 we will be able to get a callback when 1904 regcache_mark_dirty(wm8904->regmap);
1904 * the regulators are disabled which we can use but
1905 * for now just assume that the power will be cut if
1906 * the regulator API is in use.
1907 */
1908 codec->cache_sync = 1;
1909#endif
1910 1905
1911 regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies), 1906 regulator_bulk_disable(ARRAY_SIZE(wm8904->supplies),
1912 wm8904->supplies); 1907 wm8904->supplies);
@@ -2084,10 +2079,8 @@ static int wm8904_probe(struct snd_soc_codec *codec)
2084{ 2079{
2085 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec); 2080 struct wm8904_priv *wm8904 = snd_soc_codec_get_drvdata(codec);
2086 struct wm8904_pdata *pdata = wm8904->pdata; 2081 struct wm8904_pdata *pdata = wm8904->pdata;
2087 u16 *reg_cache = codec->reg_cache;
2088 int ret, i; 2082 int ret, i;
2089 2083
2090 codec->cache_sync = 1;
2091 codec->control_data = wm8904->regmap; 2084 codec->control_data = wm8904->regmap;
2092 2085
2093 switch (wm8904->devtype) { 2086 switch (wm8904->devtype) {
@@ -2150,6 +2143,7 @@ static int wm8904_probe(struct snd_soc_codec *codec)
2150 goto err_enable; 2143 goto err_enable;
2151 } 2144 }
2152 2145
2146 regcache_cache_only(wm8904->regmap, true);
2153 /* Change some default settings - latch VU and enable ZC */ 2147 /* Change some default settings - latch VU and enable ZC */
2154 snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT, 2148 snd_soc_update_bits(codec, WM8904_ADC_DIGITAL_VOLUME_LEFT,
2155 WM8904_ADC_VU, WM8904_ADC_VU); 2149 WM8904_ADC_VU, WM8904_ADC_VU);
@@ -2180,14 +2174,18 @@ static int wm8904_probe(struct snd_soc_codec *codec)
2180 if (!pdata->gpio_cfg[i]) 2174 if (!pdata->gpio_cfg[i])
2181 continue; 2175 continue;
2182 2176
2183 reg_cache[WM8904_GPIO_CONTROL_1 + i] 2177 regmap_update_bits(wm8904->regmap,
2184 = pdata->gpio_cfg[i] & 0xffff; 2178 WM8904_GPIO_CONTROL_1 + i,
2179 0xffff,
2180 pdata->gpio_cfg[i]);
2185 } 2181 }
2186 2182
2187 /* Zero is the default value for these anyway */ 2183 /* Zero is the default value for these anyway */
2188 for (i = 0; i < WM8904_MIC_REGS; i++) 2184 for (i = 0; i < WM8904_MIC_REGS; i++)
2189 reg_cache[WM8904_MIC_BIAS_CONTROL_0 + i] 2185 regmap_update_bits(wm8904->regmap,
2190 = pdata->mic_cfg[i]; 2186 WM8904_MIC_BIAS_CONTROL_0 + i,
2187 0xffff,
2188 pdata->mic_cfg[i]);
2191 } 2189 }
2192 2190
2193 /* Set Class W by default - this will be managed by the Class 2191 /* Set Class W by default - this will be managed by the Class