]> err.no Git - linux-2.6/commitdiff
[ALSA] hda-codec - Add Thinkpad X60/T60/Z60 support
authorTakashi Iwai <tiwai@suse.de>
Tue, 18 Apr 2006 10:54:11 +0000 (12:54 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 22 Jun 2006 19:32:44 +0000 (21:32 +0200)
Added the support for Thinkpad X60/T60/Z60 laptops with AD1981HD codec.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Documentation/sound/alsa/ALSA-Configuration.txt
sound/pci/hda/patch_analog.c

index 0ee2c7dfc4829cd0a4bd1374dd27aeb213a79a16..3c09d9b8cd30a00f97b48241b7108be537d64145 100644 (file)
@@ -778,6 +778,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
        AD1981
          basic         3-jack (default)
          hp            HP nx6320
+         thinkpad      Lenovo Thinkpad T60/X60/Z60
 
        AD1986A
          6stack        6-jack, separate surrounds (default)
index 40f000ba136269776ae1583ad0e9cea1555ce54a..8ddae0a25ea33316149983d0680b9bd0742ccc78 100644 (file)
@@ -1329,13 +1329,50 @@ static int ad1981_hp_init(struct hda_codec *codec)
        return 0;
 }
 
+/* configuration for Lenovo Thinkpad T60 */
+static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = {
+       HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Master Playback Switch", 0x05, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("PCM Playback Volume", 0x11, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("PCM Playback Switch", 0x11, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Mic Playback Volume", 0x12, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Mic Playback Switch", 0x12, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("CD Playback Volume", 0x1d, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("CD Playback Switch", 0x1d, 0x0, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Mic Boost", 0x08, 0x0, HDA_INPUT),
+       HDA_CODEC_VOLUME("Capture Volume", 0x15, 0x0, HDA_OUTPUT),
+       HDA_CODEC_MUTE("Capture Switch", 0x15, 0x0, HDA_OUTPUT),
+       {
+               .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+               .name = "Capture Source",
+               .info = ad198x_mux_enum_info,
+               .get = ad198x_mux_enum_get,
+               .put = ad198x_mux_enum_put,
+       },
+       { } /* end */
+};
+
+static struct hda_input_mux ad1981_thinkpad_capture_source = {
+       .num_items = 3,
+       .items = {
+               { "Mic", 0x0 },
+               { "Mix", 0x2 },
+               { "CD", 0x4 },
+       },
+};
+
 /* models */
-enum { AD1981_BASIC, AD1981_HP };
+enum { AD1981_BASIC, AD1981_HP, AD1981_THINKPAD };
 
 static struct hda_board_config ad1981_cfg_tbl[] = {
        { .modelname = "hp", .config = AD1981_HP },
        /* All HP models */
        { .pci_subvendor = 0x103c, .config = AD1981_HP },
+       { .modelname = "thinkpad", .config = AD1981_THINKPAD },
+       /* Lenovo Thinkpad T60/X60/Z6xx */
+       { .pci_subvendor = 0x17aa, .config = AD1981_THINKPAD },
+       { .pci_subvendor = 0x1014, .pci_subsystem = 0x0597,
+         .config = AD1981_THINKPAD }, /* Z60m/t */
        { .modelname = "basic", .config = AD1981_BASIC },
        {}
 };
@@ -1381,6 +1418,11 @@ static int patch_ad1981(struct hda_codec *codec)
                codec->patch_ops.init = ad1981_hp_init;
                codec->patch_ops.unsol_event = ad1981_hp_unsol_event;
                break;
+       case AD1981_THINKPAD:
+               spec->mixers[0] = ad1981_thinkpad_mixers;
+               spec->multiout.dig_out_nid = 0;
+               spec->input_mux = &ad1981_thinkpad_capture_source;
+               break;
        }
 
        return 0;