All of lore.kernel.org
 help / color / mirror / Atom feed
* Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation
@ 2006-12-29 22:16 Chini, Georg
  2007-01-03  5:37 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chini, Georg @ 2006-12-29 22:16 UTC (permalink / raw)
  To: sparclinux

[-- Attachment #1: Type: text/plain, Size: 244 bytes --]

Hi,

I don't know what my mail program does to the patch. When I
send it there is always a + sign too much in one line. So I attach
it as a file now. I hope this works, and once again sorry for the
confusion.

Regards
              Georg Chini

[-- Attachment #2: cs4231_061229.diff --]
[-- Type: text/plain, Size: 2412 bytes --]

From: Georg Chini georg.chini@triaton-webhosting.com

SBUS: Change IRQ-handler return value from 0 to IRQ_HANDLED and
fix some initialisation problems.
Change period_bytes_min from 4096 to 256 to allow driver to work with
low latency (VOIP) applications. Hope this does not break EBUS.

Signed-off-by: Georg Chini <georg.chini@triaton-webhosting.com>

diff -uprN linux.orig/sound/sparc/cs4231.c linux/sound/sparc/cs4231.c
--- linux.orig/sound/sparc/cs4231.c	2006-12-29 22:08:10.000000000 +0100
+++ linux/sound/sparc/cs4231.c	2006-12-29 21:45:42.000000000 +0100
@@ -1268,7 +1268,7 @@ static struct snd_pcm_hardware snd_cs423
 	.channels_min		= 1,
 	.channels_max		= 2,
 	.buffer_bytes_max	= (32*1024),
-	.period_bytes_min	= 4096,
+	.period_bytes_min	= 256,
 	.period_bytes_max	= (32*1024),
 	.periods_min		= 1,
 	.periods_max		= 1024,
@@ -1288,7 +1288,7 @@ static struct snd_pcm_hardware snd_cs423
 	.channels_min		= 1,
 	.channels_max		= 2,
 	.buffer_bytes_max	= (32*1024),
-	.period_bytes_min	= 4096,
+	.period_bytes_min	= 256,
 	.period_bytes_max	= (32*1024),
 	.periods_min		= 1,
 	.periods_max		= 1024,
@@ -1796,7 +1796,7 @@ static irqreturn_t snd_cs4231_sbus_inter
 	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 +1821,6 @@ static int sbus_dma_request(struct cs423
 	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 +1861,16 @@ static void sbus_dma_enable(struct cs423
 
 	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 )

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and
  2006-12-29 22:16 Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Chini, Georg
@ 2007-01-03  5:37 ` David Miller
  2007-01-03 12:38 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Georg Chini
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2007-01-03  5:37 UTC (permalink / raw)
  To: sparclinux

From: "Chini, Georg" <georg.chini@hp.com>
Date: Fri, 29 Dec 2006 23:16:02 +0100

> I don't know what my mail program does to the patch. When I
> send it there is always a + sign too much in one line. So I attach
> it as a file now. I hope this works, and once again sorry for the
> confusion.

Thanks for your fix, I've applied your patch.

BTW, the period_bytes_min settings I simply copied over from the
existing ISA cs4231 driver at the time.

But it seems that nowadays the ISA CS4231 driver is using a value of
"64" for period_bytes_min.  Perhaps the Sparc driver should do that
too :-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation
  2006-12-29 22:16 Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Chini, Georg
  2007-01-03  5:37 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller
@ 2007-01-03 12:38 ` Georg Chini
  2007-01-03 18:32 ` Chini, Georg
  2007-01-04  2:50 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Georg Chini @ 2007-01-03 12:38 UTC (permalink / raw)
  To: sparclinux


David Miller wrote:

>But it seems that nowadays the ISA CS4231 driver is using a value of
>"64" for period_bytes_min.  Perhaps the Sparc driver should do that
>too :-)
>
>
>  
>
My machine seems too slow to handle this. With values less
than 256 sound will not work properly. I think it starts missing
interrupts.

Regards
              Georg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation
  2006-12-29 22:16 Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Chini, Georg
  2007-01-03  5:37 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller
  2007-01-03 12:38 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Georg Chini
@ 2007-01-03 18:32 ` Chini, Georg
  2007-01-04  2:50 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Chini, Georg @ 2007-01-03 18:32 UTC (permalink / raw)
  To: sparclinux

Georg Chini wrote:

>
> David Miller wrote:
>
>> But it seems that nowadays the ISA CS4231 driver is using a value of
>> "64" for period_bytes_min.  Perhaps the Sparc driver should do that
>> too :-)
>>
>>
>>  
>>
> My machine seems too slow to handle this. With values less
> than 256 sound will not work properly. I think it starts missing
> interrupts.
>
>
Wrong again, I had some other problem when I tried 64. It works
fine, so please change the period_bytes_min to 64.

Regards
              Georg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and
  2006-12-29 22:16 Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Chini, Georg
                   ` (2 preceding siblings ...)
  2007-01-03 18:32 ` Chini, Georg
@ 2007-01-04  2:50 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2007-01-04  2:50 UTC (permalink / raw)
  To: sparclinux

From: "Chini, Georg" <georg.chini@hp.com>
Date: Wed, 03 Jan 2007 19:32:57 +0100

> Georg Chini wrote:
> 
> >
> > David Miller wrote:
> >
> >> But it seems that nowadays the ISA CS4231 driver is using a value of
> >> "64" for period_bytes_min.  Perhaps the Sparc driver should do that
> >> too :-)
> >>
> >>
> >>  
> >>
> > My machine seems too slow to handle this. With values less
> > than 256 sound will not work properly. I think it starts missing
> > interrupts.
> >
> >
> Wrong again, I had some other problem when I tried 64. It works
> fine, so please change the period_bytes_min to 64.

Great, thanks for testing.  I'll make the change.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-01-04  2:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-29 22:16 Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Chini, Georg
2007-01-03  5:37 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller
2007-01-03 12:38 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and initialisation Georg Chini
2007-01-03 18:32 ` Chini, Georg
2007-01-04  2:50 ` Third Try: [PATCH] cs4231 alsa driver: Fix IRQ and David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.