Hi Takashi,
my laptop (Vaio Type G) used to work (although the valume was pretty low) with model=hippo until 2.6.29 then from 2.6.30 it stopped being supported throwing this message: hda-intel: azx_get_response timeout, switching to polling mode: last cmd=0x01570900
I recently found this rather old post[1] that has a patch to patch_realtek.c that adds an additional model and actually makes my soundcard happy again.
I forward ported to the current kernel (2.6.32-rc7) and renamed variables/functions a little bit to make it less specific. There might be better way of supporting my soundcard anyway this is one as far as I can say. I attached the output of alsa-info.sh just in case.
Not sure how signing-off or attribution could work in this case and honestly my japanese language is quite weak to be able to contact the author. If you want I can send a properly signed-off version, in any case it would be great if you could merge it and push it to Linus.
Thanks [1]: http://blog.livedoor.jp/yoyo_real/archives/51872668.html --- diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index ff20048..d47f5f5 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -99,6 +99,7 @@ enum { ALC262_HP_RP5700, ALC262_BENQ_ED8, ALC262_SONY_ASSAMD, + ALC262_SONY_VGN_G, ALC262_BENQ_T31, ALC262_ULTRA, ALC262_LENOVO_3000, @@ -10329,6 +10330,17 @@ static struct snd_kcontrol_new alc262_sony_mixer[] = { { } /* end */ };
+static struct snd_kcontrol_new alc262_sony_vgn_g_mixer[] = { + HDA_CODEC_VOLUME_MONO("Front Playback Volume", 0x0e, 2, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE_MONO("Front Playback Switch", 0x16, 2, 0x0, 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("Headphone Playback Volume", 0x0D, 0x0, HDA_OUTPUT), + HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT), + { } /* end */ +}; + static struct snd_kcontrol_new alc262_benq_t31_mixer[] = { HDA_CODEC_VOLUME("Master Playback Volume", 0x0c, 0x0, HDA_OUTPUT), ALC262_HIPPO_MASTER_SWITCH, @@ -10459,7 +10471,6 @@ static struct hda_verb alc262_init_verbs[] = { {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x03 << 8))}, {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x02 << 8))}, {0x22, AC_VERB_SET_AMP_GAIN_MUTE, (0x7080 | (0x04 << 8))}, - { } };
@@ -10489,6 +10500,52 @@ static struct hda_verb alc262_sony_unsol_verbs[] = { {} };
+static struct hda_verb alc262_sony_vgn_g_unsol_verbs[] = { + {0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0}, + {0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT}, + {0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, + {} +}; + +static struct hda_input_mux alc262_sony_vgn_g_capture_source = { + .num_items = 1, + .items = { + { "Mic", 0x0 }, + }, +}; + +/* mute/unmute sony VGN-G 0x16 internal speaker 0x15 headphone */ +static void alc262_sony_vgn_g_automute(struct hda_codec *codec) +{ + struct alc_spec *spec = codec->spec; + unsigned int mute; + unsigned int present; + + /* need to execute and sync at first */ + snd_hda_codec_read(codec, 0x15, 0, AC_VERB_SET_PIN_SENSE, 0); + present = snd_hda_codec_read(codec, 0x15, 0, + AC_VERB_GET_PIN_SENSE, 0); + spec->jack_present = (present & 0x80000000) != 0; + if (spec->jack_present) { + /* mute internal speaker */ + snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0, + HDA_AMP_MUTE, HDA_AMP_MUTE); + } else { + /* unmute internal speaker if necessary */ + mute = snd_hda_codec_amp_read(codec, 0x15, 0, HDA_OUTPUT, 0); + snd_hda_codec_amp_stereo(codec, 0x16, HDA_OUTPUT, 0, + HDA_AMP_MUTE, mute); + } +} + +static void alc262_sony_vgn_g_unsol_event(struct hda_codec *codec, + unsigned int res) +{ + if ((res >> 26) != ALC880_HP_EVENT) + return; + alc262_sony_vgn_g_automute(codec); +} + static struct snd_kcontrol_new alc262_toshiba_s06_mixer[] = { HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x0, HDA_OUTPUT), HDA_CODEC_MUTE("Speaker Playback Switch", 0x14, 0x0, HDA_OUTPUT), @@ -11423,6 +11480,7 @@ static const char *alc262_models[ALC262_MODEL_LAST] = { [ALC262_BENQ_ED8] = "benq", [ALC262_BENQ_T31] = "benq-t31", [ALC262_SONY_ASSAMD] = "sony-assamd", + [ALC262_SONY_VGN_G] = "sony-vgn-g", [ALC262_TOSHIBA_S06] = "toshiba-s06", [ALC262_TOSHIBA_RX1] = "toshiba-rx1", [ALC262_ULTRA] = "ultra", @@ -11456,6 +11514,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { ALC262_HP_TC_T5735), SND_PCI_QUIRK(0x103c, 0x2817, "HP RP5700", ALC262_HP_RP5700), SND_PCI_QUIRK(0x104d, 0x1f00, "Sony ASSAMD", ALC262_SONY_ASSAMD), + SND_PCI_QUIRK(0x104d, 0x8208, "Sony VGN-G", ALC262_SONY_VGN_G), SND_PCI_QUIRK(0x104d, 0x8203, "Sony UX-90", ALC262_HIPPO), SND_PCI_QUIRK(0x104d, 0x820f, "Sony ASSAMD", ALC262_SONY_ASSAMD), SND_PCI_QUIRK(0x104d, 0x9016, "Sony VAIO", ALC262_AUTO), /* dig-only */ @@ -11613,6 +11672,18 @@ static struct alc_config_preset alc262_presets[] = { .setup = alc262_hippo_setup, .init_hook = alc262_hippo_automute, }, + [ALC262_SONY_VGN_G] = { + .mixers = { alc262_sony_vgn_g_mixer }, + .init_verbs = { alc262_init_verbs, alc262_sony_vgn_g_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_sony_vgn_g_capture_source, + .unsol_event = alc262_sony_vgn_g_unsol_event, + .init_hook = alc262_sony_vgn_g_automute, + }, [ALC262_BENQ_T31] = { .mixers = { alc262_benq_t31_mixer }, .init_verbs = { alc262_init_verbs, alc262_benq_t31_EAPD_verbs,