1 From 129f349dc3ee75dfb0580436d82fd0d6633ba2c4 Mon Sep 17 00:00:00 2001
2 From: warmcat <andy@warmcat.com>
3 Date: Sun, 13 Apr 2008 07:25:55 +0100
4 Subject: [PATCH] fix-gsm-download-irq-balance-issue.patch
6 Signed-off-by: Andy Green <andy@openmoko.com>
8 arch/arm/plat-s3c24xx/neo1973_pm_gsm.c | 28 +++++++++++++++++++++-------
9 1 files changed, 21 insertions(+), 7 deletions(-)
11 diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
12 index b4ea8ba..c3292b8 100644
13 --- a/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
14 +++ b/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
15 @@ -146,13 +146,24 @@ static ssize_t gsm_write(struct device *dev, struct device_attribute *attr,
17 #ifdef CONFIG_MACH_NEO1973_GTA02
18 if (machine_is_neo1973_gta02()) {
19 - /* FIXME: Layering violation, we know how this relates to
20 - * the Jack-IRQ. And we assume the keyboard driver to be
23 - disable_irq(gpio_to_irq(GTA02_GPIO_JACK_INSERT));
25 - enable_irq(gpio_to_irq(GTA02_GPIO_JACK_INSERT));
27 + * the keyboard / buttons driver requests and enables
28 + * the JACK_INSERT IRQ. We have to take care about
29 + * not enabling and disabling the IRQ when it was
30 + * already in that state or we get "unblanaced IRQ"
31 + * kernel warnings and stack dumps. So we use the
32 + * copy of the ndl_gsm state to figure out if we should
33 + * enable or disable the jack interrupt
36 + if (gta01_gsm.gpio_ndl_gsm)
37 + disable_irq(gpio_to_irq(
38 + GTA02_GPIO_JACK_INSERT));
40 + if (!gta01_gsm.gpio_ndl_gsm)
41 + enable_irq(gpio_to_irq(
42 + GTA02_GPIO_JACK_INSERT));
45 gta01_gsm.gpio_ndl_gsm = !on;
46 s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, !on);
47 @@ -263,7 +274,10 @@ static int __init gta01_gsm_probe(struct platform_device *pdev)
51 + /* note that download initially disabled, and enforce that */
52 gta01_gsm.gpio_ndl_gsm = 1;
53 + if (machine_is_neo1973_gta02())
54 + s3c2410_gpio_setpin(GTA02_GPIO_nDL_GSM, 1);
56 return sysfs_create_group(&pdev->dev.kobj, >a01_gsm_attr_group);