Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / drivers / media / video / saa7134 / saa7134-alsa.c
index b9c5cf7..ba25310 100644 (file)
@@ -222,7 +222,8 @@ static irqreturn_t saa7134_alsa_irq(int irq, void *dev_id)
 
                if (report & SAA7134_IRQ_REPORT_DONE_RA3) {
                        handled = 1;
-                       saa_writel(SAA7134_IRQ_REPORT,report);
+                       saa_writel(SAA7134_IRQ_REPORT,
+                                  SAA7134_IRQ_REPORT_DONE_RA3);
                        saa7134_irq_alsa_done(dev, status);
                } else {
                        goto out;
@@ -457,7 +458,7 @@ static struct snd_pcm_hardware snd_card_saa7134_capture =
        .buffer_bytes_max =     (256*1024),
        .period_bytes_min =     64,
        .period_bytes_max =     (256*1024),
-       .periods_min =          2,
+       .periods_min =          4,
        .periods_max =          1024,
 };
 
@@ -491,7 +492,7 @@ static int snd_card_saa7134_hw_params(struct snd_pcm_substream * substream,
 
        snd_assert(period_size >= 0x100 && period_size <= 0x10000,
                   return -EINVAL);
-       snd_assert(periods >= 2, return -EINVAL);
+       snd_assert(periods >= 4, return -EINVAL);
        snd_assert(period_size * periods <= 1024 * 1024, return -EINVAL);
 
        dev = saa7134->dev;
@@ -647,7 +648,14 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream)
                saa7134_tvaudio_setmute(dev);
        }
 
-       if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
+       err = snd_pcm_hw_constraint_integer(runtime,
+                                               SNDRV_PCM_HW_PARAM_PERIODS);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_constraint_step(runtime, 0,
+                                               SNDRV_PCM_HW_PARAM_PERIODS, 2);
+       if (err < 0)
                return err;
 
        return 0;
@@ -1069,24 +1077,14 @@ static int saa7134_alsa_init(void)
        struct saa7134_dev *dev = NULL;
        struct list_head *list;
 
-       if (!saa7134_dmasound_init && !saa7134_dmasound_exit) {
-               saa7134_dmasound_init = alsa_device_init;
-               saa7134_dmasound_exit = alsa_device_exit;
-       } else {
-               printk(KERN_WARNING "saa7134 ALSA: can't load, DMA sound handler already assigned (probably to OSS)\n");
-               return -EBUSY;
-       }
+       saa7134_dmasound_init = alsa_device_init;
+       saa7134_dmasound_exit = alsa_device_exit;
 
        printk(KERN_INFO "saa7134 ALSA driver for DMA sound loaded\n");
 
        list_for_each(list,&saa7134_devlist) {
                dev = list_entry(list, struct saa7134_dev, devlist);
-               if (dev->dmasound.priv_data == NULL) {
-                       alsa_device_init(dev);
-               } else {
-                       printk(KERN_ERR "saa7134 ALSA: DMA sound is being handled by OSS. ignoring %s\n",dev->name);
-                       return -EBUSY;
-               }
+               alsa_device_init(dev);
        }
 
        if (dev == NULL)