aboutsummaryrefslogtreecommitdiffstats
path: root/sound/sh/aica.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/sh/aica.c')
-rw-r--r--sound/sh/aica.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index 88dc840152ce..d49417bf78c6 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -35,7 +35,6 @@
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/workqueue.h> 37#include <linux/workqueue.h>
38#include <sound/driver.h>
39#include <sound/core.h> 38#include <sound/core.h>
40#include <sound/control.h> 39#include <sound/control.h>
41#include <sound/pcm.h> 40#include <sound/pcm.h>
@@ -237,6 +236,7 @@ static int aica_dma_transfer(int channels, int buffer_size,
237 struct snd_card_aica *dreamcastcard; 236 struct snd_card_aica *dreamcastcard;
238 struct snd_pcm_runtime *runtime; 237 struct snd_pcm_runtime *runtime;
239 unsigned long flags; 238 unsigned long flags;
239 err = 0;
240 dreamcastcard = substream->pcm->private_data; 240 dreamcastcard = substream->pcm->private_data;
241 period_offset = dreamcastcard->clicks; 241 period_offset = dreamcastcard->clicks;
242 period_offset %= (AICA_PERIOD_NUMBER / channels); 242 period_offset %= (AICA_PERIOD_NUMBER / channels);
@@ -522,11 +522,14 @@ static int aica_pcmvolume_put(struct snd_kcontrol *kcontrol,
522 struct snd_ctl_elem_value *ucontrol) 522 struct snd_ctl_elem_value *ucontrol)
523{ 523{
524 struct snd_card_aica *dreamcastcard; 524 struct snd_card_aica *dreamcastcard;
525 unsigned int vol;
525 dreamcastcard = kcontrol->private_data; 526 dreamcastcard = kcontrol->private_data;
526 if (unlikely(!dreamcastcard->channel)) 527 if (unlikely(!dreamcastcard->channel))
527 return -ETXTBSY; 528 return -ETXTBSY;
528 if (unlikely(dreamcastcard->channel->vol == 529 vol = ucontrol->value.integer.value[0];
529 ucontrol->value.integer.value[0])) 530 if (vol > 0xff)
531 return -EINVAL;
532 if (unlikely(dreamcastcard->channel->vol == vol))
530 return 0; 533 return 0;
531 dreamcastcard->channel->vol = ucontrol->value.integer.value[0]; 534 dreamcastcard->channel->vol = ucontrol->value.integer.value[0];
532 dreamcastcard->master_volume = ucontrol->value.integer.value[0]; 535 dreamcastcard->master_volume = ucontrol->value.integer.value[0];