ALSA: hda - Add support of Toshiba RX1
authorHiroshi Miura <miurahr@acm.org>
Thu, 28 Aug 2008 14:09:06 +0000 (16:09 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 29 Aug 2008 08:06:20 +0000 (10:06 +0200)
Added the support of Toshiba RX1 laptop with ALC262 codec chip.
Related ALSA bug#3386:
    https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3386

Signed-off-by: Hiroshi Miura <miurahr@acm.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Documentation/sound/alsa/ALSA-Configuration.txt
sound/pci/hda/patch_realtek.c

index 374cfc02b2f93a2805e519f31811dee3b7dfbbe9..fd3de679386f54efa43a5340fa48d3f2769b4f4c 100644 (file)
@@ -832,6 +832,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
          hippo_1       Hippo (Benq) with jack detection
          sony-assamd   Sony ASSAMD
          toshiba-s06   Toshiba S06
+         toshiba-rx1   Toshiba RX1
          ultra         Samsung Q1 Ultra Vista model
          lenovo-3000   Lenovo 3000 y410
          nec           NEC Versa S9100
index d1f5a766c3b224a1fd7a2092f72106b21b534242..4cfea551cab84cc4674fb6bad6e365fde3094f16 100644 (file)
@@ -103,6 +103,7 @@ enum {
        ALC262_LENOVO_3000,
        ALC262_NEC,
        ALC262_TOSHIBA_S06,
+       ALC262_TOSHIBA_RX1,
        ALC262_AUTO,
        ALC262_MODEL_LAST /* last tag */
 };
@@ -9712,6 +9713,25 @@ static struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = {
        { } /* end */
 };
 
+static struct snd_kcontrol_new alc262_toshiba_rx1_mixer[] = {
+       HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol),
+       {
+               .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+               .name = "Master Playback Switch",
+               .info = snd_hda_mixer_amp_switch_info,
+               .get = snd_hda_mixer_amp_switch_get,
+               .put = alc262_sony_master_sw_put,
+               .private_value = HDA_COMPOSE_AMP_VAL(0x15, 3, 0, HDA_OUTPUT),
+       },
+       HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT),
+       HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT),
+       HDA_CODEC_VOLUME("Mic Boost", 0x18, 0, HDA_INPUT),
+       HDA_CODEC_VOLUME("Front Mic Playback Volume", 0x0b, 0x01, HDA_INPUT),
+       HDA_CODEC_MUTE("Front Mic Playback Switch", 0x0b, 0x01, HDA_INPUT),
+       HDA_CODEC_VOLUME("Front Mic Boost", 0x19, 0, HDA_INPUT),
+       { } /* end */
+};
+
 /* additional init verbs for Benq laptops */
 static struct hda_verb alc262_EAPD_verbs[] = {
        {0x20, AC_VERB_SET_COEF_INDEX, 0x07},
@@ -10176,6 +10196,24 @@ static struct hda_verb alc262_HP_BPC_WildWest_init_verbs[] = {
        { }
 };
 
+static struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
+
+       {0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },       /* Front Speaker */
+       {0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE },
+       {0x14, AC_VERB_SET_CONNECT_SEL, 0x01},
+
+       {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },    /* MIC jack */
+       {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80 },    /* Front MIC */
+       {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) },
+       {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) },
+
+       {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },        /* HP  jack */
+       {0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
+       {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
+       {}
+};
+
+
 #ifdef CONFIG_SND_HDA_POWER_SAVE
 #define alc262_loopbacks       alc880_loopbacks
 #endif
@@ -10263,6 +10301,7 @@ static const char *alc262_models[ALC262_MODEL_LAST] = {
        [ALC262_BENQ_T31]       = "benq-t31",
        [ALC262_SONY_ASSAMD]    = "sony-assamd",
        [ALC262_TOSHIBA_S06]    = "toshiba-s06",
+       [ALC262_TOSHIBA_RX1]    = "toshiba-rx1",
        [ALC262_ULTRA]          = "ultra",
        [ALC262_LENOVO_3000]    = "lenovo-3000",
        [ALC262_NEC]            = "nec",
@@ -10300,7 +10339,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
        SND_PCI_QUIRK(0x104d, 0x900e, "Sony ASSAMD", ALC262_SONY_ASSAMD),
        SND_PCI_QUIRK(0x104d, 0x9015, "Sony 0x9015", ALC262_SONY_ASSAMD),
        SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1",
-                     ALC262_SONY_ASSAMD),
+                     ALC262_TOSHIBA_RX1),
        SND_PCI_QUIRK(0x1179, 0x0268, "Toshiba S06", ALC262_TOSHIBA_S06),
        SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu", ALC262_FUJITSU),
        SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
@@ -10508,6 +10547,18 @@ static struct alc_config_preset alc262_presets[] = {
                .unsol_event = alc262_toshiba_s06_unsol_event,
                .init_hook = alc262_toshiba_s06_init_hook,
        },
+       [ALC262_TOSHIBA_RX1] = {
+               .mixers = { alc262_toshiba_rx1_mixer },
+               .init_verbs = { alc262_init_verbs, alc262_toshiba_rx1_unsol_verbs },
+               .num_dacs = ARRAY_SIZE(alc262_dac_nids),
+               .dac_nids = alc262_dac_nids,
+               .hp_nid = 0x03,
+               .num_channel_mode = ARRAY_SIZE(alc262_modes),
+               .channel_mode = alc262_modes,
+               .input_mux = &alc262_capture_source,
+               .unsol_event = alc262_hippo_unsol_event,
+               .init_hook = alc262_hippo_automute,
+       },
 };
 
 static int patch_alc262(struct hda_codec *codec)