From c470150c537b76d9776a5434f6f8448db8188bd3 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 7 Nov 2011 14:20:07 +0100 Subject: [PATCH] ALSA: hda/realtek - Convert ALC262 lenovo-3000 quirks to fixup-list The static quirks for ALC262 Lenovo 3000 can be covered by the auto- parser with a fixup of the mic-pin to VREF50 and the additional COEF verb. Signed-off-by: Takashi Iwai --- sound/pci/hda/alc262_quirks.c | 63 ------------------------------------------- sound/pci/hda/patch_realtek.c | 12 +++++++++ 2 files changed, 12 insertions(+), 63 deletions(-) diff --git a/sound/pci/hda/alc262_quirks.c b/sound/pci/hda/alc262_quirks.c index 3dc843e..dc4d1a1 100644 --- a/sound/pci/hda/alc262_quirks.c +++ b/sound/pci/hda/alc262_quirks.c @@ -13,7 +13,6 @@ enum { ALC262_BENQ_ED8, ALC262_BENQ_T31, ALC262_ULTRA, - ALC262_LENOVO_3000, ALC262_MODEL_LAST /* last tag */ }; @@ -295,19 +294,6 @@ static const struct hda_verb alc262_fujitsu_unsol_verbs[] = { {} }; -static const struct hda_verb alc262_lenovo_3000_unsol_verbs[] = { - {0x1b, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, - {0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP}, - {} -}; - -static const struct hda_verb alc262_lenovo_3000_init_verbs[] = { - /* Front Mic pin: input vref at 50% */ - {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50}, - {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE}, - {} -}; - static const struct hda_input_mux alc262_fujitsu_capture_source = { .num_items = 3, .items = { @@ -363,37 +349,6 @@ static const struct snd_kcontrol_new alc262_fujitsu_mixer[] = { { } /* end */ }; -static void alc262_lenovo_3000_setup(struct hda_codec *codec) -{ - struct alc_spec *spec = codec->spec; - - spec->autocfg.hp_pins[0] = 0x1b; - spec->autocfg.speaker_pins[0] = 0x14; - spec->autocfg.speaker_pins[1] = 0x16; - alc_simple_setup_automute(spec, ALC_AUTOMUTE_AMP); -} - -static const struct snd_kcontrol_new alc262_lenovo_3000_mixer[] = { - HDA_BIND_VOL("Master Playback Volume", &alc262_fujitsu_bind_master_vol), - { - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, - .name = "Master Playback Switch", - .subdevice = HDA_SUBDEV_NID_FLAG | 0x1b, - .info = snd_ctl_boolean_mono_info, - .get = alc262_hp_master_sw_get, - .put = alc262_hp_master_sw_put, - }, - HDA_CODEC_VOLUME("CD Playback Volume", 0x0b, 0x04, HDA_INPUT), - HDA_CODEC_MUTE("CD Playback Switch", 0x0b, 0x04, HDA_INPUT), - HDA_CODEC_VOLUME("Mic Boost Volume", 0x18, 0, HDA_INPUT), - HDA_CODEC_VOLUME("Mic Playback Volume", 0x0b, 0x0, HDA_INPUT), - HDA_CODEC_MUTE("Mic Playback Switch", 0x0b, 0x0, HDA_INPUT), - HDA_CODEC_VOLUME("Internal Mic Boost Volume", 0x19, 0, HDA_INPUT), - HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x0b, 0x1, HDA_INPUT), - HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x0b, 0x1, HDA_INPUT), - { } /* end */ -}; - /* additional init verbs for Benq laptops */ static const struct hda_verb alc262_EAPD_verbs[] = { {0x20, AC_VERB_SET_COEF_INDEX, 0x07}, @@ -539,7 +494,6 @@ static const char * const alc262_models[ALC262_MODEL_LAST] = { [ALC262_BENQ_ED8] = "benq", [ALC262_BENQ_T31] = "benq-t31", [ALC262_ULTRA] = "ultra", - [ALC262_LENOVO_3000] = "lenovo-3000", [ALC262_AUTO] = "auto", }; @@ -550,7 +504,6 @@ static const struct snd_pci_quirk alc262_cfg_tbl[] = { SND_PCI_QUIRK_MASK(0x144d, 0xff00, 0xc032, "Samsung Q1", ALC262_ULTRA), SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO), - SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000), SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8), SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31), SND_PCI_QUIRK(0x17ff, 0x058f, "Benq Hippo", ALC262_HIPPO_1), @@ -650,21 +603,5 @@ static const struct alc_config_preset alc262_presets[] = { .unsol_event = alc262_ultra_unsol_event, .init_hook = alc262_ultra_automute, }, - [ALC262_LENOVO_3000] = { - .mixers = { alc262_lenovo_3000_mixer }, - .init_verbs = { alc262_init_verbs, alc262_EAPD_verbs, - alc262_lenovo_3000_unsol_verbs, - alc262_lenovo_3000_init_verbs }, - .num_dacs = ARRAY_SIZE(alc262_dac_nids), - .dac_nids = alc262_dac_nids, - .hp_nid = 0x03, - .dig_out_nid = ALC262_DIGOUT_NID, - .num_channel_mode = ARRAY_SIZE(alc262_modes), - .channel_mode = alc262_modes, - .input_mux = &alc262_fujitsu_capture_source, - .unsol_event = alc_sku_unsol_event, - .setup = alc262_lenovo_3000_setup, - .init_hook = alc_inithook, - }, }; diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 6f344c9..ee267be 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4343,6 +4343,7 @@ enum { ALC262_FIXUP_HP_Z200, ALC262_FIXUP_TYAN, ALC262_FIXUP_TOSHIBA_RX1, + ALC262_FIXUP_LENOVO_3000, }; static const struct alc_fixup alc262_fixups[] = { @@ -4379,6 +4380,16 @@ static const struct alc_fixup alc262_fixups[] = { { 0x1e, 0x40f000f0 }, /* N/A */ } }, + [ALC262_FIXUP_LENOVO_3000] = { + .type = ALC_FIXUP_VERBS, + .v.verbs = (const struct hda_verb[]) { + { 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 }, + { 0x20, AC_VERB_SET_COEF_INDEX, 0x07 }, + { 0x20, AC_VERB_SET_PROC_COEF, 0x3070 }, + {} + } + }, + }; static const struct snd_pci_quirk alc262_fixup_tbl[] = { @@ -4387,6 +4398,7 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = { SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba dynabook SS RX1", ALC262_FIXUP_TOSHIBA_RX1), SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270), + SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), {} }; -- 2.7.4