aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2011-06-06 07:38:37 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-06-06 16:54:41 -0400
commit2cf034282205a2115777b7a899f6f12d06943b62 (patch)
tree064f703d039da56f6557568a9e6af1f567de9021
parent90bc11d1d0310e5e6bfbdea6ed21047b3865df05 (diff)
ASoC: AD1836: Use snd_soc_update_bits for read-modify-write
Use snd_soc_update_bits for read-modify-write register access instead of open-coding it using snd_soc_read and snd_soc_write. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--sound/soc/codecs/ad1836.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c
index 675d6ccdf9d6..a2de8a571bfd 100644
--- a/sound/soc/codecs/ad1836.c
+++ b/sound/soc/codecs/ad1836.c
@@ -174,19 +174,15 @@ static int ad1836_soc_suspend(struct snd_soc_codec *codec,
174 pm_message_t state) 174 pm_message_t state)
175{ 175{
176 /* reset clock control mode */ 176 /* reset clock control mode */
177 u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2); 177 return snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
178 adc_ctrl2 &= ~AD1836_ADC_SERFMT_MASK; 178 AD1836_ADC_SERFMT_MASK, 0);
179
180 return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2);
181} 179}
182 180
183static int ad1836_soc_resume(struct snd_soc_codec *codec) 181static int ad1836_soc_resume(struct snd_soc_codec *codec)
184{ 182{
185 /* restore clock control mode */ 183 /* restore clock control mode */
186 u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2); 184 return snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
187 adc_ctrl2 |= AD1836_ADC_AUX; 185 AD1836_ADC_SERFMT_MASK, AD1836_ADC_AUX);
188
189 return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2);
190} 186}
191#else 187#else
192#define ad1836_soc_suspend NULL 188#define ad1836_soc_suspend NULL
@@ -266,10 +262,8 @@ static int ad1836_probe(struct snd_soc_codec *codec)
266static int ad1836_remove(struct snd_soc_codec *codec) 262static int ad1836_remove(struct snd_soc_codec *codec)
267{ 263{
268 /* reset clock control mode */ 264 /* reset clock control mode */
269 u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2); 265 return snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
270 adc_ctrl2 &= ~AD1836_ADC_SERFMT_MASK; 266 AD1836_ADC_SERFMT_MASK, 0);
271
272 return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2);
273} 267}
274 268
275static struct snd_soc_codec_driver soc_codec_dev_ad1836 = { 269static struct snd_soc_codec_driver soc_codec_dev_ad1836 = {