Commit 89bb3e74 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda/sigmatel - Remove PCI id check in find_mute_led_cfg()

The PCI vendor ID check in find_mute_led_cfg() is now superfluous
because the function is called in the fixup table entries of HP
machines.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 372f8c75
...@@ -6219,53 +6219,50 @@ static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) ...@@ -6219,53 +6219,50 @@ static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity)
return 1; return 1;
} }
if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) { while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) {
while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, if (sscanf(dev->name, "HP_Mute_LED_%d_%x",
NULL, dev))) { &spec->gpio_led_polarity,
if (sscanf(dev->name, "HP_Mute_LED_%d_%x", &spec->gpio_led) == 2) {
&spec->gpio_led_polarity, unsigned int max_gpio;
&spec->gpio_led) == 2) { max_gpio = snd_hda_param_read(codec, codec->afg,
unsigned int max_gpio; AC_PAR_GPIO_CAP);
max_gpio = snd_hda_param_read(codec, codec->afg, max_gpio &= AC_GPIO_IO_COUNT;
AC_PAR_GPIO_CAP); if (spec->gpio_led < max_gpio)
max_gpio &= AC_GPIO_IO_COUNT; spec->gpio_led = 1 << spec->gpio_led;
if (spec->gpio_led < max_gpio) else
spec->gpio_led = 1 << spec->gpio_led; spec->vref_mute_led_nid = spec->gpio_led;
else return 1;
spec->vref_mute_led_nid = spec->gpio_led;
return 1;
}
if (sscanf(dev->name, "HP_Mute_LED_%d",
&spec->gpio_led_polarity) == 1) {
set_hp_led_gpio(codec);
return 1;
}
/* BIOS bug: unfilled OEM string */
if (strstr(dev->name, "HP_Mute_LED_P_G")) {
set_hp_led_gpio(codec);
switch (codec->subsystem_id) {
case 0x103c148a:
spec->gpio_led_polarity = 0;
break;
default:
spec->gpio_led_polarity = 1;
break;
}
return 1;
}
} }
if (sscanf(dev->name, "HP_Mute_LED_%d",
/* &spec->gpio_led_polarity) == 1) {
* Fallback case - if we don't find the DMI strings,
* we statically set the GPIO - if not a B-series system
* and default polarity is provided
*/
if (!hp_blike_system(codec->subsystem_id) &&
(default_polarity == 0 || default_polarity == 1)) {
set_hp_led_gpio(codec); set_hp_led_gpio(codec);
spec->gpio_led_polarity = default_polarity;
return 1; return 1;
} }
/* BIOS bug: unfilled OEM string */
if (strstr(dev->name, "HP_Mute_LED_P_G")) {
set_hp_led_gpio(codec);
switch (codec->subsystem_id) {
case 0x103c148a:
spec->gpio_led_polarity = 0;
break;
default:
spec->gpio_led_polarity = 1;
break;
}
return 1;
}
}
/*
* Fallback case - if we don't find the DMI strings,
* we statically set the GPIO - if not a B-series system
* and default polarity is provided
*/
if (!hp_blike_system(codec->subsystem_id) &&
(default_polarity == 0 || default_polarity == 1)) {
set_hp_led_gpio(codec);
spec->gpio_led_polarity = default_polarity;
return 1;
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment