]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.19.2/sound-sparc-cs4231-fix-irq-return-value-and-initialization.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.19.2 / sound-sparc-cs4231-fix-irq-return-value-and-initialization.patch
CommitLineData
2532c0bb
CW
1From stable-bounces@linux.kernel.org Thu Jan 4 17:10:49 2007
2Date: Thu, 04 Jan 2007 17:03:38 -0800 (PST)
3Message-Id: <20070104.170338.48396666.davem@davemloft.net>
4To: stable@kernel.org
5From: David Miller <davem@davemloft.net>
6Cc: bunk@stusta.de
7Subject: SOUND: Sparc CS4231: Fix IRQ return value and initialization.
8
9From: Georg Chini <georg.chini@triaton-webhosting.com>
10
11SBUS: Change IRQ-handler return value from 0 to IRQ_HANDLED and
12fix some initialisation problems.
13
14Change period_bytes_min from 4096 to 256 to allow driver to work with
15low latency (VOIP) applications. Hope this does not break EBUS.
16
17Signed-off-by: Georg Chini <georg.chini@triaton-webhosting.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Chris Wright <chrisw@sous-sol.org>
20---
21commit d35a1b9e10481c9f1d3b87e778a0f1f6a0a2dd48
22
23 sound/sparc/cs4231.c | 26 ++++++++++++--------------
24 1 file changed, 12 insertions(+), 14 deletions(-)
25
26--- linux-2.6.19.1.orig/sound/sparc/cs4231.c
27+++ linux-2.6.19.1/sound/sparc/cs4231.c
28@@ -1268,7 +1268,7 @@ static struct snd_pcm_hardware snd_cs423
29 .channels_min = 1,
30 .channels_max = 2,
31 .buffer_bytes_max = (32*1024),
32- .period_bytes_min = 4096,
33+ .period_bytes_min = 256,
34 .period_bytes_max = (32*1024),
35 .periods_min = 1,
36 .periods_max = 1024,
37@@ -1288,7 +1288,7 @@ static struct snd_pcm_hardware snd_cs423
38 .channels_min = 1,
39 .channels_max = 2,
40 .buffer_bytes_max = (32*1024),
41- .period_bytes_min = 4096,
42+ .period_bytes_min = 256,
43 .period_bytes_max = (32*1024),
44 .periods_min = 1,
45 .periods_max = 1024,
46@@ -1796,7 +1796,7 @@ static irqreturn_t snd_cs4231_sbus_inter
47 snd_cs4231_outm(chip, CS4231_IRQ_STATUS, ~CS4231_ALL_IRQS | ~status, 0);
48 spin_unlock_irqrestore(&chip->lock, flags);
49
50- return 0;
51+ return IRQ_HANDLED;
52 }
53
54 /*
55@@ -1821,7 +1821,6 @@ static int sbus_dma_request(struct cs423
56 if (!(csr & test))
57 goto out;
58 err = -EBUSY;
59- csr = sbus_readl(base->regs + APCCSR);
60 test = APC_XINT_CNVA;
61 if ( base->dir == APC_PLAY )
62 test = APC_XINT_PNVA;
63@@ -1862,17 +1861,16 @@ static void sbus_dma_enable(struct cs423
64
65 spin_lock_irqsave(&base->lock, flags);
66 if (!on) {
67- if (base->dir == APC_PLAY) {
68- sbus_writel(0, base->regs + base->dir + APCNVA);
69- sbus_writel(1, base->regs + base->dir + APCC);
70- }
71- else
72- {
73- sbus_writel(0, base->regs + base->dir + APCNC);
74- sbus_writel(0, base->regs + base->dir + APCVA);
75- }
76+ sbus_writel(0, base->regs + base->dir + APCNC);
77+ sbus_writel(0, base->regs + base->dir + APCNVA);
78+ sbus_writel(0, base->regs + base->dir + APCC);
79+ sbus_writel(0, base->regs + base->dir + APCVA);
80+
81+ /* ACK any APC interrupts. */
82+ csr = sbus_readl(base->regs + APCCSR);
83+ sbus_writel(csr, base->regs + APCCSR);
84 }
85- udelay(600);
86+ udelay(1000);
87 csr = sbus_readl(base->regs + APCCSR);
88 shift = 0;
89 if ( base->dir == APC_PLAY )