mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] eukrea_cpuimx35: better usage of LCD enable pins
@ 2010-06-24 15:03 Eric Bénard
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Bénard @ 2010-06-24 15:03 UTC (permalink / raw)
  To: barebox

Use the enable hook to driver the LCD's enable pin.
Unfortunalty, because of the time the LCD takes to come out of
reset, I have to use a GPIO in order to turn on/off the backlight
instead of driving it from the enable function, else we get a
flicker at power on.

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 board/eukrea_cpuimx35/env/bin/init      |    2 ++
 board/eukrea_cpuimx35/eukrea_cpuimx35.c |   22 +++++++++++++---------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/board/eukrea_cpuimx35/env/bin/init b/board/eukrea_cpuimx35/env/bin/init
index 49e54c5..ff7c2d7 100644
--- a/board/eukrea_cpuimx35/env/bin/init
+++ b/board/eukrea_cpuimx35/env/bin/init
@@ -13,9 +13,11 @@ if [ -e /dev/nand0 ]; then
 fi
 
 if [ -f /env/logo.bmp ]; then
+	fb0.enable=1
 	bmp /env/logo.bmp
 elif [ -f /env/logo.bmp.lzo ]; then
 	unlzo /env/logo.bmp.lzo /logo.bmp
+	fb0.enable=1
 	bmp /logo.bmp
 fi
 
diff --git a/board/eukrea_cpuimx35/eukrea_cpuimx35.c b/board/eukrea_cpuimx35/eukrea_cpuimx35.c
index 6eeb4a3..756546a 100644
--- a/board/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/board/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -104,9 +104,15 @@ static struct fb_videomode imxfb_mode = {
 	.flag		= 0,
 };
 
+static void eukrea_cpuimx35_enable_display(int enable)
+{
+	gpio_direction_output(4, enable);
+}
+
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.mode		= &imxfb_mode,
 	.bpp		= 16,
+	.enable		= eukrea_cpuimx35_enable_display,
 };
 
 static struct device_d imxfb_dev = {
@@ -153,6 +159,7 @@ static int eukrea_cpuimx35_devices_init(void)
 	register_device(&fec_dev);
 
 	register_device(&sdram_dev);
+
 	register_device(&imxfb_dev);
 
 	armlinux_add_dram(&sdram_dev);
@@ -164,15 +171,6 @@ static int eukrea_cpuimx35_devices_init(void)
 
 device_initcall(eukrea_cpuimx35_devices_init);
 
-static int eukrea_cpuimx35_enable_display(void)
-{
-	gpio_direction_output(1, 1);
-	gpio_direction_output(0, 0);
-	return 0;
-}
-
-late_initcall(eukrea_cpuimx35_enable_display);
-
 static struct device_d eukrea_cpuimx35_serial_device = {
 	.name		= "imx_serial",
 	.map_base	= IMX_UART1_BASE,
@@ -207,6 +205,8 @@ static struct pad_desc eukrea_cpuimx35_pads[] = {
 	MX35_PAD_CTS1__UART1_CTS,
 
 	MX35_PAD_LD23__GPIO3_29,
+	MX35_PAD_CONTRAST__GPIO1_1,
+	MX35_PAD_D3_CLS__GPIO1_4,
 };
 
 static int eukrea_cpuimx35_console_init(void)
@@ -214,6 +214,10 @@ static int eukrea_cpuimx35_console_init(void)
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads,
 		ARRAY_SIZE(eukrea_cpuimx35_pads));
 
+	/* screen default on to prevent flicker */
+	gpio_direction_output(4, 1);
+	/* backlight default off */
+	gpio_direction_output(1, 0);
 	/* led default off */
 	gpio_direction_output(32 * 2 + 29, 1);
 
-- 
1.6.3.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] eukrea_cpuimx35: better usage of LCD enable pins
@ 2010-06-29 16:25 Eric Bénard
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Bénard @ 2010-06-29 16:25 UTC (permalink / raw)
  To: s.hauer; +Cc: barebox

