From: Pierre-Louis Bossart Date: Fri, 18 Dec 2015 02:35:48 +0000 (-0600) Subject: ASoC: Intel: Atom: flip logic for gain Switch X-Git-Tag: v4.5-rc1~80^2~26^2~1^2~6^4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=940a5a014d50e15269b5d197ab571d1ca9971c43;p=karo-tx-linux.git ASoC: Intel: Atom: flip logic for gain Switch The upstreamed code modified the control names from Mute to Switch without changing the logic. To get audio working the Switch needs to be off which isn't aligned with normal ALSA conventions. Inverting the logic now so that Switch Off means mute and Switch On means active audio using the specific volume setting. Signed-off-by: Sebastien Guiriec Signed-off-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- diff --git a/sound/soc/intel/atom/sst-atom-controls.c b/sound/soc/intel/atom/sst-atom-controls.c index 1727cc4c7f8a..b97e6adcf1b2 100644 --- a/sound/soc/intel/atom/sst-atom-controls.c +++ b/sound/soc/intel/atom/sst-atom-controls.c @@ -443,7 +443,7 @@ static int sst_gain_get(struct snd_kcontrol *kcontrol, break; case SST_GAIN_MUTE: - ucontrol->value.integer.value[0] = gv->mute ? 1 : 0; + ucontrol->value.integer.value[0] = gv->mute ? 0 : 1; break; case SST_GAIN_RAMP_DURATION: @@ -479,7 +479,7 @@ static int sst_gain_put(struct snd_kcontrol *kcontrol, break; case SST_GAIN_MUTE: - gv->mute = !!ucontrol->value.integer.value[0]; + gv->mute = !ucontrol->value.integer.value[0]; dev_dbg(cmpnt->dev, "%s: Mute %d\n", mc->pname, gv->mute); break;