aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda')
-rw-r--r--sound/pci/hda/hda_beep.h9
-rw-r--r--sound/pci/hda/hda_eld.c2
-rw-r--r--sound/pci/hda/patch_conexant.c5
-rw-r--r--sound/pci/hda/patch_realtek.c64
-rw-r--r--sound/pci/hda/patch_via.c46
5 files changed, 91 insertions, 35 deletions
diff --git a/sound/pci/hda/hda_beep.h b/sound/pci/hda/hda_beep.h
index f1de1bac042c..55f0647458c7 100644
--- a/sound/pci/hda/hda_beep.h
+++ b/sound/pci/hda/hda_beep.h
@@ -50,7 +50,12 @@ int snd_hda_enable_beep_device(struct hda_codec *codec, int enable);
50int snd_hda_attach_beep_device(struct hda_codec *codec, int nid); 50int snd_hda_attach_beep_device(struct hda_codec *codec, int nid);
51void snd_hda_detach_beep_device(struct hda_codec *codec); 51void snd_hda_detach_beep_device(struct hda_codec *codec);
52#else 52#else
53#define snd_hda_attach_beep_device(...) 0 53static inline int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
54#define snd_hda_detach_beep_device(...) 54{
55 return 0;
56}
57static inline void snd_hda_detach_beep_device(struct hda_codec *codec)
58{
59}
55#endif 60#endif
56#endif 61#endif
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index b05f7be9dc1b..e3e853153d14 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -294,7 +294,7 @@ static int hdmi_update_eld(struct hdmi_eld *e,
294 snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl); 294 snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl);
295 goto out_fail; 295 goto out_fail;
296 } else 296 } else
297 strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl); 297 strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl + 1);
298 298
299 for (i = 0; i < e->sad_count; i++) { 299 for (i = 0; i < e->sad_count; i++) {
300 if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) { 300 if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) {
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 3e6b9a8539c2..7bbc5f237a5e 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -3074,6 +3074,7 @@ static const char * const cxt5066_models[CXT5066_MODELS] = {
3074}; 3074};
3075 3075
3076static const struct snd_pci_quirk cxt5066_cfg_tbl[] = { 3076static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3077 SND_PCI_QUIRK(0x1025, 0x054c, "Acer Aspire 3830TG", CXT5066_AUTO),
3077 SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), 3078 SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD),
3078 SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), 3079 SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
3079 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), 3080 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
@@ -3102,6 +3103,7 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
3102 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS), 3103 SND_PCI_QUIRK(0x17aa, 0x38af, "Lenovo G560", CXT5066_ASUS),
3103 SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO), 3104 SND_PCI_QUIRK(0x17aa, 0x3938, "Lenovo G565", CXT5066_AUTO),
3104 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */ 3105 SND_PCI_QUIRK_VENDOR(0x17aa, "Lenovo", CXT5066_IDEAPAD), /* Fallback for Lenovos without dock mic */
3106 SND_PCI_QUIRK(0x1b0a, 0x2092, "CyberpowerPC Gamer Xplorer N57001", CXT5066_AUTO),
3105 {} 3107 {}
3106}; 3108};
3107 3109
@@ -4388,6 +4390,8 @@ static const struct hda_codec_preset snd_hda_preset_conexant[] = {
4388 .patch = patch_cxt5066 }, 4390 .patch = patch_cxt5066 },
4389 { .id = 0x14f15069, .name = "CX20585", 4391 { .id = 0x14f15069, .name = "CX20585",
4390 .patch = patch_cxt5066 }, 4392 .patch = patch_cxt5066 },
4393 { .id = 0x14f1506c, .name = "CX20588",
4394 .patch = patch_cxt5066 },
4391 { .id = 0x14f1506e, .name = "CX20590", 4395 { .id = 0x14f1506e, .name = "CX20590",
4392 .patch = patch_cxt5066 }, 4396 .patch = patch_cxt5066 },
4393 { .id = 0x14f15097, .name = "CX20631", 4397 { .id = 0x14f15097, .name = "CX20631",
@@ -4416,6 +4420,7 @@ MODULE_ALIAS("snd-hda-codec-id:14f15066");
4416MODULE_ALIAS("snd-hda-codec-id:14f15067"); 4420MODULE_ALIAS("snd-hda-codec-id:14f15067");
4417MODULE_ALIAS("snd-hda-codec-id:14f15068"); 4421MODULE_ALIAS("snd-hda-codec-id:14f15068");
4418MODULE_ALIAS("snd-hda-codec-id:14f15069"); 4422MODULE_ALIAS("snd-hda-codec-id:14f15069");
4423MODULE_ALIAS("snd-hda-codec-id:14f1506c");
4419MODULE_ALIAS("snd-hda-codec-id:14f1506e"); 4424MODULE_ALIAS("snd-hda-codec-id:14f1506e");
4420MODULE_ALIAS("snd-hda-codec-id:14f15097"); 4425MODULE_ALIAS("snd-hda-codec-id:14f15097");
4421MODULE_ALIAS("snd-hda-codec-id:14f15098"); 4426MODULE_ALIAS("snd-hda-codec-id:14f15098");
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7a4e10002f56..b48fb43b5448 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1141,6 +1141,13 @@ static void update_speakers(struct hda_codec *codec)
1141 struct alc_spec *spec = codec->spec; 1141 struct alc_spec *spec = codec->spec;
1142 int on; 1142 int on;
1143 1143
1144 /* Control HP pins/amps depending on master_mute state;
1145 * in general, HP pins/amps control should be enabled in all cases,
1146 * but currently set only for master_mute, just to be safe
1147 */
1148 do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
1149 spec->autocfg.hp_pins, spec->master_mute, true);
1150
1144 if (!spec->automute) 1151 if (!spec->automute)
1145 on = 0; 1152 on = 0;
1146 else 1153 else
@@ -2708,17 +2715,30 @@ typedef int (*getput_call_t)(struct snd_kcontrol *kcontrol,
2708 2715
2709static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol, 2716static int alc_cap_getput_caller(struct snd_kcontrol *kcontrol,
2710 struct snd_ctl_elem_value *ucontrol, 2717 struct snd_ctl_elem_value *ucontrol,
2711 getput_call_t func) 2718 getput_call_t func, bool check_adc_switch)
2712{ 2719{
2713 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 2720 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
2714 struct alc_spec *spec = codec->spec; 2721 struct alc_spec *spec = codec->spec;
2715 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 2722 int i, err = 0;
2716 int err;
2717 2723
2718 mutex_lock(&codec->control_mutex); 2724 mutex_lock(&codec->control_mutex);
2719 kcontrol->private_value = HDA_COMPOSE_AMP_VAL(spec->adc_nids[adc_idx], 2725 if (check_adc_switch && spec->dual_adc_switch) {
2720 3, 0, HDA_INPUT); 2726 for (i = 0; i < spec->num_adc_nids; i++) {
2721 err = func(kcontrol, ucontrol); 2727 kcontrol->private_value =
2728 HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
2729 3, 0, HDA_INPUT);
2730 err = func(kcontrol, ucontrol);
2731 if (err < 0)
2732 goto error;
2733 }
2734 } else {
2735 i = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
2736 kcontrol->private_value =
2737 HDA_COMPOSE_AMP_VAL(spec->adc_nids[i],
2738 3, 0, HDA_INPUT);
2739 err = func(kcontrol, ucontrol);
2740 }
2741 error:
2722 mutex_unlock(&codec->control_mutex); 2742 mutex_unlock(&codec->control_mutex);
2723 return err; 2743 return err;
2724} 2744}
@@ -2727,14 +2747,14 @@ static int alc_cap_vol_get(struct snd_kcontrol *kcontrol,
2727 struct snd_ctl_elem_value *ucontrol) 2747 struct snd_ctl_elem_value *ucontrol)
2728{ 2748{
2729 return alc_cap_getput_caller(kcontrol, ucontrol, 2749 return alc_cap_getput_caller(kcontrol, ucontrol,
2730 snd_hda_mixer_amp_volume_get); 2750 snd_hda_mixer_amp_volume_get, false);
2731} 2751}
2732 2752
2733static int alc_cap_vol_put(struct snd_kcontrol *kcontrol, 2753static int alc_cap_vol_put(struct snd_kcontrol *kcontrol,
2734 struct snd_ctl_elem_value *ucontrol) 2754 struct snd_ctl_elem_value *ucontrol)
2735{ 2755{
2736 return alc_cap_getput_caller(kcontrol, ucontrol, 2756 return alc_cap_getput_caller(kcontrol, ucontrol,
2737 snd_hda_mixer_amp_volume_put); 2757 snd_hda_mixer_amp_volume_put, true);
2738} 2758}
2739 2759
2740/* capture mixer elements */ 2760/* capture mixer elements */
@@ -2744,14 +2764,14 @@ static int alc_cap_sw_get(struct snd_kcontrol *kcontrol,
2744 struct snd_ctl_elem_value *ucontrol) 2764 struct snd_ctl_elem_value *ucontrol)
2745{ 2765{
2746 return alc_cap_getput_caller(kcontrol, ucontrol, 2766 return alc_cap_getput_caller(kcontrol, ucontrol,
2747 snd_hda_mixer_amp_switch_get); 2767 snd_hda_mixer_amp_switch_get, false);
2748} 2768}
2749 2769
2750static int alc_cap_sw_put(struct snd_kcontrol *kcontrol, 2770static int alc_cap_sw_put(struct snd_kcontrol *kcontrol,
2751 struct snd_ctl_elem_value *ucontrol) 2771 struct snd_ctl_elem_value *ucontrol)
2752{ 2772{
2753 return alc_cap_getput_caller(kcontrol, ucontrol, 2773 return alc_cap_getput_caller(kcontrol, ucontrol,
2754 snd_hda_mixer_amp_switch_put); 2774 snd_hda_mixer_amp_switch_put, true);
2755} 2775}
2756 2776
2757#define _DEFINE_CAPMIX(num) \ 2777#define _DEFINE_CAPMIX(num) \
@@ -4876,7 +4896,6 @@ static const struct snd_pci_quirk alc880_cfg_tbl[] = {
4876 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG), 4896 SND_PCI_QUIRK(0x1025, 0xe309, "ULI", ALC880_3ST_DIG),
4877 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST), 4897 SND_PCI_QUIRK(0x1025, 0xe310, "ULI", ALC880_3ST),
4878 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG), 4898 SND_PCI_QUIRK(0x1039, 0x1234, NULL, ALC880_6ST_DIG),
4879 SND_PCI_QUIRK(0x103c, 0x2a09, "HP", ALC880_5ST),
4880 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V), 4899 SND_PCI_QUIRK(0x1043, 0x10b3, "ASUS W1V", ALC880_ASUS_W1V),
4881 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG), 4900 SND_PCI_QUIRK(0x1043, 0x10c2, "ASUS W6A", ALC880_ASUS_DIG),
4882 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG), 4901 SND_PCI_QUIRK(0x1043, 0x10c3, "ASUS Wxx", ALC880_ASUS_DIG),
@@ -6201,11 +6220,6 @@ static const struct snd_kcontrol_new alc260_input_mixer[] = {
6201/* update HP, line and mono out pins according to the master switch */ 6220/* update HP, line and mono out pins according to the master switch */
6202static void alc260_hp_master_update(struct hda_codec *codec) 6221static void alc260_hp_master_update(struct hda_codec *codec)
6203{ 6222{
6204 struct alc_spec *spec = codec->spec;
6205
6206 /* change HP pins */
6207 do_automute(codec, ARRAY_SIZE(spec->autocfg.hp_pins),
6208 spec->autocfg.hp_pins, spec->master_mute, true);
6209 update_speakers(codec); 6223 update_speakers(codec);
6210} 6224}
6211 6225
@@ -11924,7 +11938,7 @@ static const struct hda_verb alc262_nec_verbs[] = {
11924 * 0x1b = port replicator headphone out 11938 * 0x1b = port replicator headphone out
11925 */ 11939 */
11926 11940
11927#define ALC_HP_EVENT 0x37 11941#define ALC_HP_EVENT ALC880_HP_EVENT
11928 11942
11929static const struct hda_verb alc262_fujitsu_unsol_verbs[] = { 11943static const struct hda_verb alc262_fujitsu_unsol_verbs[] = {
11930 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT}, 11944 {0x14, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC_HP_EVENT},
@@ -12598,6 +12612,7 @@ static const struct hda_verb alc262_toshiba_rx1_unsol_verbs[] = {
12598 */ 12612 */
12599enum { 12613enum {
12600 PINFIX_FSC_H270, 12614 PINFIX_FSC_H270,
12615 PINFIX_HP_Z200,
12601}; 12616};
12602 12617
12603static const struct alc_fixup alc262_fixups[] = { 12618static const struct alc_fixup alc262_fixups[] = {
@@ -12610,9 +12625,17 @@ static const struct alc_fixup alc262_fixups[] = {
12610 { } 12625 { }
12611 } 12626 }
12612 }, 12627 },
12628 [PINFIX_HP_Z200] = {
12629 .type = ALC_FIXUP_PINS,
12630 .v.pins = (const struct alc_pincfg[]) {
12631 { 0x16, 0x99130120 }, /* internal speaker */
12632 { }
12633 }
12634 },
12613}; 12635};
12614 12636
12615static const struct snd_pci_quirk alc262_fixup_tbl[] = { 12637static const struct snd_pci_quirk alc262_fixup_tbl[] = {
12638 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200", PINFIX_HP_Z200),
12616 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270), 12639 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", PINFIX_FSC_H270),
12617 {} 12640 {}
12618}; 12641};
@@ -12729,6 +12752,8 @@ static const struct snd_pci_quirk alc262_cfg_tbl[] = {
12729 ALC262_HP_BPC), 12752 ALC262_HP_BPC),
12730 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series", 12753 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1500, "HP z series",
12731 ALC262_HP_BPC), 12754 ALC262_HP_BPC),
12755 SND_PCI_QUIRK(0x103c, 0x170b, "HP Z200",
12756 ALC262_AUTO),
12732 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series", 12757 SND_PCI_QUIRK_MASK(0x103c, 0xff00, 0x1700, "HP xw series",
12733 ALC262_HP_BPC), 12758 ALC262_HP_BPC),
12734 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), 12759 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL),
@@ -13314,9 +13339,8 @@ static void alc268_acer_lc_setup(struct hda_codec *codec)
13314 struct alc_spec *spec = codec->spec; 13339 struct alc_spec *spec = codec->spec;
13315 spec->autocfg.hp_pins[0] = 0x15; 13340 spec->autocfg.hp_pins[0] = 0x15;
13316 spec->autocfg.speaker_pins[0] = 0x14; 13341 spec->autocfg.speaker_pins[0] = 0x14;
13317 spec->automute_mixer_nid[0] = 0x0f;
13318 spec->automute = 1; 13342 spec->automute = 1;
13319 spec->automute_mode = ALC_AUTOMUTE_MIXER; 13343 spec->automute_mode = ALC_AUTOMUTE_AMP;
13320 spec->ext_mic.pin = 0x18; 13344 spec->ext_mic.pin = 0x18;
13321 spec->ext_mic.mux_idx = 0; 13345 spec->ext_mic.mux_idx = 0;
13322 spec->int_mic.pin = 0x12; 13346 spec->int_mic.pin = 0x12;
@@ -13860,6 +13884,7 @@ static const struct snd_pci_quirk alc268_cfg_tbl[] = {
13860 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One", 13884 SND_PCI_QUIRK(0x1025, 0x015b, "Acer Aspire One",
13861 ALC268_ACER_ASPIRE_ONE), 13885 ALC268_ACER_ASPIRE_ONE),
13862 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL), 13886 SND_PCI_QUIRK(0x1028, 0x0253, "Dell OEM", ALC268_DELL),
13887 SND_PCI_QUIRK(0x1028, 0x02b0, "Dell Inspiron 910", ALC268_AUTO),
13863 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0, 13888 SND_PCI_QUIRK_MASK(0x1028, 0xfff0, 0x02b0,
13864 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL), 13889 "Dell Inspiron Mini9/Vostro A90", ALC268_DELL),
13865 /* almost compatible with toshiba but with optional digital outs; 13890 /* almost compatible with toshiba but with optional digital outs;
@@ -13870,7 +13895,6 @@ static const struct snd_pci_quirk alc268_cfg_tbl[] = {
13870 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST), 13895 SND_PCI_QUIRK(0x1043, 0x1205, "ASUS W7J", ALC268_3ST),
13871 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO), 13896 SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),
13872 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA), 13897 SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
13873 SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
13874 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1), 13898 SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
13875 {} 13899 {}
13876}; 13900};
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 605c99e1e520..f43bb0eaed8b 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -745,12 +745,23 @@ static int via_independent_hp_put(struct snd_kcontrol *kcontrol,
745 struct via_spec *spec = codec->spec; 745 struct via_spec *spec = codec->spec;
746 hda_nid_t nid = kcontrol->private_value; 746 hda_nid_t nid = kcontrol->private_value;
747 unsigned int pinsel = ucontrol->value.enumerated.item[0]; 747 unsigned int pinsel = ucontrol->value.enumerated.item[0];
748 unsigned int parm0, parm1;
748 /* Get Independent Mode index of headphone pin widget */ 749 /* Get Independent Mode index of headphone pin widget */
749 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel 750 spec->hp_independent_mode = spec->hp_independent_mode_index == pinsel
750 ? 1 : 0; 751 ? 1 : 0;
751 if (spec->codec_type == VT1718S) 752 if (spec->codec_type == VT1718S) {
752 snd_hda_codec_write(codec, nid, 0, 753 snd_hda_codec_write(codec, nid, 0,
753 AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0); 754 AC_VERB_SET_CONNECT_SEL, pinsel ? 2 : 0);
755 /* Set correct mute switch for MW3 */
756 parm0 = spec->hp_independent_mode ?
757 AMP_IN_UNMUTE(0) : AMP_IN_MUTE(0);
758 parm1 = spec->hp_independent_mode ?
759 AMP_IN_MUTE(1) : AMP_IN_UNMUTE(1);
760 snd_hda_codec_write(codec, 0x1b, 0,
761 AC_VERB_SET_AMP_GAIN_MUTE, parm0);
762 snd_hda_codec_write(codec, 0x1b, 0,
763 AC_VERB_SET_AMP_GAIN_MUTE, parm1);
764 }
754 else 765 else
755 snd_hda_codec_write(codec, nid, 0, 766 snd_hda_codec_write(codec, nid, 0,
756 AC_VERB_SET_CONNECT_SEL, pinsel); 767 AC_VERB_SET_CONNECT_SEL, pinsel);
@@ -832,10 +843,13 @@ static int via_hp_build(struct hda_codec *codec)
832 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid; 843 knew->subdevice = HDA_SUBDEV_NID_FLAG | nid;
833 knew->private_value = nid; 844 knew->private_value = nid;
834 845
835 knew = via_clone_control(spec, &via_hp_mixer[1]); 846 nid = side_mute_channel(spec);
836 if (knew == NULL) 847 if (nid) {
837 return -ENOMEM; 848 knew = via_clone_control(spec, &via_hp_mixer[1]);
838 knew->subdevice = side_mute_channel(spec); 849 if (knew == NULL)
850 return -ENOMEM;
851 knew->subdevice = nid;
852 }
839 853
840 return 0; 854 return 0;
841} 855}
@@ -4280,9 +4294,6 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
4280 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)}, 4294 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(2)},
4281 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)}, 4295 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(3)},
4282 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)}, 4296 {0x21, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(5)},
4283
4284 /* Setup default input of Front HP to MW9 */
4285 {0x28, AC_VERB_SET_CONNECT_SEL, 0x1},
4286 /* PW9 PW10 Output enable */ 4297 /* PW9 PW10 Output enable */
4287 {0x2d, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN}, 4298 {0x2d, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN},
4288 {0x2e, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN}, 4299 {0x2e, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_OUT_EN},
@@ -4291,10 +4302,10 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
4291 /* Enable Boost Volume backdoor */ 4302 /* Enable Boost Volume backdoor */
4292 {0x1, 0xf88, 0x8}, 4303 {0x1, 0xf88, 0x8},
4293 /* MW0/1/2/3/4: un-mute index 0 (AOWx), mute index 1 (MW9) */ 4304 /* MW0/1/2/3/4: un-mute index 0 (AOWx), mute index 1 (MW9) */
4294 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4305 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4295 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4306 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4296 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4307 {0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4297 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4308 {0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
4298 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)}, 4309 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4299 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)}, 4310 {0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
4300 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)}, 4311 {0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
@@ -4304,8 +4315,6 @@ static const struct hda_verb vt1718S_volume_init_verbs[] = {
4304 /* set MUX1 = 2 (AOW4), MUX2 = 1 (AOW3) */ 4315 /* set MUX1 = 2 (AOW4), MUX2 = 1 (AOW3) */
4305 {0x34, AC_VERB_SET_CONNECT_SEL, 0x2}, 4316 {0x34, AC_VERB_SET_CONNECT_SEL, 0x2},
4306 {0x35, AC_VERB_SET_CONNECT_SEL, 0x1}, 4317 {0x35, AC_VERB_SET_CONNECT_SEL, 0x1},
4307 /* Unmute MW4's index 0 */
4308 {0x1c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
4309 { } 4318 { }
4310}; 4319};
4311 4320
@@ -4453,6 +4462,19 @@ static int vt1718S_auto_create_multi_out_ctls(struct via_spec *spec,
4453 if (err < 0) 4462 if (err < 0)
4454 return err; 4463 return err;
4455 } else if (i == AUTO_SEQ_FRONT) { 4464 } else if (i == AUTO_SEQ_FRONT) {
4465 /* add control to mixer index 0 */
4466 err = via_add_control(spec, VIA_CTL_WIDGET_VOL,
4467 "Master Front Playback Volume",
4468 HDA_COMPOSE_AMP_VAL(0x21, 3, 5,
4469 HDA_INPUT));
4470 if (err < 0)
4471 return err;
4472 err = via_add_control(spec, VIA_CTL_WIDGET_MUTE,
4473 "Master Front Playback Switch",
4474 HDA_COMPOSE_AMP_VAL(0x21, 3, 5,
4475 HDA_INPUT));
4476 if (err < 0)
4477 return err;
4456 /* Front */ 4478 /* Front */
4457 sprintf(name, "%s Playback Volume", chname[i]); 4479 sprintf(name, "%s Playback Volume", chname[i]);
4458 err = via_add_control( 4480 err = via_add_control(