aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-io.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/sound/soc/soc-io.c b/sound/soc/soc-io.c
index 8aa086996866..260efc8466fc 100644
--- a/sound/soc/soc-io.c
+++ b/sound/soc/soc-io.c
@@ -23,21 +23,6 @@
23static int hw_write(struct snd_soc_codec *codec, unsigned int reg, 23static int hw_write(struct snd_soc_codec *codec, unsigned int reg,
24 unsigned int value) 24 unsigned int value)
25{ 25{
26 int ret;
27
28 if (!snd_soc_codec_volatile_register(codec, reg) &&
29 reg < codec->driver->reg_cache_size &&
30 !codec->cache_bypass) {
31 ret = snd_soc_cache_write(codec, reg, value);
32 if (ret < 0)
33 return -1;
34 }
35
36 if (codec->cache_only) {
37 codec->cache_sync = 1;
38 return 0;
39 }
40
41 return regmap_write(codec->control_data, reg, value); 26 return regmap_write(codec->control_data, reg, value);
42} 27}
43 28
@@ -46,23 +31,11 @@ static unsigned int hw_read(struct snd_soc_codec *codec, unsigned int reg)
46 int ret; 31 int ret;
47 unsigned int val; 32 unsigned int val;
48 33
49 if (reg >= codec->driver->reg_cache_size || 34 ret = regmap_read(codec->control_data, reg, &val);
50 snd_soc_codec_volatile_register(codec, reg) || 35 if (ret == 0)
51 codec->cache_bypass) { 36 return val;
52 if (codec->cache_only) 37 else
53 return -1;
54
55 ret = regmap_read(codec->control_data, reg, &val);
56 if (ret == 0)
57 return val;
58 else
59 return -1;
60 }
61
62 ret = snd_soc_cache_read(codec, reg, &val);
63 if (ret < 0)
64 return -1; 38 return -1;
65 return val;
66} 39}
67 40
68/** 41/**