ALSA: hda-intel: add ideapad model for Conexant 5051 Lenovo IdeaPad Y430 has an additional subwoofer connected at pin 0x1b, which isn't muted when headphone is plugged in. This adds additional support to the extra subwoofer via new ideapad model. Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br> --- Documentation/sound/alsa/HD-Audio-Models.txt | 1 + sound/pci/hda/patch_conexant.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff -p -up linux-2.6.33.5-1mnb/Documentation/sound/alsa/HD-Audio-Models.txt.orig linux-2.6.33.5-1mnb/Documentation/sound/alsa/HD-Audio-Models.txt --- linux-2.6.33.5-1mnb/Documentation/sound/alsa/HD-Audio-Models.txt.orig 2010-06-12 02:46:58.941716965 -0300 +++ linux-2.6.33.5-1mnb/Documentation/sound/alsa/HD-Audio-Models.txt 2010-06-12 02:47:51.760719829 -0300 @@ -280,6 +280,7 @@ Conexant 5051 hp HP Spartan laptop hp-dv6736 HP dv6736 lenovo-x200 Lenovo X200 laptop + ideapad Lenovo IdeaPad laptop Conexant 5066 ============= diff -p -up linux-2.6.33.5-1mnb/sound/pci/hda/patch_conexant.c.orig linux-2.6.33.5-1mnb/sound/pci/hda/patch_conexant.c --- linux-2.6.33.5-1mnb/sound/pci/hda/patch_conexant.c.orig 2010-06-12 02:32:46.968489908 -0300 +++ linux-2.6.33.5-1mnb/sound/pci/hda/patch_conexant.c 2010-06-12 02:46:36.335486975 -0300 @@ -113,6 +113,7 @@ struct conexant_spec { unsigned int port_d_mode; unsigned char ext_mic_bias; unsigned int dell_vostro; + unsigned int ideapad; }; static int conexant_playback_pcm_open(struct hda_pcm_stream *hinfo, @@ -1605,6 +1606,11 @@ static void cxt5051_update_speaker(struc pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl); + /* on ideapad there is an aditional speaker (subwoofer) to mute */ + if (spec->ideapad) + snd_hda_codec_write(codec, 0x1b, 0, + AC_VERB_SET_PIN_WIDGET_CONTROL, + pinctl); } /* turn on/off EAPD (+ mute HP) as a master switch */ @@ -1830,6 +1836,13 @@ static struct hda_verb cxt5051_lenovo_x2 { } /* end */ }; +static struct hda_verb cxt5051_ideapad_init_verbs[] = { + /* Subwoofer */ + {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT}, + {0x1b, AC_VERB_SET_CONNECT_SEL, 0x00}, + { } /* end */ +}; + /* initialize jack-sensing, too */ static int cxt5051_init(struct hda_codec *codec) { @@ -1849,6 +1862,7 @@ enum { CXT5051_HP, /* no docking */ CXT5051_HP_DV6736, /* HP without mic switch */ CXT5051_LENOVO_X200, /* Lenovo X200 laptop */ + CXT5051_IDEAPAD, /* Lenovo IdeaPad Y430 */ CXT5051_MODELS }; @@ -1857,6 +1871,7 @@ static const char *cxt5051_models[CXT505 [CXT5051_HP] = "hp", [CXT5051_HP_DV6736] = "hp-dv6736", [CXT5051_LENOVO_X200] = "lenovo-x200", + [CXT5051_IDEAPAD] = "ideapad", }; static struct snd_pci_quirk cxt5051_cfg_tbl[] = { @@ -1866,6 +1881,7 @@ static struct snd_pci_quirk cxt5051_cfg_ CXT5051_LAPTOP), SND_PCI_QUIRK(0x14f1, 0x5051, "HP Spartan 1.1", CXT5051_HP), SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo X200", CXT5051_LENOVO_X200), + SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo IdeaPad", CXT5051_IDEAPAD), {} }; @@ -1916,6 +1932,11 @@ static int patch_cxt5051(struct hda_code case CXT5051_LENOVO_X200: spec->init_verbs[0] = cxt5051_lenovo_x200_init_verbs; break; + case CXT5051_IDEAPAD: + spec->init_verbs[spec->num_init_verbs++] = + cxt5051_ideapad_init_verbs; + spec->ideapad = 1; + break; } return 0;