aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ad1836.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ad1836.c')
-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 = {