aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_analog.c2
-rw-r--r--sound/pci/hda/patch_realtek.c33
-rw-r--r--sound/pci/hda/patch_sigmatel.c2
3 files changed, 18 insertions, 19 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index be7d25fa7f35..3da85caf8af1 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -3754,7 +3754,7 @@ static int ad1884a_mobile_master_sw_put(struct snd_kcontrol *kcontrol,
3754 int mute = (!ucontrol->value.integer.value[0] && 3754 int mute = (!ucontrol->value.integer.value[0] &&
3755 !ucontrol->value.integer.value[1]); 3755 !ucontrol->value.integer.value[1]);
3756 /* toggle GPIO1 according to the mute state */ 3756 /* toggle GPIO1 according to the mute state */
3757 snd_hda_codec_write(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA, 3757 snd_hda_codec_write_cache(codec, 0x01, 0, AC_VERB_SET_GPIO_DATA,
3758 mute ? 0x02 : 0x0); 3758 mute ? 0x02 : 0x0);
3759 return ret; 3759 return ret;
3760} 3760}
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 7e99763ca527..8c8b273116fb 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -10631,6 +10631,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec,
10631 alc262_lenovo_3000_automute(codec, 1); 10631 alc262_lenovo_3000_automute(codec, 1);
10632} 10632}
10633 10633
10634static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid,
10635 int dir, int idx, long *valp)
10636{
10637 int i, change = 0;
10638
10639 for (i = 0; i < 2; i++, valp++)
10640 change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx,
10641 HDA_AMP_MUTE,
10642 *valp ? 0 : HDA_AMP_MUTE);
10643 return change;
10644}
10645
10634/* bind hp and internal speaker mute (with plug check) */ 10646/* bind hp and internal speaker mute (with plug check) */
10635static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol, 10647static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
10636 struct snd_ctl_elem_value *ucontrol) 10648 struct snd_ctl_elem_value *ucontrol)
@@ -10639,13 +10651,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
10639 long *valp = ucontrol->value.integer.value; 10651 long *valp = ucontrol->value.integer.value;
10640 int change; 10652 int change;
10641 10653
10642 change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0, 10654 change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
10643 HDA_AMP_MUTE, 10655 change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
10644 valp ? 0 : HDA_AMP_MUTE);
10645 change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
10646 HDA_AMP_MUTE,
10647 valp ? 0 : HDA_AMP_MUTE);
10648
10649 if (change) 10656 if (change)
10650 alc262_fujitsu_automute(codec, 0); 10657 alc262_fujitsu_automute(codec, 0);
10651 return change; 10658 return change;
@@ -10680,10 +10687,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol,
10680 long *valp = ucontrol->value.integer.value; 10687 long *valp = ucontrol->value.integer.value;
10681 int change; 10688 int change;
10682 10689
10683 change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0, 10690 change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
10684 HDA_AMP_MUTE,
10685 valp ? 0 : HDA_AMP_MUTE);
10686
10687 if (change) 10691 if (change)
10688 alc262_lenovo_3000_automute(codec, 0); 10692 alc262_lenovo_3000_automute(codec, 0);
10689 return change; 10693 return change;
@@ -11854,12 +11858,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol,
11854 long *valp = ucontrol->value.integer.value; 11858 long *valp = ucontrol->value.integer.value;
11855 int change; 11859 int change;
11856 11860
11857 change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0, 11861 change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
11858 HDA_AMP_MUTE,
11859 valp[0] ? 0 : HDA_AMP_MUTE);
11860 change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
11861 HDA_AMP_MUTE,
11862 valp[1] ? 0 : HDA_AMP_MUTE);
11863 if (change) 11862 if (change)
11864 alc268_acer_automute(codec, 0); 11863 alc268_acer_automute(codec, 0);
11865 return change; 11864 return change;
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index da7f9f65c047..512f3b9b9a45 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -4066,7 +4066,7 @@ static int stac92xx_add_jack(struct hda_codec *codec,
4066 jack->nid = nid; 4066 jack->nid = nid;
4067 jack->type = type; 4067 jack->type = type;
4068 4068
4069 sprintf(name, "%s at %s %s Jack", 4069 snprintf(name, sizeof(name), "%s at %s %s Jack",
4070 snd_hda_get_jack_type(def_conf), 4070 snd_hda_get_jack_type(def_conf),
4071 snd_hda_get_jack_connectivity(def_conf), 4071 snd_hda_get_jack_connectivity(def_conf),
4072 snd_hda_get_jack_location(def_conf)); 4072 snd_hda_get_jack_location(def_conf));