aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/twl6040.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 3f28e82db5a..ab14f47041d 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -783,20 +783,18 @@ static int headset_power_mode(struct snd_soc_codec *codec, int high_perf)
{
int hslctl, hsrctl;
int mask = TWL6040_HSDRVMODEL | TWL6040_HSDACMODEL;
+ int val;
- hslctl = twl6040_read_reg_cache(codec, TWL6040_REG_HSLCTL);
- hsrctl = twl6040_read_reg_cache(codec, TWL6040_REG_HSRCTL);
+ hslctl = snd_soc_read(codec, TWL6040_REG_HSLCTL);
+ hsrctl = snd_soc_read(codec, TWL6040_REG_HSRCTL);
- if (high_perf) {
- hslctl &= ~mask;
- hsrctl &= ~mask;
- } else {
- hslctl |= mask;
- hsrctl |= mask;
- }
+ if (high_perf)
+ val = 0;
+ else
+ val = mask;
- twl6040_write(codec, TWL6040_REG_HSLCTL, hslctl);
- twl6040_write(codec, TWL6040_REG_HSRCTL, hsrctl);
+ snd_soc_update_bits(codec, TWL6040_REG_HSLCTL, mask, val);
+ snd_soc_update_bits(codec, TWL6040_REG_HSRCTL, mask, val);
return 0;
}