From f329ec1ce42dc21e7ed67bab8541ab8ab090d307 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 5 Oct 2011 10:29:21 +0300 Subject: [PATCH] --- yaml --- r: 270780 b: refs/heads/master c: 08a1ed76f5cf94bef07cb370b079760553a87b4b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/sound/soc/codecs/twl6040.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 8afdae619af0..ad544a4f3ea9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e49b68339ebc7d2e67dc1ae16a4ac6a35fcfc9d5 +refs/heads/master: 08a1ed76f5cf94bef07cb370b079760553a87b4b diff --git a/trunk/sound/soc/codecs/twl6040.c b/trunk/sound/soc/codecs/twl6040.c index 4ad04e3d5c40..c9a601d43ca2 100644 --- a/trunk/sound/soc/codecs/twl6040.c +++ b/trunk/sound/soc/codecs/twl6040.c @@ -746,7 +746,7 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol, struct twl6040_output *out = NULL; struct soc_mixer_control *mc = (struct soc_mixer_control *)kcontrol->private_value; - int ret; + int ret, type_2r; /* For HS and HF we shadow the values and only actually write * them out when active in order to ensure the amplifier comes on @@ -754,9 +754,11 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol, switch (mc->reg) { case TWL6040_REG_HSGAIN: out = &twl6040_priv->headset; + type_2r = 0; break; case TWL6040_REG_HFLGAIN: out = &twl6040_priv->handsfree; + type_2r = 1; break; default: return -EINVAL; @@ -768,7 +770,7 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol, return 1; /* call the appropriate handler depending on the rreg */ - if (mc->rreg) + if (type_2r) ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); else ret = snd_soc_put_volsw(kcontrol, ucontrol);