Use the enable hook to driver the LCD's enable pin.
Unfortunalty, because of the time the LCD takes to come out of
reset, I have to use a GPIO in order to turn on/off the backlight
instead of driving it from the enable function, else we get a
flicker at power on.

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
v2 :
	update init script to turn backlight on (gpio 1)

 board/eukrea_cpuimx35/env/bin/init      |    4 ++++
 board/eukrea_cpuimx35/eukrea_cpuimx35.c |   22 +++++++++++++---------
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/board/eukrea_cpuimx35/env/bin/init b/board/eukrea_cpuimx35/env/bin/init
index 49e54c5..90007cd 100644
--- a/board/eukrea_cpuimx35/env/bin/init
+++ b/board/eukrea_cpuimx35/env/bin/init
@@ -13,10 +13,14 @@ if [ -e /dev/nand0 ]; then
 fi
 
 if [ -f /env/logo.bmp ]; then
+	fb0.enable=1
 	bmp /env/logo.bmp
+	gpio_direction_out 1 1
 elif [ -f /env/logo.bmp.lzo ]; then
 	unlzo /env/logo.bmp.lzo /logo.bmp
+	fb0.enable=1
 	bmp /logo.bmp
+	gpio_direction_out 1 1
 fi
 
 if [ -z $eth0.ethaddr ]; then
diff --git a/board/eukrea_cpuimx35/eukrea_cpuimx35.c b/board/eukrea_cpuimx35/eukrea_cpuimx35.c
index 6eeb4a3..756546a 100644
--- a/board/eukrea_cpuimx35/eukrea_cpuimx35.c
+++ b/board/eukrea_cpuimx35/eukrea_cpuimx35.c
@@ -104,9 +104,15 @@ static struct fb_videomode imxfb_mode = {
 	.flag		= 0,
 };
 
+static void eukrea_cpuimx35_enable_display(int enable)
+{
+	gpio_direction_output(4, enable);
+}
+
 static struct imx_ipu_fb_platform_data ipu_fb_data = {
 	.mode		= &imxfb_mode,
 	.bpp		= 16,
+	.enable		= eukrea_cpuimx35_enable_display,
 };
 
 static struct device_d imxfb_dev = {
@@ -153,6 +159,7 @@ static int eukrea_cpuimx35_devices_init(void)
 	register_device(&fec_dev);
 
 	register_device(&sdram_dev);
+
 	register_device(&imxfb_dev);
 
 	armlinux_add_dram(&sdram_dev);
@@ -164,15 +171,6 @@ static int eukrea_cpuimx35_devices_init(void)
 
 device_initcall(eukrea_cpuimx35_devices_init);
 
-static int eukrea_cpuimx35_enable_display(void)
-{
-	gpio_direction_output(1, 1);
-	gpio_direction_output(0, 0);
-	return 0;
-}
-
-late_initcall(eukrea_cpuimx35_enable_display);
-
 static struct device_d eukrea_cpuimx35_serial_device = {
 	.name		= "imx_serial",
 	.map_base	= IMX_UART1_BASE,
@@ -207,6 +205,8 @@ static struct pad_desc eukrea_cpuimx35_pads[] = {
 	MX35_PAD_CTS1__UART1_CTS,
 
 	MX35_PAD_LD23__GPIO3_29,
+	MX35_PAD_CONTRAST__GPIO1_1,
+	MX35_PAD_D3_CLS__GPIO1_4,
 };
 
 static int eukrea_cpuimx35_console_init(void)
@@ -214,6 +214,10 @@ static int eukrea_cpuimx35_console_init(void)
 	mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx35_pads,
 		ARRAY_SIZE(eukrea_cpuimx35_pads));
 
+	/* screen default on to prevent flicker */
+	gpio_direction_output(4, 1);
+	/* backlight default off */
+	gpio_direction_output(1, 0);
 	/* led default off */
 	gpio_direction_output(32 * 2 + 29, 1);
 
-- 
1.6.3.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-29 16:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-24 15:03 [PATCH] eukrea_cpuimx35: better usage of LCD enable pins Eric Bénard
2010-06-29 16:25 Eric Bénard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox