Skip to content

Commit

Permalink
ALSA: hda/realtek - Add more codecs alias name for Dell
Browse files Browse the repository at this point in the history
Dell assigned alias name for more codecs.
ALC3220 ALC3221 ALC3223 ALC3226 ALC3234 ALC3661.

Signed-off-by: Kailang Yang <kailang@realtek.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Kailang Yang authored and Takashi Iwai committed Nov 29, 2013
1 parent 696620a commit 4b01693
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ static int alc_codec_rename(struct hda_codec *codec, const char *name)
}

/*
* Rename codecs appropriately from COEF value
* Rename codecs appropriately from COEF value or subvendor id
*/
struct alc_codec_rename_table {
unsigned int vendor_id;
Expand All @@ -912,6 +912,13 @@ struct alc_codec_rename_table {
const char *name;
};

struct alc_codec_rename_pci_table {
unsigned int codec_vendor_id;
unsigned short pci_subvendor;
unsigned short pci_subdevice;
const char *name;
};

static struct alc_codec_rename_table rename_tbl[] = {
{ 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
{ 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
Expand All @@ -931,16 +938,38 @@ static struct alc_codec_rename_table rename_tbl[] = {
{ } /* terminator */
};

static struct alc_codec_rename_pci_table rename_pci_tbl[] = {
{ 0x10ec0280, 0x1028, 0, "ALC3220" },
{ 0x10ec0282, 0x1028, 0, "ALC3221" },
{ 0x10ec0283, 0x1028, 0, "ALC3223" },
{ 0x10ec0292, 0x1028, 0, "ALC3226" },
{ 0x10ec0255, 0x1028, 0, "ALC3234" },
{ 0x10ec0668, 0x1028, 0, "ALC3661" },
{ } /* terminator */
};

static int alc_codec_rename_from_preset(struct hda_codec *codec)
{
const struct alc_codec_rename_table *p;
const struct alc_codec_rename_pci_table *q;

for (p = rename_tbl; p->vendor_id; p++) {
if (p->vendor_id != codec->vendor_id)
continue;
if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
return alc_codec_rename(codec, p->name);
}

for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
if (q->codec_vendor_id != codec->vendor_id)
continue;
if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
continue;
if (!q->pci_subdevice ||
q->pci_subdevice == codec->bus->pci->subsystem_device)
return alc_codec_rename(codec, q->name);
}

return 0;
}

Expand Down

0 comments on commit 4b01693

Please sign in to comment.