aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAristeu Sergio Rozanski Filho <aris@ruivo.org>2009-02-12 17:50:37 -0500
committerTakashi Iwai <tiwai@suse.de>2009-02-13 02:40:20 -0500
commit27e089888fb1a3d1d13892262f9d522b03985044 (patch)
treee03566b4cf9ecb4dcf8b322bdc32857f67d50588 /sound
parent8bb0ac5573ff0879fef511e1a80a4a4db0316daa (diff)
ALSA: hda: add quirk for Lenovo X200 laptop dock
Currently the HP connector on X200 dock doesn't detect when a HP is connected nor allows sound to be played using it. This patch fixes the problem by adding a quirk for this specific model. It's possible that others have the same NID (0x19) to report when dock HP is connected, but I don't have access to any. Please Cc me in the reply since I'm not subscribed to alsa-devel@. Signed-off-by: Aristeu Rozanski <aris@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_conexant.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index fdf876be712d..b8de73ecfdeb 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -1798,6 +1798,40 @@ static struct hda_verb cxt5051_init_verbs[] = {
1798 { } /* end */ 1798 { } /* end */
1799}; 1799};
1800 1800
1801static struct hda_verb cxt5051_lenovo_x200_init_verbs[] = {
1802 /* Line in, Mic */
1803 {0x17, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03},
1804 {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1805 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03},
1806 {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
1807 {0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN},
1808 {0x1d, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x03},
1809 /* SPK */
1810 {0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
1811 {0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
1812 /* HP, Amp */
1813 {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1814 {0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
1815 /* Docking HP */
1816 {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
1817 {0x19, AC_VERB_SET_CONNECT_SEL, 0x00},
1818 /* DAC1 */
1819 {0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
1820 /* Record selector: Int mic */
1821 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
1822 {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1) | 0x44},
1823 {0x15, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
1824 /* SPDIF route: PCM */
1825 {0x1c, AC_VERB_SET_CONNECT_SEL, 0x0},
1826 /* EAPD */
1827 {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
1828 {0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT},
1829 {0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT},
1830 {0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTC_EVENT},
1831 {0x19, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT},
1832 { } /* end */
1833};
1834
1801/* initialize jack-sensing, too */ 1835/* initialize jack-sensing, too */
1802static int cxt5051_init(struct hda_codec *codec) 1836static int cxt5051_init(struct hda_codec *codec)
1803{ 1837{
@@ -1815,18 +1849,21 @@ static int cxt5051_init(struct hda_codec *codec)
1815enum { 1849enum {
1816 CXT5051_LAPTOP, /* Laptops w/ EAPD support */ 1850 CXT5051_LAPTOP, /* Laptops w/ EAPD support */
1817 CXT5051_HP, /* no docking */ 1851 CXT5051_HP, /* no docking */
1852 CXT5051_LENOVO_X200, /* Lenovo X200 laptop */
1818 CXT5051_MODELS 1853 CXT5051_MODELS
1819}; 1854};
1820 1855
1821static const char *cxt5051_models[CXT5051_MODELS] = { 1856static const char *cxt5051_models[CXT5051_MODELS] = {
1822 [CXT5051_LAPTOP] = "laptop", 1857 [CXT5051_LAPTOP] = "laptop",
1823 [CXT5051_HP] = "hp", 1858 [CXT5051_HP] = "hp",
1859 [CXT5051_LENOVO_X200] = "lenovo-x200",
1824}; 1860};
1825 1861
1826static struct snd_pci_quirk cxt5051_cfg_tbl[] = { 1862static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
1827 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board", 1863 SND_PCI_QUIRK(0x14f1, 0x0101, "Conexant Reference board",
1828 CXT5051_LAPTOP), 1864 CXT5051_LAPTOP),
1829 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), 1865 SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP),
1866 SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT5051_LENOVO_X200),
1830 {} 1867 {}
1831}; 1868};
1832 1869
@@ -1867,6 +1904,9 @@ static int patch_cxt5051(struct hda_codec *codec)
1867 codec->patch_ops.unsol_event = cxt5051_hp_unsol_event; 1904 codec->patch_ops.unsol_event = cxt5051_hp_unsol_event;
1868 spec->mixers[0] = cxt5051_hp_mixers; 1905 spec->mixers[0] = cxt5051_hp_mixers;
1869 break; 1906 break;
1907 case CXT5051_LENOVO_X200:
1908 spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs;
1909 /* fallthru */
1870 default: 1910 default:
1871 case CXT5051_LAPTOP: 1911 case CXT5051_LAPTOP:
1872 codec->patch_ops.unsol_event = cxt5051_hp_unsol_event; 1912 codec->patch_ops.unsol_event = cxt5051_hp_unsol_event;