[PATCH] Fix the current leaking issue on gta03 a3 or later version.

Matt Hsu matt_hsu at openmoko.org
Thu Feb 26 08:31:43 CET 2009


Since GPI0, GPI1 and GPI8 are for hardware version control.
They would create current leaking if they are setup as output.
It's resloved by adding gta03 specific fb_gpio_setup function
in fb platform data.

Signed-off-by: Matt Hsu <matt_hsu at openmoko.org>
Reported-by: Dkay Chen <dkay_chen at openmoko.com>
---
 arch/arm/mach-s3c6410/mach-om-gta03.c |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-s3c6410/mach-om-gta03.c b/arch/arm/mach-s3c6410/mach-om-gta03.c
index d9677aa..4f90239 100644
--- a/arch/arm/mach-s3c6410/mach-om-gta03.c
+++ b/arch/arm/mach-s3c6410/mach-om-gta03.c
@@ -449,8 +449,29 @@ static struct s3c_fb_pd_win om_gta03_fb_win0 = {
 	.default_bpp	= 16,
 };
 
+static void om_gta03_fb_gpio_setup(void)
+{
+	unsigned int gpio;
+
+	/* GPI0, GPI1, GPI8 are for hardware version contrl.
+	 * They should be set as input in order to prevent
+	 * current leaking
+	 */
+	for (gpio = S3C64XX_GPI(2); gpio <= S3C64XX_GPI(15); gpio++) {
+		if (gpio != S3C64XX_GPI(8)) {
+			s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+			s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+		}
+	}
+
+	for (gpio = S3C64XX_GPJ(0); gpio <= S3C64XX_GPJ(11); gpio++) {
+		s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
+		s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
+	}
+}
+
 static struct s3c_fb_platdata om_gta03_lcd_pdata __initdata = {
-	.setup_gpio	= s3c64xx_fb_gpio_setup_24bpp,
+	.setup_gpio	= om_gta03_fb_gpio_setup,
 	.win[0]		= &om_gta03_fb_win0,
 	.vidcon0	= VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
 	.vidcon1	= VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
-- 
1.5.6.5




More information about the openmoko-kernel mailing list