summaryrefslogtreecommitdiff
path: root/sound/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/sparc')
-rw-r--r--sound/sparc/amd7930.c3
-rw-r--r--sound/sparc/cs4231.c1
-rw-r--r--sound/sparc/dbri.c20
3 files changed, 16 insertions, 8 deletions
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 07962a3..0c63e05 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -36,7 +36,6 @@
#include <linux/interrupt.h>
#include <linux/moduleparam.h>
-#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
@@ -859,7 +858,7 @@ static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem
spin_lock_irqsave(&amd->lock, flags);
if (*swval != ucontrol->value.integer.value[0]) {
- *swval = ucontrol->value.integer.value[0];
+ *swval = ucontrol->value.integer.value[0] & 0xff;
__amd7930_update_map(amd);
change = 1;
} else
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index f8c7a12..1c4797b 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -19,7 +19,6 @@
#include <linux/io.h>
-#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/info.h>
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index 376b986..3d00e07 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -53,7 +53,6 @@
* other DBRI low-level stuff
*/
-#include <sound/driver.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/irq.h>
@@ -2279,14 +2278,25 @@ static int snd_cs4215_put_volume(struct snd_kcontrol *kcontrol,
struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
struct dbri_streaminfo *info =
&dbri->stream_info[kcontrol->private_value];
+ unsigned int vol[2];
int changed = 0;
- if (info->left_gain != ucontrol->value.integer.value[0]) {
- info->left_gain = ucontrol->value.integer.value[0];
+ vol[0] = ucontrol->value.integer.value[0];
+ vol[1] = ucontrol->value.integer.value[1];
+ if (kcontrol->private_value == DBRI_PLAY) {
+ if (vol[0] > DBRI_MAX_VOLUME || vol[1] > DBRI_MAX_VOLUME)
+ return -EINVAL;
+ } else {
+ if (vol[0] > DBRI_MAX_GAIN || vol[1] > DBRI_MAX_GAIN)
+ return -EINVAL;
+ }
+
+ if (info->left_gain != vol[0]) {
+ info->left_gain = vol[0];
changed = 1;
}
- if (info->right_gain != ucontrol->value.integer.value[1]) {
- info->right_gain = ucontrol->value.integer.value[1];
+ if (info->right_gain != vol[1]) {
+ info->right_gain = vol[1];
changed = 1;
}
if (changed) {