]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.drivers/alsa-post-ga-lenovo-x200-quirk
Changed checkfs to auto reboot after correctable fsck fixes.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.drivers / alsa-post-ga-lenovo-x200-quirk
1 From 27e089888fb1a3d1d13892262f9d522b03985044 Mon Sep 17 00:00:00 2001
2 From: Aristeu Sergio Rozanski Filho <aris@ruivo.org>
3 Date: Thu, 12 Feb 2009 17:50:37 -0500
4 Subject: ALSA: hda: add quirk for Lenovo X200 laptop dock
5 Patch-mainline:
6 References: bnc#480753
7
8 Currently the HP connector on X200 dock doesn't detect when a HP is connected
9 nor allows sound to be played using it. This patch fixes the problem by adding
10 a quirk for this specific model. It's possible that others have the same NID
11 (0x19) to report when dock HP is connected, but I don't have access to any.
12 Please Cc me in the reply since I'm not subscribed to alsa-devel@.
13
14 Signed-off-by: Aristeu Rozanski <aris@redhat.com>
15 Signed-off-by: Takashi Iwai <tiwai@suse.de>
16
17 ---
18 Documentation/sound/alsa/ALSA-Configuration.txt | 1
19 sound/pci/hda/patch_conexant.c | 40 ++++++++++++++++++++++++
20 2 files changed, 41 insertions(+)
21
22 --- a/Documentation/sound/alsa/ALSA-Configuration.txt
23 +++ b/Documentation/sound/alsa/ALSA-Configuration.txt
24 @@ -1016,6 +1016,7 @@
25 Conexant 5051
26 laptop Basic Laptop config (default)
27 hp HP Spartan laptop
28 + lenovo-x200 Lenovo X200 laptop
29
30 STAC9200
31 ref Reference board
32 --- a/sound/pci/hda/patch_conexant.c
33 +++ b/sound/pci/hda/patch_conexant.c
34 @@ -1702,6 +1702,40 @@
35 { } /* end */
36 };
37
38 +static struct hda_verb cxt5051_lenovo_x200_init_verbs[] = {
39 + /* Line in, Mic */
40 + {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03},
41 + {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
42 + {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03},
43 + {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
44 + {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
45 + {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03},
46 + /* SPK */
47 + {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
48 + {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
49 + /* HP, Amp */
50 + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
51 + {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
52 + /* Docking HP */
53 + {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
54 + {0x19, AC_VERB_SET_CONNECT_SEL, 0x00},
55 + /* DAC1 */
56 + {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
57 + /* Record selector: Int mic */
58 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
59 + {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44},
60 + {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
61 + /* SPDIF route: PCM */
62 + {0x1c, AC_VERB_SET_CONNECT_SEL, 0x0},
63 + /* EAPD */
64 + {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
65 + {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT},
66 + {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT},
67 + {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTC_EVENT},
68 + {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT},
69 + { } /* end */
70 +};
71 +
72 /* initialize jack-sensing, too */
73 static int cxt5051_init(struct hda_codec *codec)
74 {
75 @@ -1718,18 +1752,21 @@
76 enum {
77 CXT5051_LAPTOP, /* Laptops w/ EAPD support */
78 CXT5051_HP, /* no docking */
79 + CXT5051_LENOVO_X200, /* Lenovo X200 laptop */
80 CXT5051_MODELS
81 };
82
83 static const char *cxt5051_models[CXT5051_MODELS] = {
84 [CXT5051_LAPTOP] = "laptop",
85 [CXT5051_HP] = "hp",
86 + [CXT5051_LENOVO_X200] = "lenovo-x200",
87 };
88
89 static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
90 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board",
91 CXT5051_LAPTOP),
92 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP),
93 + SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT5051_LENOVO_X200),
94 {}
95 };
96
97 @@ -1770,6 +1807,9 @@
98 codec->patch_ops.unsol_event = cxt5051_hp_unsol_event;
99 spec->mixers[0] = cxt5051_hp_mixers;
100 break;
101 + case CXT5051_LENOVO_X200:
102 + spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs;
103 + /* fallthru */
104 default:
105 case CXT5051_LAPTOP:
106 codec->patch_ops.unsol_event = cxt5051_hp_unsol_event;