Skip to content

Commit

Permalink
ALSA: hda - Check subdevice mask in snd_hda_check_board_codec_sid_con…
Browse files Browse the repository at this point in the history
…fig()

In snd_hda_check_board_codec_sid_config(), not only comparing with the
exact value but allow the bit-mask comparison for vendor-only, etc.

Tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Tested-by: Dirk Hohndel <hohndel@infradead.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Nov 23, 2011
1 parent a370fc6 commit e2301a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -4046,9 +4046,9 @@ int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,

/* Search for codec ID */
for (q = tbl; q->subvendor; q++) {
unsigned long vendorid = (q->subdevice) | (q->subvendor << 16);

if (vendorid == codec->subsystem_id)
unsigned int mask = 0xffff0000 | q->subdevice_mask;
unsigned int id = (q->subdevice | (q->subvendor << 16)) & mask;
if ((codec->subsystem_id & mask) == id)
break;
}

Expand Down

0 comments on commit e2301a4

Please sign in to comment.