ALSA: hda - add ideapad model for Conexant 5051 codec
authorHerton Ronaldo Krzesinski <herton@mandriva.com.br>
Thu, 17 Jun 2010 17:15:06 +0000 (14:15 -0300)
committerTakashi Iwai <tiwai@suse.de>
Thu, 17 Jun 2010 18:37:40 +0000 (20:37 +0200)
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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Documentation/sound/alsa/HD-Audio-Models.txt
sound/pci/hda/patch_conexant.c

index 1d38b0dfba95f6138038716f215991c0f7fd6be9..84e81ad7ba2da9b6037e7f104168e5d7fa1a16dc 100644 (file)
@@ -282,6 +282,7 @@ Conexant 5051
   hp           HP Spartan laptop
   hp-dv6736    HP dv6736
   hp-f700      HP Compaq Presario F700
+  ideapad      Lenovo IdeaPad laptop
   lenovo-x200  Lenovo X200 laptop
   toshiba      Toshiba Satellite M300
 
index 2bf2cb5da956af2f2555dc75f96923ccd1dc51be..54f74191ebca634a429b15450ba772294daadba7 100644 (file)
@@ -1632,6 +1632,11 @@ static void cxt5051_update_speaker(struct hda_codec *codec)
        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 */
@@ -1888,6 +1893,13 @@ static void cxt5051_init_mic_port(struct hda_codec *codec, hda_nid_t nid,
 #endif
 }
 
+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)
 {
@@ -1917,6 +1929,7 @@ enum {
        CXT5051_LENOVO_X200,    /* Lenovo X200 laptop, also used for Advanced Mini Dock 250410 */
        CXT5051_F700,       /* HP Compaq Presario F700 */
        CXT5051_TOSHIBA,        /* Toshiba M300 & co */
+       CXT5051_IDEAPAD,        /* Lenovo IdeaPad Y430 */
        CXT5051_MODELS
 };
 
@@ -1927,6 +1940,7 @@ static const char *cxt5051_models[CXT5051_MODELS] = {
        [CXT5051_LENOVO_X200]   = "lenovo-x200",
        [CXT5051_F700]          = "hp-700",
        [CXT5051_TOSHIBA]       = "toshiba",
+       [CXT5051_IDEAPAD]       = "ideapad",
 };
 
 static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
@@ -1938,6 +1952,7 @@ static struct snd_pci_quirk cxt5051_cfg_tbl[] = {
                      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),
        {}
 };
 
@@ -1999,6 +2014,11 @@ static int patch_cxt5051(struct hda_codec *codec)
                spec->mixers[0] = cxt5051_toshiba_mixers;
                spec->auto_mic = AUTO_MIC_PORTB;
                break;
+       case CXT5051_IDEAPAD:
+               spec->init_verbs[spec->num_init_verbs++] =
+                       cxt5051_ideapad_init_verbs;
+               spec->ideapad = 1;
+               break;
        }
 
        return 0;