aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5d8044d4dc52..7743775f6abb 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -153,8 +153,8 @@ struct alc_spec {
153 const struct hda_channel_mode *channel_mode; 153 const struct hda_channel_mode *channel_mode;
154 int num_channel_mode; 154 int num_channel_mode;
155 int need_dac_fix; 155 int need_dac_fix;
156 int const_channel_count; 156 int const_channel_count; /* min. channel count (for speakers) */
157 int ext_channel_count; 157 int ext_channel_count; /* current channel count for multi-io */
158 158
159 /* PCM information */ 159 /* PCM information */
160 struct hda_pcm pcm_rec[3]; /* used in alc_build_pcms() */ 160 struct hda_pcm pcm_rec[3]; /* used in alc_build_pcms() */
@@ -3961,8 +3961,9 @@ static int alc_auto_ch_mode_put(struct snd_kcontrol *kcontrol,
3961 spec->ext_channel_count = (ch + 1) * 2; 3961 spec->ext_channel_count = (ch + 1) * 2;
3962 for (i = 0; i < spec->multi_ios; i++) 3962 for (i = 0; i < spec->multi_ios; i++)
3963 alc_set_multi_io(codec, i, i < ch); 3963 alc_set_multi_io(codec, i, i < ch);
3964 spec->multiout.max_channels = spec->ext_channel_count; 3964 spec->multiout.max_channels = max(spec->ext_channel_count,
3965 if (spec->need_dac_fix && !spec->const_channel_count) 3965 spec->const_channel_count);
3966 if (spec->need_dac_fix)
3966 spec->multiout.num_dacs = spec->multiout.max_channels / 2; 3967 spec->multiout.num_dacs = spec->multiout.max_channels / 2;
3967 return 1; 3968 return 1;
3968} 3969}
@@ -4324,7 +4325,17 @@ static int alc_parse_auto_config(struct hda_codec *codec,
4324 if (err < 0) 4325 if (err < 0)
4325 return err; 4326 return err;
4326 4327
4327 spec->multiout.max_channels = spec->multiout.num_dacs * 2; 4328 /* check the multiple speaker pins */
4329 if (cfg->line_out_type == AUTO_PIN_SPEAKER_OUT)
4330 spec->const_channel_count = cfg->line_outs * 2;
4331 else
4332 spec->const_channel_count = cfg->speaker_outs * 2;
4333
4334 if (spec->multi_ios > 0)
4335 spec->multiout.max_channels = max(spec->ext_channel_count,
4336 spec->const_channel_count);
4337 else
4338 spec->multiout.max_channels = spec->multiout.num_dacs * 2;
4328 4339
4329 dig_only: 4340 dig_only:
4330 alc_auto_parse_digital(codec); 4341 alc_auto_parse_digital(codec);