Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[sfrench/cifs-2.6.git] / sound / sparc / cs4231.c
index 5018fcf41df5883b7cbb722b28a1181d8dfe07b1..dca0344cc1bc393734a06d6eb0e71b8a634238b3 100644 (file)
@@ -661,11 +661,9 @@ static int snd_cs4231_trigger(struct snd_pcm_substream *substream, int cmd)
        {
                unsigned int what = 0;
                struct snd_pcm_substream *s;
-               struct list_head *pos;
                unsigned long flags;
 
-               snd_pcm_group_for_each(pos, substream) {
-                       s = snd_pcm_group_substream_entry(pos);
+               snd_pcm_group_for_each_entry(s, substream) {
                        if (s == chip->playback_substream) {
                                what |= CS4231_PLAYBACK_ENABLE;
                                snd_pcm_trigger_done(s, substream);
@@ -1268,7 +1266,7 @@ static struct snd_pcm_hardware snd_cs4231_playback =
        .channels_min           = 1,
        .channels_max           = 2,
        .buffer_bytes_max       = (32*1024),
-       .period_bytes_min       = 4096,
+       .period_bytes_min       = 64,
        .period_bytes_max       = (32*1024),
        .periods_min            = 1,
        .periods_max            = 1024,
@@ -1288,7 +1286,7 @@ static struct snd_pcm_hardware snd_cs4231_capture =
        .channels_min           = 1,
        .channels_max           = 2,
        .buffer_bytes_max       = (32*1024),
-       .period_bytes_min       = 4096,
+       .period_bytes_min       = 64,
        .period_bytes_max       = (32*1024),
        .periods_min            = 1,
        .periods_max            = 1024,
@@ -1753,7 +1751,7 @@ out_err:
 
 #ifdef SBUS_SUPPORT
 
-static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id)
 {
        unsigned long flags;
        unsigned char status;
@@ -1796,7 +1794,7 @@ static irqreturn_t snd_cs4231_sbus_interrupt(int irq, void *dev_id, struct pt_re
        snd_cs4231_outm(chip, CS4231_IRQ_STATUS, ~CS4231_ALL_IRQS | ~status, 0);
        spin_unlock_irqrestore(&chip->lock, flags);
 
-       return 0;
+       return IRQ_HANDLED;
 }
 
 /*
@@ -1821,7 +1819,6 @@ static int sbus_dma_request(struct cs4231_dma_control *dma_cont, dma_addr_t bus_
        if (!(csr & test))
                goto out;
        err = -EBUSY;
-       csr = sbus_readl(base->regs + APCCSR);
        test = APC_XINT_CNVA;
        if ( base->dir == APC_PLAY )
                test = APC_XINT_PNVA;
@@ -1862,17 +1859,16 @@ static void sbus_dma_enable(struct cs4231_dma_control *dma_cont, int on)
 
        spin_lock_irqsave(&base->lock, flags);
        if (!on) {
-               if (base->dir == APC_PLAY) { 
-                       sbus_writel(0, base->regs + base->dir + APCNVA); 
-                       sbus_writel(1, base->regs + base->dir + APCC); 
-               }
-               else
-               {
-                       sbus_writel(0, base->regs + base->dir + APCNC); 
-                       sbus_writel(0, base->regs + base->dir + APCVA); 
-               } 
+               sbus_writel(0, base->regs + base->dir + APCNC);
+               sbus_writel(0, base->regs + base->dir + APCNVA);
+               sbus_writel(0, base->regs + base->dir + APCC);
+               sbus_writel(0, base->regs + base->dir + APCVA);
+
+               /* ACK any APC interrupts. */
+               csr = sbus_readl(base->regs + APCCSR);
+               sbus_writel(csr, base->regs + APCCSR);
        } 
-       udelay(600); 
+       udelay(1000);
        csr = sbus_readl(base->regs + APCCSR);
        shift = 0;
        if ( base->dir == APC_PLAY )
@@ -2036,7 +2032,7 @@ static int __init cs4231_sbus_attach(struct sbus_dev *sdev)
        if (err)
                return err;
 
-       sprintf(card->longname, "%s at 0x%02lx:0x%016lx, irq %d",
+       sprintf(card->longname, "%s at 0x%02lx:0x%016Lx, irq %d",
                card->shortname,
                rp->flags & 0xffL,
                (unsigned long long)rp->start,
@@ -2286,7 +2282,7 @@ static int __init cs4231_init(void)
                        if (!strcmp(edev->prom_node->name, "SUNW,CS4231")) {
                                match = 1;
                        } else if (!strcmp(edev->prom_node->name, "audio")) {
-                               char *compat;
+                               const char *compat;
 
                                compat = of_get_property(edev->prom_node,
                                                         "compatible", NULL);