aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_hwdep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-09-28 14:12:08 -0400
committerTakashi Iwai <tiwai@suse.de>2011-09-28 14:19:16 -0400
commitef940b0403d4ae133c548b01fe64c74fa8a2f0b1 (patch)
treeba205acaabbabe84f5f00a081443a163b7bec878 /sound/pci/hda/hda_hwdep.c
parent27fe48d97291e61e76e87c34c9b89032e70d05c0 (diff)
ALSA: hda - Allow patching with any vendor/subsystem ids
In the ugly real world, there area really broken devices that don't set codec SSID correctly. In such a case, the ID can be random, thus the patching won't work reliably. For applying the patch forcibly to such a device, the driver will skip the vendor and/or subsystem ID checks when zero or a negative number is given in [codec] section. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_hwdep.c')
-rw-r--r--sound/pci/hda/hda_hwdep.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index bf3ced51e0f8..72e5885007cc 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -643,14 +643,14 @@ static inline int strmatch(const char *a, const char *b)
643static void parse_codec_mode(char *buf, struct hda_bus *bus, 643static void parse_codec_mode(char *buf, struct hda_bus *bus,
644 struct hda_codec **codecp) 644 struct hda_codec **codecp)
645{ 645{
646 unsigned int vendorid, subid, caddr; 646 int vendorid, subid, caddr;
647 struct hda_codec *codec; 647 struct hda_codec *codec;
648 648
649 *codecp = NULL; 649 *codecp = NULL;
650 if (sscanf(buf, "%i %i %i", &vendorid, &subid, &caddr) == 3) { 650 if (sscanf(buf, "%i %i %i", &vendorid, &subid, &caddr) == 3) {
651 list_for_each_entry(codec, &bus->codec_list, list) { 651 list_for_each_entry(codec, &bus->codec_list, list) {
652 if (codec->vendor_id == vendorid && 652 if ((vendorid <= 0 || codec->vendor_id == vendorid) &&
653 codec->subsystem_id == subid && 653 (subid <= 0 || codec->subsystem_id == subid) &&
654 codec->addr == caddr) { 654 codec->addr == caddr) {
655 *codecp = codec; 655 *codecp = codec;
656 break; 656 break;