From f62396d8e028fee4282940eab7169ab9d76e4ec1 Mon Sep 17 00:00:00 2001
From: z3deverp <z3@vmsv-debian.(none)>
Date: Wed, 18 Jun 2008 11:39:17 +0900
Subject: [PATCH] pxafb:Do not change mode of GPIO77

---
 drivers/video/Kconfig |    7 +++++++
 drivers/video/pxafb.c |   12 ++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 5b3dbcf..6f8bcd4 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1746,6 +1746,13 @@ config FB_PXA_PARAMETERS
 
 	  <file:Documentation/fb/pxafb.txt> describes the available parameters.
 
+config FB_PXA_NOTDRIVE_ACBIAS
+	bool
+	depends on FB_PXA
+	---help---
+	  Disable changing mode of GPIO77 to ACBIAS in pxafb driver
+	  for a certain machine.
+
 config FB_MBX
 	tristate "2700G LCD framebuffer support"
 	depends on FB && ARCH_PXA
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 10f912d..5e99a5b 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -821,7 +821,19 @@ static void pxafb_setup_gpio(struct pxafb_info *fbi)
 	pxa_gpio_mode(GPIO74_LCD_FCLK_MD);
 	pxa_gpio_mode(GPIO75_LCD_LCLK_MD);
 	pxa_gpio_mode(GPIO76_LCD_PCLK_MD);
+
+#ifdef CONFIG_FB_PXA_NOTDRIVE_ACBIAS
+	/*
+	 * Do not change mode of GPIO77 in pxafb driver for a certain machine.
+	 * 
+	 * Example, sha_pon007 :
+	 *   Another device drives ACBIAS(means OE in active mode) signal.
+	 *   GPIO77 is connected to LCD together, but GPIO77's mode is INPUT.
+	 */
+#else
+	/* Use GPIO77 as ACBIAS OUTPUT for many machines. */
 	pxa_gpio_mode(GPIO77_LCD_ACBIAS_MD);
+#endif
 }
 
 static void pxafb_enable_controller(struct pxafb_info *fbi)
-- 
1.4.4.4

