r3840 - branches/src/target/kernel/2.6.24.x/patches

werner at sita.openmoko.org werner at sita.openmoko.org
Tue Jan 15 12:12:26 CET 2008


Author: werner
Date: 2008-01-15 12:12:21 +0100 (Tue, 15 Jan 2008)
New Revision: 3840

Modified:
   branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
   branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
Log:
Applied "detect-glamo-irq-pullup.patch"
http://git.openmoko.org/?p=kernel.git;a=commit;h=c6be860fc5bb86ae5af7e26b61dba43566d43d3c

Runtime detection of if the glamo IRQ# line is blessed with a pullup or not
GTA-02 < A5 do not have it but can be reworked

Signed-off-by: Andy Green <andy at openmoko.com>

gta02-core.patch:
- arch/arm/mach-s3c2440/mach-gta02.c (mangle_glamo_res_by_system_rev): removed
  mangling of interrupt resource for GTA02v4

smedia-glamo.patch:
- drivers/mfd/glamo/glamo-core.c (glamo_probe): added detection whether the
  INT# line works or not
- drivers/mfd/glamo/glamo-core.h (struct glamo_core): added field "irq_works",
  for INT# detection hack



Modified: branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch	2008-01-15 11:04:28 UTC (rev 3839)
+++ branches/src/target/kernel/2.6.24.x/patches/gta02-core.patch	2008-01-15 11:12:21 UTC (rev 3840)
@@ -1,7 +1,7 @@
-Index: linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
+Index: linux-2.6.24-rc7/arch/arm/mach-s3c2440/mach-gta02.c
 ===================================================================
 --- /dev/null
-+++ linux-2.6/arch/arm/mach-s3c2440/mach-gta02.c
++++ linux-2.6.24-rc7/arch/arm/mach-s3c2440/mach-gta02.c
 @@ -0,0 +1,710 @@
 +/*
 + * linux/arch/arm/mach-s3c2440/mach-gta02.c
@@ -619,7 +619,7 @@
 +	case GTA02v1_SYSTEM_REV:
 +	case GTA02v2_SYSTEM_REV:
 +	case GTA02v3_SYSTEM_REV:
-+	case GTA02v4_SYSTEM_REV:
++	/* case GTA02v4_SYSTEM_REV: - FIXME: handle this later */
 +		/* The hardware is missing a pull-up resistor and thus can't
 +		 * support the Smedia Glamo IRQ */
 +		gta02_glamo_resources[1].start = 0;
@@ -713,10 +713,10 @@
 +	.init_machine	= gta02_machine_init,
 +	.timer		= &s3c24xx_timer,
 +MACHINE_END
-Index: linux-2.6/include/asm-arm/arch-s3c2410/gta02.h
+Index: linux-2.6.24-rc7/include/asm-arm/arch-s3c2410/gta02.h
 ===================================================================
 --- /dev/null
-+++ linux-2.6/include/asm-arm/arch-s3c2410/gta02.h
++++ linux-2.6.24-rc7/include/asm-arm/arch-s3c2410/gta02.h
 @@ -0,0 +1,97 @@
 +#ifndef _GTA02_H
 +#define _GTA02_H
@@ -815,10 +815,10 @@
 +#define GTA02v3_IRQ_nGSM_OC	IRQ_EINT19	/* v3 + v4 only */
 +
 +#endif /* _GTA02_H */
-Index: linux-2.6/arch/arm/mach-s3c2440/Kconfig
+Index: linux-2.6.24-rc7/arch/arm/mach-s3c2440/Kconfig
 ===================================================================
---- linux-2.6.orig/arch/arm/mach-s3c2440/Kconfig
-+++ linux-2.6/arch/arm/mach-s3c2440/Kconfig
+--- linux-2.6.24-rc7.orig/arch/arm/mach-s3c2440/Kconfig
++++ linux-2.6.24-rc7/arch/arm/mach-s3c2440/Kconfig
 @@ -74,5 +74,20 @@
  	help
  	   Say Y here if you are using the FIC Neo1973 GSM Phone
@@ -840,19 +840,19 @@
 +
  endmenu
  
-Index: linux-2.6/arch/arm/mach-s3c2440/Makefile
+Index: linux-2.6.24-rc7/arch/arm/mach-s3c2440/Makefile
 ===================================================================
---- linux-2.6.orig/arch/arm/mach-s3c2440/Makefile
-+++ linux-2.6/arch/arm/mach-s3c2440/Makefile
+--- linux-2.6.24-rc7.orig/arch/arm/mach-s3c2440/Makefile
++++ linux-2.6.24-rc7/arch/arm/mach-s3c2440/Makefile
 @@ -22,3 +22,4 @@
  obj-$(CONFIG_ARCH_S3C2440)	+= mach-smdk2440.o
  obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
  obj-$(CONFIG_MACH_HXD8)		+= mach-hxd8.o
 +obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
-Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+Index: linux-2.6.24-rc7/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
 ===================================================================
---- linux-2.6.orig/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
-+++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+--- linux-2.6.24-rc7.orig/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
++++ linux-2.6.24-rc7/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
 @@ -19,7 +19,9 @@
  #include <linux/pcf50606.h>
  
@@ -970,10 +970,10 @@
  	/* we pull reset to low to make sure that the chip doesn't
  	 * drain power through the reset line */
  	s3c2410_gpio_setpin(GTA01_GPIO_BT_EN, 0);
-Index: linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+Index: linux-2.6.24-rc7/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
 ===================================================================
---- linux-2.6.orig/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
-+++ linux-2.6/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
+--- linux-2.6.24-rc7.orig/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
++++ linux-2.6.24-rc7/arch/arm/plat-s3c24xx/neo1973_pm_gsm.c
 @@ -19,8 +19,14 @@
  #include <linux/errno.h>
  
