1 From 688df15bb534519e0698cc8e4a4d9234afd32105 Mon Sep 17 00:00:00 2001
2 From: Dmitry Baryshkov <dbaryshkov@gmail.com>
3 Date: Fri, 7 Nov 2008 15:50:39 +0300
4 Subject: [PATCH] pxa2xx-ac97: switch AC unit to correct state before probing
6 If AC97 unit is in partially enabled state, early request_irq can trigger
7 IRQ storm or even full hang up. Workaround this by forcibly switching ACLINK off
8 at the start of the probe.
10 Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
12 sound/soc/pxa/pxa2xx-ac97.c | 30 +++++++++++++++++-------------
13 1 files changed, 17 insertions(+), 13 deletions(-)
15 Index: linux-2.6.24/sound/soc/pxa/pxa2xx-ac97.c
16 ===================================================================
17 --- linux-2.6.24.orig/sound/soc/pxa/pxa2xx-ac97.c 2008-01-25 01:58:37.000000000 +0300
18 +++ linux-2.6.24/sound/soc/pxa/pxa2xx-ac97.c 2008-11-15 20:02:45.396976363 +0300
19 @@ -284,10 +284,6 @@ static int pxa2xx_ac97_probe(struct plat
23 - ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
27 pxa_gpio_mode(GPIO31_SYNC_AC97_MD);
28 pxa_gpio_mode(GPIO30_SDATA_OUT_AC97_MD);
29 pxa_gpio_mode(GPIO28_BITCLK_AC97_MD);
30 @@ -296,15 +292,23 @@ static int pxa2xx_ac97_probe(struct plat
31 /* Use GPIO 113 as AC97 Reset on Bulverde */
32 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
34 + GCR = GCR_ACLINK_OFF;
36 pxa_set_cken(CKEN_AC97, 1);
38 + ret = request_irq(IRQ_AC97, pxa2xx_ac97_irq, IRQF_DISABLED, "AC97", NULL);
46 - if (CKEN & (1 << CKEN_AC97)) {
48 +/* if (CKEN & (1 << CKEN_AC97)) {*/
49 GCR |= GCR_ACLINK_OFF;
50 free_irq(IRQ_AC97, NULL);
51 pxa_set_cken(CKEN_AC97, 0);