aboutsummaryrefslogtreecommitdiffstats
path: root/packages/linux/linux-rp-2.6.24/tosa/0001-pxa2xx-ac97-switch-AC-unit-to-correct-state-before.patch
blob: 09f0cb946ccb3f445c4b4071025f28593006c0f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From 688df15bb534519e0698cc8e4a4d9234afd32105 Mon Sep 17 00:00:00 2001
From: Dmitry Baryshkov <dbaryshkov@gmail.com>
Date: Fri, 7 Nov 2008 15:50:39 +0300
Subject: [PATCH] pxa2xx-ac97: switch AC unit to correct state before probing

If AC97 unit is in partially enabled state, early request_irq can trigger
IRQ storm or even full hang up. Workaround this by forcibly switching ACLINK off
at the start of the probe.

Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
---
 sound/soc/pxa/pxa2xx-ac97.c |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

Index: linux-2.6.24/sound/soc/pxa/pxa2xx-ac97.c
===================================================================
--- linux-2.6.24.orig/sound/soc/pxa/pxa2xx-ac97.c	2008-01-25 01:58:37.000000000 +0300
+++ linux-2.6.24/sound/soc/pxa/pxa2xx-ac97.c	2008-11-15 20:02:45.396976363 +0300
@@ -284,10 +284,6 @@ static int pxa2xx_ac97_probe(struct plat
 {
	int ret;

-	ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
-	if (ret < 0)
-		goto err;
-
	pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
	pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
	pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
@@ -296,15 +292,23 @@ static int pxa2xx_ac97_probe(struct plat
	/* Use GPIO 113 as AC97 Reset on Bulverde */
	pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
 #endif
+	GCR = GCR_ACLINK_OFF;
+
	pxa_set_cken(CKEN_AC97, 1);
+
+	ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
+	if (ret < 0)
+		goto err;
+
+
	return 0;

- err:
-	if (CKEN & (1 << CKEN_AC97)) {
+err:
+/*	if (CKEN & (1 << CKEN_AC97)) {*/
		GCR |= GCR_ACLINK_OFF;
		free_irq(IRQ_AC97, NULL);
		pxa_set_cken(CKEN_AC97, 0);
-	}
+/*	}*/
	return ret;
 }