mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 17:06:41 +07:00
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>
This commit is contained in:
parent
90bc11d1d0
commit
2cf0342822
@ -174,19 +174,15 @@ static int ad1836_soc_suspend(struct snd_soc_codec *codec,
|
||||
pm_message_t state)
|
||||
{
|
||||
/* reset clock control mode */
|
||||
u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2);
|
||||
adc_ctrl2 &= ~AD1836_ADC_SERFMT_MASK;
|
||||
|
||||
return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2);
|
||||
return snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
|
||||
AD1836_ADC_SERFMT_MASK, 0);
|
||||
}
|
||||
|
||||
static int ad1836_soc_resume(struct snd_soc_codec *codec)
|
||||
{
|
||||
/* restore clock control mode */
|
||||
u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2);
|
||||
adc_ctrl2 |= AD1836_ADC_AUX;
|
||||
|
||||
return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2);
|
||||
return snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
|
||||
AD1836_ADC_SERFMT_MASK, AD1836_ADC_AUX);
|
||||
}
|
||||
#else
|
||||
#define ad1836_soc_suspend NULL
|
||||
@ -266,10 +262,8 @@ static int ad1836_probe(struct snd_soc_codec *codec)
|
||||
static int ad1836_remove(struct snd_soc_codec *codec)
|
||||
{
|
||||
/* reset clock control mode */
|
||||
u16 adc_ctrl2 = snd_soc_read(codec, AD1836_ADC_CTRL2);
|
||||
adc_ctrl2 &= ~AD1836_ADC_SERFMT_MASK;
|
||||
|
||||
return snd_soc_write(codec, AD1836_ADC_CTRL2, adc_ctrl2);
|
||||
return snd_soc_update_bits(codec, AD1836_ADC_CTRL2,
|
||||
AD1836_ADC_SERFMT_MASK, 0);
|
||||
}
|
||||
|
||||
static struct snd_soc_codec_driver soc_codec_dev_ad1836 = {
|
||||
|
Loading…
Reference in New Issue
Block a user