diff options
author | Takashi Iwai <tiwai@suse.de> | 2013-01-15 05:12:18 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-15 05:12:18 -0500 |
commit | 89bb3e74b1acb7c26306a5aaa522eb7105c25f65 (patch) | |
tree | e90fc12f2f013490a274d6e196a98b65cd5e37e7 /sound/pci/hda/patch_sigmatel.c | |
parent | 372f8c75025673713ed94f976f9bde8a744d2e47 (diff) |
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: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r-- | sound/pci/hda/patch_sigmatel.c | 83 |
1 files changed, 40 insertions, 43 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index fa16ff79866c..3368f74811ce 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -6219,53 +6219,50 @@ static int find_mute_led_cfg(struct hda_codec *codec, int default_polarity) | |||
6219 | return 1; | 6219 | return 1; |
6220 | } | 6220 | } |
6221 | 6221 | ||
6222 | if ((codec->subsystem_id >> 16) == PCI_VENDOR_ID_HP) { | 6222 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, NULL, dev))) { |
6223 | while ((dev = dmi_find_device(DMI_DEV_TYPE_OEM_STRING, | 6223 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", |
6224 | NULL, dev))) { | 6224 | &spec->gpio_led_polarity, |
6225 | if (sscanf(dev->name, "HP_Mute_LED_%d_%x", | 6225 | &spec->gpio_led) == 2) { |
6226 | &spec->gpio_led_polarity, | 6226 | unsigned int max_gpio; |
6227 | &spec->gpio_led) == 2) { | 6227 | max_gpio = snd_hda_param_read(codec, codec->afg, |
6228 | unsigned int max_gpio; | 6228 | AC_PAR_GPIO_CAP); |
6229 | max_gpio = snd_hda_param_read(codec, codec->afg, | 6229 | max_gpio &= AC_GPIO_IO_COUNT; |
6230 | AC_PAR_GPIO_CAP); | 6230 | if (spec->gpio_led < max_gpio) |
6231 | max_gpio &= AC_GPIO_IO_COUNT; | 6231 | spec->gpio_led = 1 << spec->gpio_led; |
6232 | if (spec->gpio_led < max_gpio) | 6232 | else |
6233 | spec->gpio_led = 1 << spec->gpio_led; | 6233 | spec->vref_mute_led_nid = spec->gpio_led; |
6234 | else | 6234 | return 1; |
6235 | spec->vref_mute_led_nid = spec->gpio_led; | ||
6236 | return 1; | ||
6237 | } | ||
6238 | if (sscanf(dev->name, "HP_Mute_LED_%d", | ||
6239 | &spec->gpio_led_polarity) == 1) { | ||
6240 | set_hp_led_gpio(codec); | ||
6241 | return 1; | ||
6242 | } | ||
6243 | /* BIOS bug: unfilled OEM string */ | ||
6244 | if (strstr(dev->name, "HP_Mute_LED_P_G")) { | ||
6245 | set_hp_led_gpio(codec); | ||
6246 | switch (codec->subsystem_id) { | ||
6247 | case 0x103c148a: | ||
6248 | spec->gpio_led_polarity = 0; | ||
6249 | break; | ||
6250 | default: | ||
6251 | spec->gpio_led_polarity = 1; | ||
6252 | break; | ||
6253 | } | ||
6254 | return 1; | ||
6255 | } | ||
6256 | } | 6235 | } |
6257 | 6236 | if (sscanf(dev->name, "HP_Mute_LED_%d", | |
6258 | /* | 6237 | &spec->gpio_led_polarity) == 1) { |
6259 | * Fallback case - if we don't find the DMI strings, | ||
6260 | * we statically set the GPIO - if not a B-series system | ||
6261 | * and default polarity is provided | ||
6262 | */ | ||
6263 | if (!hp_blike_system(codec->subsystem_id) && | ||
6264 | (default_polarity == 0 || default_polarity == 1)) { | ||
6265 | set_hp_led_gpio(codec); | 6238 | set_hp_led_gpio(codec); |
6266 | spec->gpio_led_polarity = default_polarity; | ||
6267 | return 1; | 6239 | return 1; |
6268 | } | 6240 | } |
6241 | /* BIOS bug: unfilled OEM string */ | ||
6242 | if (strstr(dev->name, "HP_Mute_LED_P_G")) { | ||
6243 | set_hp_led_gpio(codec); | ||
6244 | switch (codec->subsystem_id) { | ||
6245 | case 0x103c148a: | ||
6246 | spec->gpio_led_polarity = 0; | ||
6247 | break; | ||
6248 | default: | ||
6249 | spec->gpio_led_polarity = 1; | ||
6250 | break; | ||
6251 | } | ||
6252 | return 1; | ||
6253 | } | ||
6254 | } | ||
6255 | |||
6256 | /* | ||
6257 | * Fallback case - if we don't find the DMI strings, | ||
6258 | * we statically set the GPIO - if not a B-series system | ||
6259 | * and default polarity is provided | ||
6260 | */ | ||
6261 | if (!hp_blike_system(codec->subsystem_id) && | ||
6262 | (default_polarity == 0 || default_polarity == 1)) { | ||
6263 | set_hp_led_gpio(codec); | ||
6264 | spec->gpio_led_polarity = default_polarity; | ||
6265 | return 1; | ||
6269 | } | 6266 | } |
6270 | return 0; | 6267 | return 0; |
6271 | } | 6268 | } |