Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 216723
b: refs/heads/master
c: 9062291
h: refs/heads/master
i:
  216721: 9413c71
  216719: 18dc363
v: v3
  • Loading branch information
David Henningsson authored and Takashi Iwai committed Oct 17, 2010
1 parent 7a57079 commit c7443b1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2df03514de41f3bbb5623f2e7f2bf594e49cb2ec
refs/heads/master: 906229174c20e3d5cbda8da070af8f30196316c3
35 changes: 33 additions & 2 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ struct alc_customize_define {
unsigned int platform_type:1;
unsigned int swap:1;
unsigned int override:1;
unsigned int fixup:1; /* Means that this sku is set by driver, not read from hw */
};

struct alc_spec {
Expand Down Expand Up @@ -1464,6 +1465,11 @@ static void alc_init_auto_mic(struct hda_codec *codec)
spec->unsol_event = alc_sku_unsol_event;
}

/* Could be any non-zero and even value. When used as fixup, tells
* the driver to ignore any present sku defines.
*/
#define ALC_FIXUP_SKU_IGNORE (2)

static int alc_auto_parse_customize_define(struct hda_codec *codec)
{
unsigned int ass, tmp, i;
Expand All @@ -1472,6 +1478,13 @@ static int alc_auto_parse_customize_define(struct hda_codec *codec)

spec->cdefine.enable_pcbeep = 1; /* assume always enabled */

if (spec->cdefine.fixup) {
ass = spec->cdefine.sku_cfg;
if (ass == ALC_FIXUP_SKU_IGNORE)
return -1;
goto do_sku;
}

ass = codec->subsystem_id & 0xffff;
if (ass != codec->bus->pci->subsystem_device && (ass & 1))
goto do_sku;
Expand Down Expand Up @@ -1539,6 +1552,13 @@ static int alc_subsystem_id(struct hda_codec *codec,
unsigned nid;
struct alc_spec *spec = codec->spec;

if (spec->cdefine.fixup) {
ass = spec->cdefine.sku_cfg;
if (ass == ALC_FIXUP_SKU_IGNORE)
return 0;
goto do_sku;
}

ass = codec->subsystem_id & 0xffff;
if ((ass != codec->bus->pci->subsystem_device) && (ass & 1))
goto do_sku;
Expand Down Expand Up @@ -1658,6 +1678,7 @@ struct alc_pincfg {
};

struct alc_fixup {
unsigned int sku;
const struct alc_pincfg *pins;
const struct hda_verb *verbs;
};
Expand All @@ -1668,12 +1689,22 @@ static void alc_pick_fixup(struct hda_codec *codec,
int pre_init)
{
const struct alc_pincfg *cfg;
struct alc_spec *spec;

quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
if (!quirk)
return;
fix += quirk->value;
cfg = fix->pins;
if (pre_init && fix->sku) {
#ifdef CONFIG_SND_DEBUG_VERBOSE
snd_printdd(KERN_INFO "hda_codec: %s: Apply sku override for %s\n",
codec->chip_name, quirk->name);
#endif
spec = codec->spec;
spec->cdefine.sku_cfg = fix->sku;
spec->cdefine.fixup = 1;
}
if (pre_init && cfg) {
#ifdef CONFIG_SND_DEBUG_VERBOSE
snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n",
Expand Down Expand Up @@ -10861,8 +10892,6 @@ static int patch_alc882(struct hda_codec *codec)

codec->spec = spec;

alc_auto_parse_customize_define(codec);

switch (codec->vendor_id) {
case 0x10ec0882:
case 0x10ec0885:
Expand Down Expand Up @@ -10890,6 +10919,8 @@ static int patch_alc882(struct hda_codec *codec)
if (board_config == ALC882_AUTO)
alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1);

alc_auto_parse_customize_define(codec);

if (board_config == ALC882_AUTO) {
/* automatic parse from the BIOS config */
err = alc882_parse_auto_config(codec);
Expand Down

0 comments on commit c7443b1

Please sign in to comment.