aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-11-14 11:13:23 -0500
committerTakashi Iwai <tiwai@suse.de>2011-11-14 11:13:23 -0500
commite29d377814b83af816fb8c1857605b9c4196477b (patch)
tree92d316595fefcc0791df21dae8537ce28e1f2604
parentc3e837bbcc03e39991da5dd1f791c06cde9f7a45 (diff)
ALSA: hda/realtek - Create mono volume controls for mono-outputs
When the pin or the DAC doesn't support the stereo, create a mono control instead of creating a stereo control blindly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_realtek.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 9fc2ba009489..6f0f2f6b2e46 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -3144,8 +3144,15 @@ static int alc_auto_add_vol_ctl(struct hda_codec *codec,
3144 val); 3144 val);
3145} 3145}
3146 3146
3147#define alc_auto_add_stereo_vol(codec, pfx, cidx, nid) \ 3147static int alc_auto_add_stereo_vol(struct hda_codec *codec,
3148 alc_auto_add_vol_ctl(codec, pfx, cidx, nid, 3) 3148 const char *pfx, int cidx,
3149 hda_nid_t nid)
3150{
3151 int chs = 1;
3152 if (get_wcaps(codec, nid) & AC_WCAP_STEREO)
3153 chs = 3;
3154 return alc_auto_add_vol_ctl(codec, pfx, cidx, nid, chs);
3155}
3149 3156
3150/* create a mute-switch for the given mixer widget; 3157/* create a mute-switch for the given mixer widget;
3151 * if it has multiple sources (e.g. DAC and loopback), create a bind-mute 3158 * if it has multiple sources (e.g. DAC and loopback), create a bind-mute
@@ -3177,8 +3184,14 @@ static int alc_auto_add_sw_ctl(struct hda_codec *codec,
3177 return __add_pb_sw_ctrl(codec->spec, type, pfx, cidx, val); 3184 return __add_pb_sw_ctrl(codec->spec, type, pfx, cidx, val);
3178} 3185}
3179 3186
3180#define alc_auto_add_stereo_sw(codec, pfx, cidx, nid) \ 3187static int alc_auto_add_stereo_sw(struct hda_codec *codec, const char *pfx,
3181 alc_auto_add_sw_ctl(codec, pfx, cidx, nid, 3) 3188 int cidx, hda_nid_t nid)
3189{
3190 int chs = 1;
3191 if (get_wcaps(codec, nid) & AC_WCAP_STEREO)
3192 chs = 3;
3193 return alc_auto_add_sw_ctl(codec, pfx, cidx, nid, chs);
3194}
3182 3195
3183static hda_nid_t alc_look_for_out_mute_nid(struct hda_codec *codec, 3196static hda_nid_t alc_look_for_out_mute_nid(struct hda_codec *codec,
3184 hda_nid_t pin, hda_nid_t dac) 3197 hda_nid_t pin, hda_nid_t dac)