aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/twl6040.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 4ad04e3d5c40..c9a601d43ca2 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -746,7 +746,7 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
746 struct twl6040_output *out = NULL; 746 struct twl6040_output *out = NULL;
747 struct soc_mixer_control *mc = 747 struct soc_mixer_control *mc =
748 (struct soc_mixer_control *)kcontrol->private_value; 748 (struct soc_mixer_control *)kcontrol->private_value;
749 int ret; 749 int ret, type_2r;
750 750
751 /* For HS and HF we shadow the values and only actually write 751 /* For HS and HF we shadow the values and only actually write
752 * them out when active in order to ensure the amplifier comes on 752 * 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,
754 switch (mc->reg) { 754 switch (mc->reg) {
755 case TWL6040_REG_HSGAIN: 755 case TWL6040_REG_HSGAIN:
756 out = &twl6040_priv->headset; 756 out = &twl6040_priv->headset;
757 type_2r = 0;
757 break; 758 break;
758 case TWL6040_REG_HFLGAIN: 759 case TWL6040_REG_HFLGAIN:
759 out = &twl6040_priv->handsfree; 760 out = &twl6040_priv->handsfree;
761 type_2r = 1;
760 break; 762 break;
761 default: 763 default:
762 return -EINVAL; 764 return -EINVAL;
@@ -768,7 +770,7 @@ static int twl6040_put_volsw(struct snd_kcontrol *kcontrol,
768 return 1; 770 return 1;
769 771
770 /* call the appropriate handler depending on the rreg */ 772 /* call the appropriate handler depending on the rreg */
771 if (mc->rreg) 773 if (type_2r)
772 ret = snd_soc_put_volsw_2r(kcontrol, ucontrol); 774 ret = snd_soc_put_volsw_2r(kcontrol, ucontrol);
773 else 775 else
774 ret = snd_soc_put_volsw(kcontrol, ucontrol); 776 ret = snd_soc_put_volsw(kcontrol, ucontrol);