aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_codec.c5
-rw-r--r--sound/pci/hda/hda_local.h3
-rw-r--r--sound/pci/hda/patch_conexant.c21
-rw-r--r--sound/pci/hda/patch_realtek.c2
-rw-r--r--sound/pci/hda/patch_sigmatel.c2
5 files changed, 23 insertions, 10 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index b981ea9c644c..7a8fcc4c15f8 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -2508,7 +2508,8 @@ static struct snd_kcontrol_new vmaster_mute_mode = {
2508 * the given hook. 2508 * the given hook.
2509 */ 2509 */
2510int snd_hda_add_vmaster_hook(struct hda_codec *codec, 2510int snd_hda_add_vmaster_hook(struct hda_codec *codec,
2511 struct hda_vmaster_mute_hook *hook) 2511 struct hda_vmaster_mute_hook *hook,
2512 bool expose_enum_ctl)
2512{ 2513{
2513 struct snd_kcontrol *kctl; 2514 struct snd_kcontrol *kctl;
2514 2515
@@ -2517,6 +2518,8 @@ int snd_hda_add_vmaster_hook(struct hda_codec *codec,
2517 snd_ctl_add_vmaster_hook(hook->sw_kctl, hook->hook, codec); 2518 snd_ctl_add_vmaster_hook(hook->sw_kctl, hook->hook, codec);
2518 hook->codec = codec; 2519 hook->codec = codec;
2519 hook->mute_mode = HDA_VMUTE_FOLLOW_MASTER; 2520 hook->mute_mode = HDA_VMUTE_FOLLOW_MASTER;
2521 if (!expose_enum_ctl)
2522 return 0;
2520 kctl = snd_ctl_new1(&vmaster_mute_mode, hook); 2523 kctl = snd_ctl_new1(&vmaster_mute_mode, hook);
2521 if (!kctl) 2524 if (!kctl)
2522 return -ENOMEM; 2525 return -ENOMEM;
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 3f82ab6a0587..0ec9248165bc 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -165,7 +165,8 @@ struct hda_vmaster_mute_hook {
165}; 165};
166 166
167int snd_hda_add_vmaster_hook(struct hda_codec *codec, 167int snd_hda_add_vmaster_hook(struct hda_codec *codec,
168 struct hda_vmaster_mute_hook *hook); 168 struct hda_vmaster_mute_hook *hook,
169 bool expose_enum_ctl);
169void snd_hda_sync_vmaster_hook(struct hda_vmaster_mute_hook *hook); 170void snd_hda_sync_vmaster_hook(struct hda_vmaster_mute_hook *hook);
170 171
171/* amp value bits */ 172/* amp value bits */
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index a21a485a413c..e6eafb18c8f5 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -71,6 +71,7 @@ struct conexant_spec {
71 int num_mixers; 71 int num_mixers;
72 hda_nid_t vmaster_nid; 72 hda_nid_t vmaster_nid;
73 struct hda_vmaster_mute_hook vmaster_mute; 73 struct hda_vmaster_mute_hook vmaster_mute;
74 bool vmaster_mute_led;
74 75
75 const struct hda_verb *init_verbs[5]; /* initialization verbs 76 const struct hda_verb *init_verbs[5]; /* initialization verbs
76 * don't forget NULL 77 * don't forget NULL
@@ -4346,8 +4347,10 @@ static int cx_auto_build_controls(struct hda_codec *codec)
4346 err = snd_hda_jack_add_kctls(codec, &spec->autocfg); 4347 err = snd_hda_jack_add_kctls(codec, &spec->autocfg);
4347 if (err < 0) 4348 if (err < 0)
4348 return err; 4349 return err;
4349 if (spec->vmaster_mute.hook && spec->vmaster_mute.sw_kctl) { 4350 if (spec->vmaster_mute.sw_kctl) {
4350 err = snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute); 4351 spec->vmaster_mute.hook = cx_auto_vmaster_hook;
4352 err = snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute,
4353 spec->vmaster_mute_led);
4351 if (err < 0) 4354 if (err < 0)
4352 return err; 4355 return err;
4353 } 4356 }
@@ -4476,11 +4479,17 @@ static int patch_conexant_auto(struct hda_codec *codec)
4476 4479
4477 apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl); 4480 apply_pin_fixup(codec, cxt_fixups, cxt_pincfg_tbl);
4478 4481
4479 /* add EAPD vmaster hook to all HP machines */ 4482 /* Show mute-led control only on HP laptops
4480 /* NOTE: this should be applied via fixup once when the generic 4483 * This is a sort of white-list: on HP laptops, EAPD corresponds
4481 * fixup code is merged to hda_codec.c 4484 * only to the mute-LED without actualy amp function. Meanwhile,
4485 * others may use EAPD really as an amp switch, so it might be
4486 * not good to expose it blindly.
4482 */ 4487 */
4483 spec->vmaster_mute.hook = cx_auto_vmaster_hook; 4488 switch (codec->subsystem_id >> 16) {
4489 case 0x103c:
4490 spec->vmaster_mute_led = 1;
4491 break;
4492 }
4484 4493
4485 err = cx_auto_search_adcs(codec); 4494 err = cx_auto_search_adcs(codec);
4486 if (err < 0) 4495 if (err < 0)
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index b69d2fe40297..8ea2fd654327 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5895,7 +5895,7 @@ static void alc269_fixup_mic2_mute(struct hda_codec *codec,
5895 switch (action) { 5895 switch (action) {
5896 case ALC_FIXUP_ACT_BUILD: 5896 case ALC_FIXUP_ACT_BUILD:
5897 spec->vmaster_mute.hook = alc269_fixup_mic2_mute_hook; 5897 spec->vmaster_mute.hook = alc269_fixup_mic2_mute_hook;
5898 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute); 5898 snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
5899 /* fallthru */ 5899 /* fallthru */
5900 case ALC_FIXUP_ACT_INIT: 5900 case ALC_FIXUP_ACT_INIT:
5901 snd_hda_sync_vmaster_hook(&spec->vmaster_mute); 5901 snd_hda_sync_vmaster_hook(&spec->vmaster_mute);
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index cd04e29e157b..153b9ae46ba4 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1166,7 +1166,7 @@ static int stac92xx_build_controls(struct hda_codec *codec)
1166 1166
1167 if (spec->gpio_led) { 1167 if (spec->gpio_led) {
1168 spec->vmaster_mute.hook = stac92xx_vmaster_hook; 1168 spec->vmaster_mute.hook = stac92xx_vmaster_hook;
1169 err = snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute); 1169 err = snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true);
1170 if (err < 0) 1170 if (err < 0)
1171 return err; 1171 return err;
1172 } 1172 }