]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/alsa-post-ga-hda-stac-92hd-hp-fixes
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / alsa-post-ga-hda-stac-92hd-hp-fixes
CommitLineData
82094b55
AF
1From: Takashi Iwai <tiwai@suse.de>
2Subject: ALSA: Fix IDT92HDxx codec parser for new HP laptops
3Patch-mainline: 2.6.32-rc1
4References: bnc#532598, bnc#534202, bnc#534214
5
6Backport fixes for IDT 92HD7x and 92HD8x codecs for new HP laptops
7(and some Dell ones).
8
9Signed-off-by: Takashi Iwai <tiwai@suse.de>
10
11---
12 sound/pci/hda/patch_sigmatel.c | 65 +++++++++++++++++++++--------------------
13 1 file changed, 34 insertions(+), 31 deletions(-)
14
15--- a/sound/pci/hda/patch_sigmatel.c
16+++ b/sound/pci/hda/patch_sigmatel.c
17@@ -770,10 +770,6 @@
18 };
19
20 static struct hda_verb stac92hd83xxx_core_init[] = {
21- { 0xa, AC_VERB_SET_CONNECT_SEL, 0x1},
22- { 0xb, AC_VERB_SET_CONNECT_SEL, 0x1},
23- { 0xd, AC_VERB_SET_CONNECT_SEL, 0x0},
24-
25 /* power state controls amps */
26 { 0x01, AC_VERB_SET_EAPD, 1 << 2},
27 {}
28@@ -1403,8 +1399,8 @@
29 };
30
31 static unsigned int dell_s14_pin_configs[10] = {
32- 0x02214030, 0x02211010, 0x02a19020, 0x01014050,
33- 0x40f000f0, 0x01819040, 0x40f000f0, 0x90a60160,
34+ 0x0221403f, 0x0221101f, 0x02a19020, 0x90170110,
35+ 0x40f000f0, 0x40f000f0, 0x40f000f0, 0x90a60160,
36 0x40f000f0, 0x40f000f0,
37 };
38
39@@ -1503,6 +1499,8 @@
40 "HP mini 1000", STAC_HP_M4),
41 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361b,
42 "HP HDX", STAC_HP_HDX), /* HDX16 */
43+ SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620,
44+ "HP dv6", STAC_HP_DV5),
45 SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010,
46 "HP", STAC_HP_DV5),
47 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
48@@ -3944,7 +3942,10 @@
49 stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0],
50 AC_PINCTL_OUT_EN);
51 /* fake event to set up pins */
52- stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
53+ if (cfg->hp_pins[0])
54+ stac_issue_unsol_event(codec, cfg->hp_pins[0]);
55+ else if (cfg->line_out_pins[0])
56+ stac_issue_unsol_event(codec, cfg->line_out_pins[0]);
57 } else {
58 stac92xx_auto_init_multi_out(codec);
59 stac92xx_auto_init_hp_out(codec);
60@@ -4374,8 +4375,13 @@
61 snd_hda_codec_resume_amp(codec);
62 snd_hda_codec_resume_cache(codec);
63 /* fake event to set up pins again to override cached values */
64- if (spec->hp_detect)
65- stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
66+ if (spec->hp_detect) {
67+ if (spec->autocfg.hp_pins[0])
68+ stac_issue_unsol_event(codec, spec->autocfg.hp_pins[0]);
69+ else if (spec->autocfg.line_out_pins[0])
70+ stac_issue_unsol_event(codec,
71+ spec->autocfg.line_out_pins[0]);
72+ }
73 return 0;
74 }
75
76@@ -4708,7 +4714,7 @@
77 spec->eapd_switch = 1;
78 break;
79 }
80- if (spec->board_config > STAC_92HD73XX_REF) {
81+ if (spec->board_config != STAC_92HD73XX_REF) {
82 /* GPIO0 High = Enable EAPD */
83 spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x1;
84 spec->gpio_data = 0x01;
85@@ -4756,7 +4762,6 @@
86
87 codec->spec = spec;
88 codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
89- spec->mono_nid = 0x19;
90 spec->digbeep_nid = 0x21;
91 spec->mux_nids = stac92hd83xxx_mux_nids;
92 spec->num_muxes = ARRAY_SIZE(stac92hd83xxx_mux_nids);
93@@ -4944,7 +4949,7 @@
94 stac92xx_set_config_regs(codec);
95 }
96
97- if (spec->board_config > STAC_92HD71BXX_REF) {
98+ if (spec->board_config != STAC_92HD71BXX_REF) {
99 /* GPIO0 = EAPD */
100 spec->gpio_mask = 0x01;
101 spec->gpio_dir = 0x01;
102@@ -5073,6 +5078,11 @@
103 case STAC_HP_DV5:
104 snd_hda_codec_set_pincfg(codec, 0x0d, 0x90170010);
105 stac92xx_auto_set_pinctl(codec, 0x0d, AC_PINCTL_OUT_EN);
106+ /* HP dv6 gives the headphone pin as a line-out. Thus we
107+ * need to set hp_detect flag here to force to enable HP
108+ * detection.
109+ */
110+ spec->hp_detect = 1;
111 break;
112 case STAC_HP_HDX:
113 spec->num_dmics = 1;
114@@ -5268,14 +5278,17 @@
115 spec->dac_list = stac927x_dac_nids;
116 spec->multiout.dac_nids = spec->dac_nids;
117
118+ if (spec->board_config != STAC_D965_REF) {
119+ /* GPIO0 High = Enable EAPD */
120+ spec->eapd_mask = spec->gpio_mask = 0x01;
121+ spec->gpio_dir = spec->gpio_data = 0x01;
122+ }
123+
124 switch (spec->board_config) {
125 case STAC_D965_3ST:
126 case STAC_D965_5ST:
127 /* GPIO0 High = Enable EAPD */
128- spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x01;
129- spec->gpio_data = 0x01;
130 spec->num_dmics = 0;
131-
132 spec->init = d965_core_init;
133 break;
134 case STAC_DELL_BIOS:
135@@ -5294,16 +5307,11 @@
136 snd_hda_codec_set_pincfg(codec, 0x0e, 0x02a79130);
137 /* fallthru */
138 case STAC_DELL_3ST:
139- /* GPIO2 High = Enable EAPD */
140- spec->eapd_mask = spec->gpio_mask = spec->gpio_dir = 0x04;
141- spec->gpio_data = 0x04;
142- switch (codec->subsystem_id) {
143- case 0x1028022f:
144- /* correct EAPD to be GPIO0 */
145- spec->eapd_mask = spec->gpio_mask = 0x01;
146- spec->gpio_dir = spec->gpio_data = 0x01;
147- break;
148- };
149+ if (codec->subsystem_id != 0x1028022f) {
150+ /* GPIO2 High = Enable EAPD */
151+ spec->eapd_mask = spec->gpio_mask = 0x04;
152+ spec->gpio_dir = spec->gpio_data = 0x04;
153+ }
154 spec->dmic_nids = stac927x_dmic_nids;
155 spec->num_dmics = STAC927X_NUM_DMICS;
156
157@@ -5312,14 +5320,9 @@
158 spec->num_dmuxes = ARRAY_SIZE(stac927x_dmux_nids);
159 break;
160 default:
161- if (spec->board_config > STAC_D965_REF) {
162- /* GPIO0 High = Enable EAPD */
163- spec->eapd_mask = spec->gpio_mask = 0x01;
164- spec->gpio_dir = spec->gpio_data = 0x01;
165- }
166 spec->num_dmics = 0;
167-
168 spec->init = stac927x_core_init;
169+ break;
170 }
171
172 spec->num_caps = STAC927X_NUM_CAPS;