summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc.h1
-rw-r--r--sound/soc/soc-cache.c20
2 files changed, 16 insertions, 5 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 4e8f14bc8ed..e6a6d10de1d 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -424,6 +424,7 @@ struct snd_soc_codec {
unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */
unsigned int cache_only:1; /* Suppress writes to hardware */
+ unsigned int cache_sync:1; /* Cache needs to be synced to hardware */
/* dapm */
u32 pop_time;
diff --git a/sound/soc/soc-cache.c b/sound/soc/soc-cache.c
index 84b6916db87..5869dc3be78 100644
--- a/sound/soc/soc-cache.c
+++ b/sound/soc/soc-cache.c
@@ -39,8 +39,10 @@ static int snd_soc_4_12_write(struct snd_soc_codec *codec, unsigned int reg,
if (reg < codec->reg_cache_size)
cache[reg] = value;
- if (codec->cache_only)
+ if (codec->cache_only) {
+ codec->cache_sync = 1;
return 0;
+ }
ret = codec->hw_write(codec->control_data, data, 2);
if (ret == 2)
@@ -105,8 +107,10 @@ static int snd_soc_7_9_write(struct snd_soc_codec *codec, unsigned int reg,
if (reg < codec->reg_cache_size)
cache[reg] = value;
- if (codec->cache_only)
+ if (codec->cache_only) {
+ codec->cache_sync = 1;
return 0;
+ }
ret = codec->hw_write(codec->control_data, data, 2);
if (ret == 2)
@@ -161,8 +165,10 @@ static int snd_soc_8_8_write(struct snd_soc_codec *codec, unsigned int reg,
if (reg < codec->reg_cache_size)
cache[reg] = value;
- if (codec->cache_only)
+ if (codec->cache_only) {
+ codec->cache_sync = 1;
return 0;
+ }
if (codec->hw_write(codec->control_data, data, 2) == 2)
return 0;
@@ -192,8 +198,10 @@ static int snd_soc_8_16_write(struct snd_soc_codec *codec, unsigned int reg,
if (!snd_soc_codec_volatile_register(codec, reg))
reg_cache[reg] = value;
- if (codec->cache_only)
+ if (codec->cache_only) {
+ codec->cache_sync = 1;
return 0;
+ }
if (codec->hw_write(codec->control_data, data, 3) == 3)
return 0;
@@ -313,8 +321,10 @@ static int snd_soc_16_8_write(struct snd_soc_codec *codec, unsigned int reg,
if (reg < codec->reg_cache_size)
cache[reg] = value;
- if (codec->cache_only)
+ if (codec->cache_only) {
+ codec->cache_sync = 1;
return 0;
+ }
ret = codec->hw_write(codec->control_data, data, 3);
if (ret == 3)