diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-12-20 08:57:18 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-12 02:34:12 -0500 |
commit | fd25a97a97c78e7f09b0b3069a40bf7671654366 (patch) | |
tree | b667629e1229449ca3ce15de7e454297f70998a8 | |
parent | 406b285da3a04381d46d0f5f5e53c3de0362738c (diff) |
ALSA: hda - Add spec->vmaster_mute_enum flag to generic parser
Add a flag to indicate whether the vmaster mute hook enum is exposed
or not. Conexant codecs may want not to expose the control depending
on the model.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_generic.c | 3 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.h | 1 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 8 |
3 files changed, 9 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 6fb454eda97f..a5c4bc05d16f 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -2966,7 +2966,8 @@ int snd_hda_gen_build_controls(struct hda_codec *codec) | |||
2966 | if (err < 0) | 2966 | if (err < 0) |
2967 | return err; | 2967 | return err; |
2968 | if (spec->vmaster_mute.hook) | 2968 | if (spec->vmaster_mute.hook) |
2969 | snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, true); | 2969 | snd_hda_add_vmaster_hook(codec, &spec->vmaster_mute, |
2970 | spec->vmaster_mute_enum); | ||
2970 | } | 2971 | } |
2971 | 2972 | ||
2972 | free_kctls(spec); /* no longer needed */ | 2973 | free_kctls(spec); /* no longer needed */ |
diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h index b59889911937..a406cd4cf072 100644 --- a/sound/pci/hda/hda_generic.h +++ b/sound/pci/hda/hda_generic.h | |||
@@ -151,6 +151,7 @@ struct hda_gen_spec { | |||
151 | unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */ | 151 | unsigned int multi_cap_vol:1; /* allow multiple capture xxx volumes */ |
152 | unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */ | 152 | unsigned int inv_dmic_split:1; /* inverted dmic w/a for conexant */ |
153 | unsigned int own_eapd_ctl:1; /* set EAPD by own function */ | 153 | unsigned int own_eapd_ctl:1; /* set EAPD by own function */ |
154 | unsigned int vmaster_mute_enum:1; /* add vmaster mute mode enum */ | ||
154 | 155 | ||
155 | /* for virtual master */ | 156 | /* for virtual master */ |
156 | hda_nid_t vmaster_nid; | 157 | hda_nid_t vmaster_nid; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a6547570c854..fee21625e509 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2678,8 +2678,10 @@ static void alc269_fixup_mic1_mute(struct hda_codec *codec, | |||
2678 | const struct alc_fixup *fix, int action) | 2678 | const struct alc_fixup *fix, int action) |
2679 | { | 2679 | { |
2680 | struct alc_spec *spec = codec->spec; | 2680 | struct alc_spec *spec = codec->spec; |
2681 | if (action == ALC_FIXUP_ACT_PROBE) | 2681 | if (action == ALC_FIXUP_ACT_PROBE) { |
2682 | spec->gen.vmaster_mute.hook = alc269_fixup_mic1_mute_hook; | 2682 | spec->gen.vmaster_mute.hook = alc269_fixup_mic1_mute_hook; |
2683 | spec->gen.vmaster_mute_enum = 1; | ||
2684 | } | ||
2683 | } | 2685 | } |
2684 | 2686 | ||
2685 | /* update mute-LED according to the speaker mute state via mic2 VREF pin */ | 2687 | /* update mute-LED according to the speaker mute state via mic2 VREF pin */ |
@@ -2694,8 +2696,10 @@ static void alc269_fixup_mic2_mute(struct hda_codec *codec, | |||
2694 | const struct alc_fixup *fix, int action) | 2696 | const struct alc_fixup *fix, int action) |
2695 | { | 2697 | { |
2696 | struct alc_spec *spec = codec->spec; | 2698 | struct alc_spec *spec = codec->spec; |
2697 | if (action == ALC_FIXUP_ACT_PROBE) | 2699 | if (action == ALC_FIXUP_ACT_PROBE) { |
2698 | spec->gen.vmaster_mute.hook = alc269_fixup_mic2_mute_hook; | 2700 | spec->gen.vmaster_mute.hook = alc269_fixup_mic2_mute_hook; |
2701 | spec->gen.vmaster_mute_enum = 1; | ||
2702 | } | ||
2699 | } | 2703 | } |
2700 | 2704 | ||
2701 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, | 2705 | static void alc271_hp_gate_mic_jack(struct hda_codec *codec, |