Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ad7b218 authored by Maurus Cuelenaere's avatar Maurus Cuelenaere Committed by Takashi Iwai
Browse files

ALSA: hda: Add support for Medion WIM2160



This adds support for the Medion WIM2160 soundcard.
There's no PCI quirk added because it has the same PCI id as the
Medion MD2.

Signed-off-by: default avatarMaurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f9700d5a
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ enum {
	ALC888_ACER_ASPIRE_7730G,
	ALC883_MEDION,
	ALC883_MEDION_MD2,
	ALC883_MEDION_WIM2160,
	ALC883_LAPTOP_EAPD,
	ALC883_LENOVO_101E_2ch,
	ALC883_LENOVO_NB0763,
@@ -8455,6 +8456,42 @@ static struct snd_kcontrol_new alc883_medion_md2_mixer[] = {
	{ } /* end */
};
static struct snd_kcontrol_new alc883_medion_wim2160_mixer[] = {
	HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
	HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
	HDA_CODEC_MUTE("Speaker Playback Switch", 0x15, 0x0, HDA_OUTPUT),
	HDA_CODEC_MUTE("Headphone Playback Switch", 0x1a, 0x0, HDA_OUTPUT),
	HDA_CODEC_VOLUME("Line Playback Volume", 0x08, 0x0, HDA_INPUT),
	HDA_CODEC_MUTE("Line Playback Switch", 0x08, 0x0, HDA_INPUT),
	{ } /* end */
};
static struct hda_verb alc883_medion_wim2160_verbs[] = {
	/* Unmute front mixer */
	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
	/* Set speaker pin to front mixer */
	{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
	/* Init headphone pin */
	{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
	{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
	{0x1a, AC_VERB_SET_CONNECT_SEL, 0x00},
	{0x1a, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
	{ } /* end */
};
/* toggle speaker-output according to the hp-jack state */
static void alc883_medion_wim2160_setup(struct hda_codec *codec)
{
	struct alc_spec *spec = codec->spec;
	spec->autocfg.hp_pins[0] = 0x1a;
	spec->autocfg.speaker_pins[0] = 0x15;
}
static struct snd_kcontrol_new alc883_acer_aspire_mixer[] = {
	HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
	HDA_BIND_MUTE("Front Playback Switch", 0x0c, 2, HDA_INPUT),
@@ -9164,6 +9201,7 @@ static const char *alc882_models[ALC882_MODEL_LAST] = {
	[ALC888_ACER_ASPIRE_7730G]	= "acer-aspire-7730g",
	[ALC883_MEDION]		= "medion",
	[ALC883_MEDION_MD2]	= "medion-md2",
	[ALC883_MEDION_WIM2160]	= "medion-wim2160",
	[ALC883_LAPTOP_EAPD]	= "laptop-eapd",
	[ALC883_LENOVO_101E_2ch] = "lenovo-101e",
	[ALC883_LENOVO_NB0763]	= "lenovo-nb0763",
@@ -9818,6 +9856,21 @@ static struct alc_config_preset alc882_presets[] = {
		.setup = alc883_medion_md2_setup,
		.init_hook = alc_automute_amp,
	},
	[ALC883_MEDION_WIM2160] = {
		.mixers = { alc883_medion_wim2160_mixer },
		.init_verbs = { alc883_init_verbs, alc883_medion_wim2160_verbs },
		.num_dacs = ARRAY_SIZE(alc883_dac_nids),
		.dac_nids = alc883_dac_nids,
		.dig_out_nid = ALC883_DIGOUT_NID,
		.num_adc_nids = ARRAY_SIZE(alc883_adc_nids),
		.adc_nids = alc883_adc_nids,
		.num_channel_mode = ARRAY_SIZE(alc883_3ST_2ch_modes),
		.channel_mode = alc883_3ST_2ch_modes,
		.input_mux = &alc883_capture_source,
		.unsol_event = alc_automute_amp_unsol_event,
		.setup = alc883_medion_wim2160_setup,
		.init_hook = alc_automute_amp,
	},
	[ALC883_LAPTOP_EAPD] = {
		.mixers = { alc883_base_mixer },
		.init_verbs = { alc883_init_verbs, alc882_eapd_verbs },