diff options
Diffstat (limited to 'sound/sparc/dbri.c')
-rw-r--r-- | sound/sparc/dbri.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index 376b98691c96..3d00e0797b11 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -53,7 +53,6 @@ | |||
53 | * other DBRI low-level stuff | 53 | * other DBRI low-level stuff |
54 | */ | 54 | */ |
55 | 55 | ||
56 | #include <sound/driver.h> | ||
57 | #include <linux/interrupt.h> | 56 | #include <linux/interrupt.h> |
58 | #include <linux/delay.h> | 57 | #include <linux/delay.h> |
59 | #include <linux/irq.h> | 58 | #include <linux/irq.h> |
@@ -2279,14 +2278,25 @@ static int snd_cs4215_put_volume(struct snd_kcontrol *kcontrol, | |||
2279 | struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); | 2278 | struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); |
2280 | struct dbri_streaminfo *info = | 2279 | struct dbri_streaminfo *info = |
2281 | &dbri->stream_info[kcontrol->private_value]; | 2280 | &dbri->stream_info[kcontrol->private_value]; |
2281 | unsigned int vol[2]; | ||
2282 | int changed = 0; | 2282 | int changed = 0; |
2283 | 2283 | ||
2284 | if (info->left_gain != ucontrol->value.integer.value[0]) { | 2284 | vol[0] = ucontrol->value.integer.value[0]; |
2285 | info->left_gain = ucontrol->value.integer.value[0]; | 2285 | vol[1] = ucontrol->value.integer.value[1]; |
2286 | if (kcontrol->private_value == DBRI_PLAY) { | ||
2287 | if (vol[0] > DBRI_MAX_VOLUME || vol[1] > DBRI_MAX_VOLUME) | ||
2288 | return -EINVAL; | ||
2289 | } else { | ||
2290 | if (vol[0] > DBRI_MAX_GAIN || vol[1] > DBRI_MAX_GAIN) | ||
2291 | return -EINVAL; | ||
2292 | } | ||
2293 | |||
2294 | if (info->left_gain != vol[0]) { | ||
2295 | info->left_gain = vol[0]; | ||
2286 | changed = 1; | 2296 | changed = 1; |
2287 | } | 2297 | } |
2288 | if (info->right_gain != ucontrol->value.integer.value[1]) { | 2298 | if (info->right_gain != vol[1]) { |
2289 | info->right_gain = ucontrol->value.integer.value[1]; | 2299 | info->right_gain = vol[1]; |
2290 | changed = 1; | 2300 | changed = 1; |
2291 | } | 2301 | } |
2292 | if (changed) { | 2302 | if (changed) { |