From 3e843196c697ee2c319d96e861980fb4c3e04e24 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Thu, 19 Apr 2012 12:04:03 +0200
Subject: [PATCH] ALSA: hda/sigmatel - Fix inverted mute LED
Git-commit: 3e843196c697ee2c319d96e861980fb4c3e04e24
Patch-mainline: 3.4-rc6
References: FATE#313695

While refactoring the mute-LED handling for HP laptops, I messed up
the polarity check in a wrong way.  The red (or the mute-LED if any)
should appear in the muted state, corresponding to GPIO on.

Reported-by: Mikko Vinni <mmvinni@yahoo.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 sound/pci/hda/patch_sigmatel.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -5062,12 +5062,11 @@ static void stac92xx_update_led_status(s
 	if (spec->gpio_led_polarity)
 		muted = !muted;
 
-	/*polarity defines *not* muted state level*/
 	if (!spec->vref_mute_led_nid) {
 		if (muted)
-			spec->gpio_data &= ~spec->gpio_led; /* orange */
+			spec->gpio_data |= spec->gpio_led;
 		else
-			spec->gpio_data |= spec->gpio_led; /* white */
+			spec->gpio_data &= ~spec->gpio_led;
 		stac_gpio_set(codec, spec->gpio_mask,
 				spec->gpio_dir, spec->gpio_data);
 	} else {
