summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorTakashi Iwai2010-02-08 15:06:13 +0100
committerTakashi Iwai2010-02-08 15:06:13 +0100
commit07f804495cb08c8fdf16eee8f7d90edce4a3c9c5 (patch)
tree34e5ea6518be3b731d8cfdc77927422ad87c60db /sound/pci/hda/patch_sigmatel.c
parentMerge branch 'fix/hda' into topic/hda (diff)
downloadkernel-qcow2-linux-07f804495cb08c8fdf16eee8f7d90edce4a3c9c5.tar.gz
kernel-qcow2-linux-07f804495cb08c8fdf16eee8f7d90edce4a3c9c5.tar.xz
kernel-qcow2-linux-07f804495cb08c8fdf16eee8f7d90edce4a3c9c5.zip
ALSA: hda - Detect HP mute-LED GPIO setup from GPIO counts
The GPIO pin number for the mute LED control on HP laptops can be determined more easily by checking the number of available GPIO pins of the codec chip. On a small package with up to 3 GPIOs, GPIO 0 is used while GPIO 3 is used for others. This fixes the missing mute GPIO for some HP laptops with new codecs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 834c5980fe5d..39961879c414 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4754,19 +4754,14 @@ static int hp_blike_system(u32 subsystem_id);
static void set_hp_led_gpio(struct hda_codec *codec)
{
struct sigmatel_spec *spec = codec->spec;
- switch (codec->vendor_id) {
- case 0x111d7608:
- /* GPIO 0 */
- spec->gpio_led = 0x01;
- break;
- case 0x111d7600:
- case 0x111d7601:
- case 0x111d7602:
- case 0x111d7603:
- /* GPIO 3 */
- spec->gpio_led = 0x08;
- break;
- }
+ unsigned int gpio;
+
+ gpio = snd_hda_param_read(codec, codec->afg, AC_PAR_GPIO_CAP);
+ gpio &= AC_GPIO_IO_COUNT;
+ if (gpio > 3)
+ spec->gpio_led = 0x08; /* GPIO 3 */
+ else
+ spec->gpio_led = 0x01; /* GPIO 0 */
}
/*