@@ -1082,10 +1082,10 @@
  
  	return sysfs_create_group(&pdev->dev.kobj, &gta01_gsm_attr_group);
  }
-Index: linux-2.6/drivers/leds/leds-neo1973-vibrator.c
+Index: linux-2.6.24-rc7/drivers/leds/leds-neo1973-vibrator.c
 ===================================================================
---- linux-2.6.orig/drivers/leds/leds-neo1973-vibrator.c
-+++ linux-2.6/drivers/leds/leds-neo1973-vibrator.c
+--- linux-2.6.24-rc7.orig/drivers/leds/leds-neo1973-vibrator.c
++++ linux-2.6.24-rc7/drivers/leds/leds-neo1973-vibrator.c
 @@ -107,7 +107,7 @@
  	struct resource *r;
  	int rc;
@@ -1095,10 +1095,10 @@
  		return -EIO;
  
  	r = platform_get_resource(pdev, 0, 0);
-Index: linux-2.6/sound/soc/s3c24xx/neo1973_wm8753.c
+Index: linux-2.6.24-rc7/sound/soc/s3c24xx/neo1973_wm8753.c
 ===================================================================
---- linux-2.6.orig/sound/soc/s3c24xx/neo1973_wm8753.c
-+++ linux-2.6/sound/soc/s3c24xx/neo1973_wm8753.c
+--- linux-2.6.24-rc7.orig/sound/soc/s3c24xx/neo1973_wm8753.c
++++ linux-2.6.24-rc7/sound/soc/s3c24xx/neo1973_wm8753.c
 @@ -672,6 +672,12 @@
  {
  	int ret;

Modified: branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch
===================================================================
--- branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch	2008-01-15 11:04:28 UTC (rev 3839)
+++ branches/src/target/kernel/2.6.24.x/patches/smedia-glamo.patch	2008-01-15 11:12:21 UTC (rev 3840)
@@ -508,7 +508,7 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24-rc7/drivers/mfd/glamo/glamo-core.c
-@@ -0,0 +1,1068 @@
+@@ -0,0 +1,1106 @@
 +/* Smedia Glamo 336x/337x driver
 + *
 + * (C) 2007 by OpenMoko, Inc.
@@ -561,6 +561,14 @@
 +#include "glamo-regs.h"
 +#include "glamo-core.h"
 +
++#ifndef UGLY_HACK_BE_GONE
++#ifdef CONFIG_MACH_NEO1973_GTA02
++#include <asm/arch/gpio.h>
++#include <asm/arch/regs-gpio.h>
++#include <asm/arch/regs-gpioj.h>
++#endif
++#endif /* UGLY_HACK_BE_GONE */
++
 +#define RESSIZE(ressource) (((ressource)->end - (ressource)->start)+1)
 +
 +static struct glamo_core *glamo_handle;
@@ -1385,6 +1393,7 @@
 +static int __init glamo_probe(struct platform_device *pdev)
 +{
 +	int rc, irq;
++	int count = 0;
 +	struct glamo_core *glamo;
 +
 +	if (glamo_handle) {
@@ -1494,7 +1503,36 @@
 +		set_irq_flags(irq, IRQF_VALID);
 +	}
 +
-+	if (!glamo->irq)
++#ifndef UGLY_HACK_BE_GONE
++	/*
++	* GTA-02 S-Media IRQs prior to A5 are broken due to a lack of
++	* a pullup on the INT# line.  Check for the bad behaviour.
++	*/
++	s3c2410_gpio_setpin(S3C2410_GPG4, 0);
++	s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_OUTP);
++	s3c2410_gpio_cfgpin(S3C2410_GPG4, S3C2410_GPG4_INP);
++	/*
++	* we force it low ourselves for a moment and resume being input.
++	* If there is a pullup, it won't stay low for long.  But if the
++	* level converter is there as on < A5 revision, the weak keeper
++	* on the input of the LC will hold the line low indefinitiely
++	*/
++	do {
++		rc = s3c2410_gpio_getpin(S3C2410_GPG4);
++	} while ((!rc) && ((count++) < 10));
++
++	if (rc) { /* it got pulled back up, it's good */
++		dev_info(&glamo->pdev->dev, "Detected S-Media IRQ# pullup, "
++		"enabling interrupt\n");
++		glamo->irq_works = 1;
++	} else { /* Gah we can't work with this level converter */
++		dev_warn(&glamo->pdev->dev, "** Detected bad IRQ# circuit found"
++		" on pre-A5 GTA-02: S-Media interrupt disabled **\n");
++		glamo->irq_works = 0;
++	}
++#endif /* UGLY_HACK_BE_GONE */
++
++	if (!glamo->irq || !glamo->irq_works)
 +		dev_warn(&glamo->pdev->dev, "No IRQ support on this hardware!\n");
 +	else {
 +		dev_dbg(&glamo->pdev->dev, "chained\n");
@@ -2359,12 +2397,13 @@
 ===================================================================
 --- /dev/null
 +++ linux-2.6.24-rc7/drivers/mfd/glamo/glamo-core.h
-@@ -0,0 +1,53 @@
+@@ -0,0 +1,54 @@
 +#ifndef __GLAMO_CORE_H
 +#define __GLAMO_CORE_H
 +
 +struct glamo_core {
 +	int irq;
++	int irq_works; /* 0 means PCB does not support Glamo IRQ - UGLY HACK */
 +	struct resource *mem;
 +	struct resource *mem_core;
 +	void __iomem *base;





More information about the commitlog mailing list