aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/emu10k1/emumixer.c23
-rw-r--r--sound/pci/emu10k1/p16v.c4
2 files changed, 14 insertions, 13 deletions
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index 88eab4a461bd..ccacd7b890e8 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -293,12 +293,15 @@ static int snd_emu1010_output_source_put(struct snd_kcontrol *kcontrol,
293 unsigned int val; 293 unsigned int val;
294 unsigned int channel; 294 unsigned int channel;
295 295
296 val = ucontrol->value.enumerated.item[0];
297 if (val >= 53)
298 return -EINVAL;
296 channel = (kcontrol->private_value) & 0xff; 299 channel = (kcontrol->private_value) & 0xff;
297 /* Limit: emu1010_output_dst, emu->emu1010.output_source */ 300 /* Limit: emu1010_output_dst, emu->emu1010.output_source */
298 if (channel >= 24) 301 if (channel >= 24)
299 return -EINVAL; 302 return -EINVAL;
300 if (emu->emu1010.output_source[channel] != ucontrol->value.enumerated.item[0]) { 303 if (emu->emu1010.output_source[channel] != val) {
301 val = emu->emu1010.output_source[channel] = ucontrol->value.enumerated.item[0]; 304 emu->emu1010.output_source[channel] = val;
302 change = 1; 305 change = 1;
303 snd_emu1010_fpga_link_dst_src_write(emu, 306 snd_emu1010_fpga_link_dst_src_write(emu,
304 emu1010_output_dst[channel], emu1010_src_regs[val]); 307 emu1010_output_dst[channel], emu1010_src_regs[val]);
@@ -328,12 +331,15 @@ static int snd_emu1010_input_source_put(struct snd_kcontrol *kcontrol,
328 unsigned int val; 331 unsigned int val;
329 unsigned int channel; 332 unsigned int channel;
330 333
334 val = ucontrol->value.enumerated.item[0];
335 if (val >= 53)
336 return -EINVAL;
331 channel = (kcontrol->private_value) & 0xff; 337 channel = (kcontrol->private_value) & 0xff;
332 /* Limit: emu1010_input_dst, emu->emu1010.input_source */ 338 /* Limit: emu1010_input_dst, emu->emu1010.input_source */
333 if (channel >= 22) 339 if (channel >= 22)
334 return -EINVAL; 340 return -EINVAL;
335 if (emu->emu1010.input_source[channel] != ucontrol->value.enumerated.item[0]) { 341 if (emu->emu1010.input_source[channel] != val) {
336 val = emu->emu1010.input_source[channel] = ucontrol->value.enumerated.item[0]; 342 emu->emu1010.input_source[channel] = val;
337 change = 1; 343 change = 1;
338 snd_emu1010_fpga_link_dst_src_write(emu, 344 snd_emu1010_fpga_link_dst_src_write(emu,
339 emu1010_input_dst[channel], emu1010_src_regs[val]); 345 emu1010_input_dst[channel], emu1010_src_regs[val]);
@@ -1083,7 +1089,6 @@ static int snd_emu10k1_send_volume_put(struct snd_kcontrol *kcontrol,
1083{ 1089{
1084 unsigned long flags; 1090 unsigned long flags;
1085 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1091 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1086 /* FIXME: Check limits */
1087 struct snd_emu10k1_pcm_mixer *mix = 1092 struct snd_emu10k1_pcm_mixer *mix =
1088 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 1093 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1089 int change = 0, idx, val; 1094 int change = 0, idx, val;
@@ -1136,7 +1141,6 @@ static int snd_emu10k1_attn_get(struct snd_kcontrol *kcontrol,
1136 struct snd_ctl_elem_value *ucontrol) 1141 struct snd_ctl_elem_value *ucontrol)
1137{ 1142{
1138 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1143 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1139 /* FIXME: Check limits */
1140 struct snd_emu10k1_pcm_mixer *mix = 1144 struct snd_emu10k1_pcm_mixer *mix =
1141 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 1145 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1142 unsigned long flags; 1146 unsigned long flags;
@@ -1154,7 +1158,6 @@ static int snd_emu10k1_attn_put(struct snd_kcontrol *kcontrol,
1154{ 1158{
1155 unsigned long flags; 1159 unsigned long flags;
1156 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1160 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1157 /* FIXME: Check limits */
1158 struct snd_emu10k1_pcm_mixer *mix = 1161 struct snd_emu10k1_pcm_mixer *mix =
1159 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 1162 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1160 int change = 0, idx, val; 1163 int change = 0, idx, val;
@@ -1207,7 +1210,6 @@ static int snd_emu10k1_efx_send_routing_get(struct snd_kcontrol *kcontrol,
1207{ 1210{
1208 unsigned long flags; 1211 unsigned long flags;
1209 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1212 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1210 /* FIXME: Check limits */
1211 struct snd_emu10k1_pcm_mixer *mix = 1213 struct snd_emu10k1_pcm_mixer *mix =
1212 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 1214 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1213 int idx; 1215 int idx;
@@ -1227,7 +1229,6 @@ static int snd_emu10k1_efx_send_routing_put(struct snd_kcontrol *kcontrol,
1227{ 1229{
1228 unsigned long flags; 1230 unsigned long flags;
1229 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1231 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1230 /* FIXME: Check limits */
1231 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1232 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
1232 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; 1233 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
1233 int change = 0, idx, val; 1234 int change = 0, idx, val;
@@ -1279,7 +1280,6 @@ static int snd_emu10k1_efx_send_volume_get(struct snd_kcontrol *kcontrol,
1279{ 1280{
1280 unsigned long flags; 1281 unsigned long flags;
1281 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1282 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1282 /* FIXME: Check limits */
1283 struct snd_emu10k1_pcm_mixer *mix = 1283 struct snd_emu10k1_pcm_mixer *mix =
1284 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 1284 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1285 int idx; 1285 int idx;
@@ -1297,7 +1297,6 @@ static int snd_emu10k1_efx_send_volume_put(struct snd_kcontrol *kcontrol,
1297{ 1297{
1298 unsigned long flags; 1298 unsigned long flags;
1299 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1299 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1300 /* FIXME: Check limits */
1301 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1300 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
1302 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; 1301 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
1303 int change = 0, idx, val; 1302 int change = 0, idx, val;
@@ -1346,7 +1345,6 @@ static int snd_emu10k1_efx_attn_get(struct snd_kcontrol *kcontrol,
1346 struct snd_ctl_elem_value *ucontrol) 1345 struct snd_ctl_elem_value *ucontrol)
1347{ 1346{
1348 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1347 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1349 /* FIXME: Check limits */
1350 struct snd_emu10k1_pcm_mixer *mix = 1348 struct snd_emu10k1_pcm_mixer *mix =
1351 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 1349 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
1352 unsigned long flags; 1350 unsigned long flags;
@@ -1362,7 +1360,6 @@ static int snd_emu10k1_efx_attn_put(struct snd_kcontrol *kcontrol,
1362{ 1360{
1363 unsigned long flags; 1361 unsigned long flags;
1364 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol); 1362 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1365 /* FIXME: Check limits */
1366 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 1363 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
1367 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch]; 1364 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
1368 int change = 0, val; 1365 int change = 0, val;
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index d619a3842cdd..9fd3135f3118 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -742,6 +742,8 @@ static int snd_p16v_capture_source_put(struct snd_kcontrol *kcontrol,
742 u32 source; 742 u32 source;
743 743
744 val = ucontrol->value.enumerated.item[0] ; 744 val = ucontrol->value.enumerated.item[0] ;
745 if (val > 7)
746 return -EINVAL;
745 change = (emu->p16v_capture_source != val); 747 change = (emu->p16v_capture_source != val);
746 if (change) { 748 if (change) {
747 emu->p16v_capture_source = val; 749 emu->p16v_capture_source = val;
@@ -784,6 +786,8 @@ static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
784 u32 tmp; 786 u32 tmp;
785 787
786 val = ucontrol->value.enumerated.item[0] ; 788 val = ucontrol->value.enumerated.item[0] ;
789 if (val > 3)
790 return -EINVAL;
787 change = (emu->p16v_capture_channel != val); 791 change = (emu->p16v_capture_channel != val);
788 if (change) { 792 if (change) {
789 emu->p16v_capture_channel = val; 793 emu->p16v_capture_channel = val;