From 70cfa72f0c2620225b638eec67386c55bc625f6a Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 10 Jan 2013 10:18:14 +0100 Subject: [PATCH] --- yaml --- r: 353119 b: refs/heads/master c: fd1082159d1445b0306a4696a2aade251ce2fcb2 h: refs/heads/master i: 353117: f94e59df0dd6dede65f119821d62be38d715f2fa 353115: 938bac9f66a538756e69417c3e530c8d692ac6d7 353111: 4e0fed9579eefb303e841ab6e805172d59c82831 353103: cf0a821c5aae07a72deb6f0a741053f1980a8a9b 353087: d7671055a1fb35f13504a41f6b8dd2e93e47cef8 v: v3 --- [refs] | 2 +- trunk/sound/pci/hda/hda_auto_parser.c | 15 +++++++++++++++ trunk/sound/pci/hda/hda_local.h | 1 + trunk/sound/pci/hda/patch_realtek.c | 18 +++++++++--------- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index d733169b6539..75a52882555d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d3f02d60eecfc43088a3cb95d35e0cf75b4b8266 +refs/heads/master: fd1082159d1445b0306a4696a2aade251ce2fcb2 diff --git a/trunk/sound/pci/hda/hda_auto_parser.c b/trunk/sound/pci/hda/hda_auto_parser.c index e5b20219d850..55ed857a7922 100644 --- a/trunk/sound/pci/hda/hda_auto_parser.c +++ b/trunk/sound/pci/hda/hda_auto_parser.c @@ -655,6 +655,13 @@ void snd_hda_apply_pincfgs(struct hda_codec *codec, } EXPORT_SYMBOL_HDA(snd_hda_apply_pincfgs); +static void set_pin_targets(struct hda_codec *codec, + const struct hda_pintbl *cfg) +{ + for (; cfg->nid; cfg++) + snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val); +} + void snd_hda_apply_fixup(struct hda_codec *codec, int action) { int id = codec->fixup_id; @@ -694,6 +701,14 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action) codec->chip_name, modelname); fix->v.func(codec, fix, action); break; + case HDA_FIXUP_PINCTLS: + if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins) + break; + snd_printdd(KERN_INFO SFX + "%s: Apply pinctl for %s\n", + codec->chip_name, modelname); + set_pin_targets(codec, fix->v.pins); + break; default: snd_printk(KERN_ERR SFX "%s: Invalid fixup type %d\n", diff --git a/trunk/sound/pci/hda/hda_local.h b/trunk/sound/pci/hda/hda_local.h index aa721aa1921a..c09440dd5bfa 100644 --- a/trunk/sound/pci/hda/hda_local.h +++ b/trunk/sound/pci/hda/hda_local.h @@ -422,6 +422,7 @@ enum { HDA_FIXUP_PINS, HDA_FIXUP_VERBS, HDA_FIXUP_FUNC, + HDA_FIXUP_PINCTLS, }; /* fixup action definitions */ diff --git a/trunk/sound/pci/hda/patch_realtek.c b/trunk/sound/pci/hda/patch_realtek.c index 7a4b78376303..c8fcfa830778 100644 --- a/trunk/sound/pci/hda/patch_realtek.c +++ b/trunk/sound/pci/hda/patch_realtek.c @@ -1794,9 +1794,9 @@ static const struct hda_fixup alc882_fixups[] = { } }, [ALC882_FIXUP_PB_M5210] = { - .type = HDA_FIXUP_VERBS, - .v.verbs = (const struct hda_verb[]) { - { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, + .type = HDA_FIXUP_PINCTLS, + .v.pins = (const struct hda_pintbl[]) { + { 0x19, PIN_VREF50 }, {} } }, @@ -2158,9 +2158,9 @@ static const struct hda_fixup alc262_fixups[] = { } }, [ALC262_FIXUP_LENOVO_3000] = { - .type = HDA_FIXUP_VERBS, - .v.verbs = (const struct hda_verb[]) { - { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, + .type = HDA_FIXUP_PINCTLS, + .v.pins = (const struct hda_pintbl[]) { + { 0x19, PIN_VREF50 }, {} }, .chained = true, @@ -2715,9 +2715,9 @@ enum { static const struct hda_fixup alc269_fixups[] = { [ALC269_FIXUP_SONY_VAIO] = { - .type = HDA_FIXUP_VERBS, - .v.verbs = (const struct hda_verb[]) { - {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, + .type = HDA_FIXUP_PINCTLS, + .v.pins = (const struct hda_pintbl[]) { + {0x19, PIN_VREFGRD}, {} } },