aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-29 10:17:25 -0400
committerJaroslav Kysela <perex@perex.cz>2008-09-04 04:25:05 -0400
commita6b936b956a2b70b6f49741403b5f8b90a8acc7f (patch)
treeb2c2a8ba8e9ce91cb71e346b9dd061fc6a316eee /sound/pci/ice1712
parenteee75a6ca77a729c26258649abe992c15a6c76f6 (diff)
ALSA: ice1724 - limit channels for multi-channel playback
Limit the available channels for multi-channel playback device to the real number of channels. Until now, always up to 8 channels are created, which are simply useless without the real outputs. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r--sound/pci/ice1712/ice1724.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 60119d220a66..7bb99df44fd1 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -942,7 +942,7 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream)
942{ 942{
943 struct snd_pcm_runtime *runtime = substream->runtime; 943 struct snd_pcm_runtime *runtime = substream->runtime;
944 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream); 944 struct snd_ice1712 *ice = snd_pcm_substream_chip(substream);
945 int chs; 945 int chs, num_indeps;
946 946
947 runtime->private_data = (void *)&vt1724_playback_pro_reg; 947 runtime->private_data = (void *)&vt1724_playback_pro_reg;
948 ice->playback_pro_substream = substream; 948 ice->playback_pro_substream = substream;
@@ -952,7 +952,8 @@ static int snd_vt1724_playback_pro_open(struct snd_pcm_substream *substream)
952 set_rate_constraints(ice, substream); 952 set_rate_constraints(ice, substream);
953 mutex_lock(&ice->open_mutex); 953 mutex_lock(&ice->open_mutex);
954 /* calculate the currently available channels */ 954 /* calculate the currently available channels */
955 for (chs = 0; chs < 3; chs++) { 955 num_indeps = ice->num_total_dacs / 2 - 1;
956 for (chs = 0; chs < num_indeps; chs++) {
956 if (ice->pcm_reserved[chs]) 957 if (ice->pcm_reserved[chs])
957 break; 958 break;
958 } 959 }