diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-10-06 02:31:29 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-06 02:31:29 -0400 |
commit | f8f25ba3563dab14b1c3ea4d829642b8a61ca5d7 (patch) | |
tree | 813750e4e65b3da482e7173a46b24c4f7f6f1c35 /sound | |
parent | 15870f05e90a365f8022da416e713be0c5024e2f (diff) |
ALSA: hda - Add a workaround for ASUS A7K
ASUS A7K needs additional GPIO1 bit setup; it has to be cleared.
Added a new fixup hook for this laptop so that it works as is.
Refernece: Novell bnc#494309
http://bugzilla.novell.com/show_bug.cgi?id=494309
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 59 |
1 files changed, 48 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c1e05994cc3..901c2999ed6 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1362,7 +1362,7 @@ static void alc_ssid_check(struct hda_codec *codec, | |||
1362 | } | 1362 | } |
1363 | 1363 | ||
1364 | /* | 1364 | /* |
1365 | * Fix-up pin default configurations | 1365 | * Fix-up pin default configurations and add default verbs |
1366 | */ | 1366 | */ |
1367 | 1367 | ||
1368 | struct alc_pincfg { | 1368 | struct alc_pincfg { |
@@ -1370,9 +1370,14 @@ struct alc_pincfg { | |||
1370 | u32 val; | 1370 | u32 val; |
1371 | }; | 1371 | }; |
1372 | 1372 | ||
1373 | static void alc_fix_pincfg(struct hda_codec *codec, | 1373 | struct alc_fixup { |
1374 | const struct alc_pincfg *pins; | ||
1375 | const struct hda_verb *verbs; | ||
1376 | }; | ||
1377 | |||
1378 | static void alc_pick_fixup(struct hda_codec *codec, | ||
1374 | const struct snd_pci_quirk *quirk, | 1379 | const struct snd_pci_quirk *quirk, |
1375 | const struct alc_pincfg **pinfix) | 1380 | const struct alc_fixup *fix) |
1376 | { | 1381 | { |
1377 | const struct alc_pincfg *cfg; | 1382 | const struct alc_pincfg *cfg; |
1378 | 1383 | ||
@@ -1380,9 +1385,14 @@ static void alc_fix_pincfg(struct hda_codec *codec, | |||
1380 | if (!quirk) | 1385 | if (!quirk) |
1381 | return; | 1386 | return; |
1382 | 1387 | ||
1383 | cfg = pinfix[quirk->value]; | 1388 | fix += quirk->value; |
1384 | for (; cfg->nid; cfg++) | 1389 | cfg = fix->pins; |
1385 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | 1390 | if (cfg) { |
1391 | for (; cfg->nid; cfg++) | ||
1392 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | ||
1393 | } | ||
1394 | if (fix->verbs) | ||
1395 | add_verb(codec->spec, fix->verbs); | ||
1386 | } | 1396 | } |
1387 | 1397 | ||
1388 | /* | 1398 | /* |
@@ -9593,11 +9603,13 @@ static struct alc_pincfg alc882_abit_aw9d_pinfix[] = { | |||
9593 | { } | 9603 | { } |
9594 | }; | 9604 | }; |
9595 | 9605 | ||
9596 | static const struct alc_pincfg *alc882_pin_fixes[] = { | 9606 | static const struct alc_fixup alc882_fixups[] = { |
9597 | [PINFIX_ABIT_AW9D_MAX] = alc882_abit_aw9d_pinfix, | 9607 | [PINFIX_ABIT_AW9D_MAX] = { |
9608 | .pins = alc882_abit_aw9d_pinfix | ||
9609 | }, | ||
9598 | }; | 9610 | }; |
9599 | 9611 | ||
9600 | static struct snd_pci_quirk alc882_pinfix_tbl[] = { | 9612 | static struct snd_pci_quirk alc882_fixup_tbl[] = { |
9601 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), | 9613 | SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX), |
9602 | {} | 9614 | {} |
9603 | }; | 9615 | }; |
@@ -9869,7 +9881,7 @@ static int patch_alc882(struct hda_codec *codec) | |||
9869 | board_config = ALC882_AUTO; | 9881 | board_config = ALC882_AUTO; |
9870 | } | 9882 | } |
9871 | 9883 | ||
9872 | alc_fix_pincfg(codec, alc882_pinfix_tbl, alc882_pin_fixes); | 9884 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups); |
9873 | 9885 | ||
9874 | if (board_config == ALC882_AUTO) { | 9886 | if (board_config == ALC882_AUTO) { |
9875 | /* automatic parse from the BIOS config */ | 9887 | /* automatic parse from the BIOS config */ |
@@ -15159,7 +15171,7 @@ static struct snd_pci_quirk alc861vd_cfg_tbl[] = { | |||
15159 | SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), | 15171 | SND_PCI_QUIRK(0x1019, 0xa88d, "Realtek ALC660 demo", ALC660VD_3ST), |
15160 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), | 15172 | SND_PCI_QUIRK(0x103c, 0x30bf, "HP TX1000", ALC861VD_HP), |
15161 | SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), | 15173 | SND_PCI_QUIRK(0x1043, 0x12e2, "Asus z35m", ALC660VD_3ST), |
15162 | SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST), | 15174 | /*SND_PCI_QUIRK(0x1043, 0x1339, "Asus G1", ALC660VD_3ST),*/ /* auto */ |
15163 | SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S), | 15175 | SND_PCI_QUIRK(0x1043, 0x1633, "Asus V1Sn", ALC660VD_ASUS_V1S), |
15164 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), | 15176 | SND_PCI_QUIRK(0x1043, 0x81e7, "ASUS", ALC660VD_3ST_DIG), |
15165 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), | 15177 | SND_PCI_QUIRK(0x10de, 0x03f0, "Realtek ALC660 demo", ALC660VD_3ST), |
@@ -15552,6 +15564,29 @@ static void alc861vd_auto_init(struct hda_codec *codec) | |||
15552 | alc_inithook(codec); | 15564 | alc_inithook(codec); |
15553 | } | 15565 | } |
15554 | 15566 | ||
15567 | enum { | ||
15568 | ALC660VD_FIX_ASUS_GPIO1 | ||
15569 | }; | ||
15570 | |||
15571 | /* reset GPIO1 */ | ||
15572 | static const struct hda_verb alc660vd_fix_asus_gpio1_verbs[] = { | ||
15573 | {0x01, AC_VERB_SET_GPIO_MASK, 0x03}, | ||
15574 | {0x01, AC_VERB_SET_GPIO_DIRECTION, 0x01}, | ||
15575 | {0x01, AC_VERB_SET_GPIO_DATA, 0x01}, | ||
15576 | { } | ||
15577 | }; | ||
15578 | |||
15579 | static const struct alc_fixup alc861vd_fixups[] = { | ||
15580 | [ALC660VD_FIX_ASUS_GPIO1] = { | ||
15581 | .verbs = alc660vd_fix_asus_gpio1_verbs, | ||
15582 | }, | ||
15583 | }; | ||
15584 | |||
15585 | static struct snd_pci_quirk alc861vd_fixup_tbl[] = { | ||
15586 | SND_PCI_QUIRK(0x1043, 0x1339, "ASUS A7-K", ALC660VD_FIX_ASUS_GPIO1), | ||
15587 | {} | ||
15588 | }; | ||
15589 | |||
15555 | static int patch_alc861vd(struct hda_codec *codec) | 15590 | static int patch_alc861vd(struct hda_codec *codec) |
15556 | { | 15591 | { |
15557 | struct alc_spec *spec; | 15592 | struct alc_spec *spec; |
@@ -15573,6 +15608,8 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
15573 | board_config = ALC861VD_AUTO; | 15608 | board_config = ALC861VD_AUTO; |
15574 | } | 15609 | } |
15575 | 15610 | ||
15611 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups); | ||
15612 | |||
15576 | if (board_config == ALC861VD_AUTO) { | 15613 | if (board_config == ALC861VD_AUTO) { |
15577 | /* automatic parse from the BIOS config */ | 15614 | /* automatic parse from the BIOS config */ |
15578 | err = alc861vd_parse_auto_config(codec); | 15615 | err = alc861vd_parse_auto_config(codec); |