aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/hda_auto_parser.c15
-rw-r--r--sound/pci/hda/hda_local.h1
-rw-r--r--sound/pci/hda/patch_realtek.c18
3 files changed, 25 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index e5b20219d850..55ed857a7922 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -655,6 +655,13 @@ void snd_hda_apply_pincfgs(struct hda_codec *codec,
655} 655}
656EXPORT_SYMBOL_HDA(snd_hda_apply_pincfgs); 656EXPORT_SYMBOL_HDA(snd_hda_apply_pincfgs);
657 657
658static void set_pin_targets(struct hda_codec *codec,
659 const struct hda_pintbl *cfg)
660{
661 for (; cfg->nid; cfg++)
662 snd_hda_set_pin_ctl_cache(codec, cfg->nid, cfg->val);
663}
664
658void snd_hda_apply_fixup(struct hda_codec *codec, int action) 665void snd_hda_apply_fixup(struct hda_codec *codec, int action)
659{ 666{
660 int id = codec->fixup_id; 667 int id = codec->fixup_id;
@@ -694,6 +701,14 @@ void snd_hda_apply_fixup(struct hda_codec *codec, int action)
694 codec->chip_name, modelname); 701 codec->chip_name, modelname);
695 fix->v.func(codec, fix, action); 702 fix->v.func(codec, fix, action);
696 break; 703 break;
704 case HDA_FIXUP_PINCTLS:
705 if (action != HDA_FIXUP_ACT_PROBE || !fix->v.pins)
706 break;
707 snd_printdd(KERN_INFO SFX
708 "%s: Apply pinctl for %s\n",
709 codec->chip_name, modelname);
710 set_pin_targets(codec, fix->v.pins);
711 break;
697 default: 712 default:
698 snd_printk(KERN_ERR SFX 713 snd_printk(KERN_ERR SFX
699 "%s: Invalid fixup type %d\n", 714 "%s: Invalid fixup type %d\n",
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index aa721aa1921a..c09440dd5bfa 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -422,6 +422,7 @@ enum {
422 HDA_FIXUP_PINS, 422 HDA_FIXUP_PINS,
423 HDA_FIXUP_VERBS, 423 HDA_FIXUP_VERBS,
424 HDA_FIXUP_FUNC, 424 HDA_FIXUP_FUNC,
425 HDA_FIXUP_PINCTLS,
425}; 426};
426 427
427/* fixup action definitions */ 428/* fixup action definitions */
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7a4b78376303..c8fcfa830778 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1794,9 +1794,9 @@ static const struct hda_fixup alc882_fixups[] = {
1794 } 1794 }
1795 }, 1795 },
1796 [ALC882_FIXUP_PB_M5210] = { 1796 [ALC882_FIXUP_PB_M5210] = {
1797 .type = HDA_FIXUP_VERBS, 1797 .type = HDA_FIXUP_PINCTLS,
1798 .v.verbs = (const struct hda_verb[]) { 1798 .v.pins = (const struct hda_pintbl[]) {
1799 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, 1799 { 0x19, PIN_VREF50 },
1800 {} 1800 {}
1801 } 1801 }
1802 }, 1802 },
@@ -2158,9 +2158,9 @@ static const struct hda_fixup alc262_fixups[] = {
2158 } 2158 }
2159 }, 2159 },
2160 [ALC262_FIXUP_LENOVO_3000] = { 2160 [ALC262_FIXUP_LENOVO_3000] = {
2161 .type = HDA_FIXUP_VERBS, 2161 .type = HDA_FIXUP_PINCTLS,
2162 .v.verbs = (const struct hda_verb[]) { 2162 .v.pins = (const struct hda_pintbl[]) {
2163 { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, 2163 { 0x19, PIN_VREF50 },
2164 {} 2164 {}
2165 }, 2165 },
2166 .chained = true, 2166 .chained = true,
@@ -2715,9 +2715,9 @@ enum {
2715 2715
2716static const struct hda_fixup alc269_fixups[] = { 2716static const struct hda_fixup alc269_fixups[] = {
2717 [ALC269_FIXUP_SONY_VAIO] = { 2717 [ALC269_FIXUP_SONY_VAIO] = {
2718 .type = HDA_FIXUP_VERBS, 2718 .type = HDA_FIXUP_PINCTLS,
2719 .v.verbs = (const struct hda_verb[]) { 2719 .v.pins = (const struct hda_pintbl[]) {
2720 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, 2720 {0x19, PIN_VREFGRD},
2721 {} 2721 {}
2722 } 2722 }
2723 }, 2723 },