aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorNitin Daga <ndaga@nvidia.com>2011-01-10 11:19:31 -0500
committerTakashi Iwai <tiwai@suse.de>2011-01-12 01:46:23 -0500
commit393004b2ea49524ee41a562cae8db67f50f372a5 (patch)
tree778c47155ad07ef37315a89ccbba74e469003e83 /sound/pci
parent0ebaa24c6b1f62839bcd12d63fa76e3cf23b9bd0 (diff)
ALSA: hda: Disable 4/6 channels on some NVIDIA GPUs.
Added hardware constraint in patch_hdmi.c to disable channels 4/6 which are not supported by some older NVIDIA GPUs. Signed-off-by: Nitin Daga <ndaga@nvidia.com> Acked-By: Stephen Warren <swarren@nvidia.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_hdmi.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 8804c05b5fc7..f29b97b5de8f 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -1193,11 +1193,53 @@ static int nvhdmi_7x_init(struct hda_codec *codec)
1193 return 0; 1193 return 0;
1194} 1194}
1195 1195
1196static unsigned int channels_2_6_8[] = {
1197 2, 6, 8
1198};
1199
1200static unsigned int channels_2_8[] = {
1201 2, 8
1202};
1203
1204static struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = {
1205 .count = ARRAY_SIZE(channels_2_6_8),
1206 .list = channels_2_6_8,
1207 .mask = 0,
1208};
1209
1210static struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = {
1211 .count = ARRAY_SIZE(channels_2_8),
1212 .list = channels_2_8,
1213 .mask = 0,
1214};
1215
1196static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo, 1216static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
1197 struct hda_codec *codec, 1217 struct hda_codec *codec,
1198 struct snd_pcm_substream *substream) 1218 struct snd_pcm_substream *substream)
1199{ 1219{
1200 struct hdmi_spec *spec = codec->spec; 1220 struct hdmi_spec *spec = codec->spec;
1221 struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL;
1222
1223 switch (codec->preset->id) {
1224 case 0x10de0002:
1225 case 0x10de0003:
1226 case 0x10de0005:
1227 case 0x10de0006:
1228 hw_constraints_channels = &hw_constraints_2_8_channels;
1229 break;
1230 case 0x10de0007:
1231 hw_constraints_channels = &hw_constraints_2_6_8_channels;
1232 break;
1233 default:
1234 break;
1235 }
1236
1237 if (hw_constraints_channels != NULL) {
1238 snd_pcm_hw_constraint_list(substream->runtime, 0,
1239 SNDRV_PCM_HW_PARAM_CHANNELS,
1240 hw_constraints_channels);
1241 }
1242
1201 return snd_hda_multi_out_dig_open(codec, &spec->multiout); 1243 return snd_hda_multi_out_dig_open(codec, &spec->multiout);
1202} 1244}
1203 1245