diff options
author | Jarkko Nikula <jhnikula@gmail.com> | 2010-09-14 09:59:47 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-09-15 08:56:15 -0400 |
commit | 9900daa81b9e668c28ecf568c714ee49090aa187 (patch) | |
tree | 0e94e0609867c1c39841043bc9dcfb1b39b977a0 /sound/soc/codecs/tlv320aic3x.c | |
parent | a84a441ba3cab4a62a8ed40fbfbc112ded50f492 (diff) |
ASoC: tlv320aic3x: Complete the soc-cache conversion
Complete the phasing out of aic3x_read_reg_cache, aic3x_write_reg_cache,
aic3x_read and aic3x_write calls.
This patch uses in aic3x_read the codec->hw_read that points to a function
implemented by soc-cache. Only use for aic3x_read is if wanting to read
volatile bits from those registers that has both read-only and read/write
bits. All other cases should use snd_soc_read.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/tlv320aic3x.c')
-rw-r--r-- | sound/soc/codecs/tlv320aic3x.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c index 86e5a5868c3c..7b5f159cfaf1 100644 --- a/sound/soc/codecs/tlv320aic3x.c +++ b/sound/soc/codecs/tlv320aic3x.c | |||
@@ -112,28 +112,21 @@ static const u8 aic3x_reg[AIC3X_CACHEREGNUM] = { | |||
112 | }; | 112 | }; |
113 | 113 | ||
114 | /* | 114 | /* |
115 | * write aic3x register cache | 115 | * read from the aic3x register space. Only use for this function is if |
116 | */ | 116 | * wanting to read volatile bits from those registers that has both read-only |
117 | static inline void aic3x_write_reg_cache(struct snd_soc_codec *codec, | 117 | * and read/write bits. All other cases should use snd_soc_read. |
118 | u8 reg, u8 value) | ||
119 | { | ||
120 | u8 *cache = codec->reg_cache; | ||
121 | if (reg >= AIC3X_CACHEREGNUM) | ||
122 | return; | ||
123 | cache[reg] = value; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * read from the aic3x register space | ||
128 | */ | 118 | */ |
129 | static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg, | 119 | static int aic3x_read(struct snd_soc_codec *codec, unsigned int reg, |
130 | u8 *value) | 120 | u8 *value) |
131 | { | 121 | { |
132 | *value = reg & 0xff; | 122 | u8 *cache = codec->reg_cache; |
123 | |||
124 | if (reg >= AIC3X_CACHEREGNUM) | ||
125 | return -1; | ||
133 | 126 | ||
134 | value[0] = i2c_smbus_read_byte_data(codec->control_data, value[0]); | 127 | *value = codec->hw_read(codec, reg); |
128 | cache[reg] = *value; | ||
135 | 129 | ||
136 | aic3x_write_reg_cache(codec, reg, *value); | ||
137 | return 0; | 130 | return 0; |
138 | } | 131 | } |
139 | 132 | ||