From: Takashi Iwai <tiwai@suse.de>
Date: Tue, 9 Feb 2010 08:25:26 +0000 (+0100)
Subject: ALSA: hda - Fix default polarity of mute-LED GPIO on 92HD83x/88x codecs
X-Git-Tag: firefly_0821_release~9833^2~2567^2~8^2~14
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=dce17d4ff366230aeeaaf42512bba3711243cf1c;p=firefly-linux-kernel-4.4.55.git

ALSA: hda - Fix default polarity of mute-LED GPIO on 92HD83x/88x codecs

The previous commit caused a regression on HP laptops with 92HD83x/88x
codecs.  The default polarity of mute-LED GPIO is inverted on these
devices.

Reference: Novell bnc#578190
	https://bugzilla.novell.com/show_bug.cgi?id=578190

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---

diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ec0637e7d488..8c416bb18a57 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4790,7 +4790,7 @@ static void set_hp_led_gpio(struct hda_codec *codec)
  * Need more information on whether it is true across the entire series.
  * -- kunal
  */
-static int find_mute_led_gpio(struct hda_codec *codec)
+static int find_mute_led_gpio(struct hda_codec *codec, int default_polarity)
 {
 	struct sigmatel_spec *spec = codec->spec;
 	const struct dmi_device *dev = NULL;
@@ -4817,7 +4817,7 @@ static int find_mute_led_gpio(struct hda_codec *codec)
 		 */
 		if (!hp_blike_system(codec->subsystem_id)) {
 			set_hp_led_gpio(codec);
-			spec->gpio_led_polarity = 1;
+			spec->gpio_led_polarity = default_polarity;
 			return 1;
 		}
 	}
@@ -5343,7 +5343,7 @@ again:
 
 	codec->patch_ops = stac92xx_patch_ops;
 
-	if (find_mute_led_gpio(codec))
+	if (find_mute_led_gpio(codec, 0))
 		snd_printd("mute LED gpio %d polarity %d\n",
 				spec->gpio_led,
 				spec->gpio_led_polarity);
@@ -5705,7 +5705,7 @@ again:
 		}
 	}
 
-	if (find_mute_led_gpio(codec))
+	if (find_mute_led_gpio(codec, 1))
 		snd_printd("mute LED gpio %d polarity %d\n",
 				spec->gpio_led,
 				spec->gpio_led_polarity);