Skip to contentSkip to conversation

pxa/hx4700: fix the LCD initialization

PATCH New Philipp Zabel 2 participants 4 messages Mar 16, 2012 – Mar 19, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pxa/hx4700: fix the LCD initialization

Common sense and the SDG bootldr code reference dictate that N2.7V/7.3V be disabled here, and not LVDD, which already was disabled 10 ms earlier.
This should only have an effect if the LCD was enabled in the bootloader.

Cc Haojian Zhuang <[email protected]>
Cc Paul Parsons <[email protected]>
---
 arch/arm/mach-pxa/hx4700.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/hx4700.c +1 -1
index 61bb967..31c6dd1 100644
@@ -399,7 +399,7 @@ static void sony_lcd_init(void)
 	gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
 	mdelay(10);
 	gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
-	gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
+	gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 0);
 	mdelay(20);
 
 	gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1);
Signature · 1 line
1.7.9.1
#1 lore raw

PATCH 1/1 pxa/hx4700: fix the LCD initialization

Hello Philipp

Quoted 33 lines · Philipp Zabel

Common sense and the SDG bootldr code
reference dictate that
N2.7V/7.3V be disabled here, and not LVDD, which already was
disabled 10 ms earlier.
This should only have an effect if the LCD was enabled in the
bootloader.

Cc Haojian Zhuang <[email protected]>
Cc Paul Parsons <[email protected]>

---
arch/arm/mach-pxa/hx4700.c |? ? 2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-pxa/hx4700.c +1 -1
index 61bb967..31c6dd1 100644
@@ -399,7 +399,7 @@ static void sony_lcd_init(void)
 ??? gpio_set_value(GPIO62_HX4700_LCD_nRESET,
 0);
 ??? mdelay(10);
 ??? gpio_set_value(GPIO59_HX4700_LCD_PC1,
 0);
-???
 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
+???

gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 0);
??? mdelay(20);

Quoted 3 lines

???
gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1);

After some experimenting it seems that neither GPIO110 "LCD_LVDD_3V3_ON" nor GPIO112 "LCD_N2V7_7V3_ON" have any effect on the hx4700 LCD. After the hx4700 boots I can turn either one off, or both off together, and the LCD and touchscreen will continue to work normally.

Is there an authoritative description of the 7 "LCD" GPIOs (GPIO59, GPIO62, GPIO70, GPIO84, GPIO110, GPIO111, GPIO112) that are used by the kernel, or the 2 "LCD" GPIOs (GPIO22, GPIO73) that are not used? The SDG code provides no enlightenment.

Paul

#2 lore raw

PATCH 1/1 pxa/hx4700: fix the LCD initialization

Hi Paul,

Quoted 9 lines · Paul Parsons

After some experimenting it seems that neither GPIO110 "LCD_LVDD_3V3_ON" nor GPIO112 "LCD_N2V7_7V3_ON" have any effect on the hx4700 LCD. After the hx4700 boots I can turn either one off, or both off together, and the LCD and touchscreen will continue to work normally.

Is there an authoritative description of the 7 "LCD" GPIOs (GPIO59, GPIO62, GPIO70, GPIO84, GPIO110, GPIO111, GPIO112) that are used by the kernel, or the 2 "LCD" GPIOs (GPIO22, GPIO73) that are not used? The SDG code provides no enlightenment.

that is a good question. Not having done any of the reverse engineering for hx4700 myself, I've always taken the SDG code as gospel.
Unfortunately I am not aware of any hx4700 hardware schematics or even a datasheet for the acx523akm lcd panel.

regards
Philipp

#3 lore raw

PATCH 1/1 pxa/hx4700: fix the LCD initialization

Hello Philipp,

Quoted 21 lines · Philipp Zabel

Hi Paul,

Quoted 1 line · Paul Parsons

After some experimenting it seems that neither GPIO110

"LCD_LVDD_3V3_ON"

Quoted 1 line

nor GPIO112 "LCD_N2V7_7V3_ON" have any effect on the

hx4700 LCD.

Quoted 1 line

After the hx4700 boots I can turn either one off, or

both off together,

Quoted 1 line

and the LCD and touchscreen will continue to work

normally.

Quoted 2 lines

Is there an authoritative description of the 7 "LCD"

GPIOs (GPIO59,

Quoted 1 line

GPIO62, GPIO70, GPIO84, GPIO110, GPIO111, GPIO112) that

are used by

Quoted 1 line

the kernel, or the 2 "LCD" GPIOs (GPIO22, GPIO73) that

are not used?

Quoted 1 line

The SDG code provides no enlightenment.

Quoted 7 lines

that is a good question. Not having done any of the reverse engineering for hx4700 myself, I've always taken the SDG code as
gospel.
Unfortunately I am not aware of any hx4700 hardware schematics or even
a datasheet for the acx523akm lcd panel.

I too searched for an LCD datasheet without success.

Consider this patch for LCD initialization which I have been trying for the past couple of days:

1. Remove all references to GPIO110 and GPIO112.
2. Replace the first half of sony_lcd_init() with a one-time call to sony_lcd_off() in hx4700_init().

It saves 21 lines and establishes symmetry in the init()/off() calls.

arch/arm/mach-pxa/hx4700.c +7 -28
@@ -331,42 +331,20 @@ static struct platform_device egpio = {
 
 static void sony_lcd_init(void)
 {
-	gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
-	gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
-	gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 0);
-	gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 0);
-	gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
-	mdelay(10);
-	gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
-	gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
-	mdelay(20);
-
-	gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 1);
-	mdelay(5);
 	gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 1);
-
-	/* FIXME: init w3220 registers here */
-
-	mdelay(5);
+	gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
 	gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 1);
-	mdelay(10);
-	gpio_set_value(GPIO62_HX4700_LCD_nRESET, 1);
-	mdelay(10);
 	gpio_set_value(GPIO59_HX4700_LCD_PC1, 1);
-	mdelay(10);
-	gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 1);
+	gpio_set_value(GPIO62_HX4700_LCD_nRESET, 1);
 }
 
 static void sony_lcd_off(void)
 {
-	gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
 	gpio_set_value(GPIO62_HX4700_LCD_nRESET, 0);
-	mdelay(10);
-	gpio_set_value(GPIO112_HX4700_LCD_N2V7_7V3_ON, 0);
-	mdelay(10);
+	gpio_set_value(GPIO59_HX4700_LCD_PC1, 0);
+	gpio_set_value(GPIO70_HX4700_LCD_SLIN1, 0);
+	gpio_set_value(GPIO84_HX4700_LCD_SQN, 0);
 	gpio_set_value(GPIO111_HX4700_LCD_AVDD_3V3_ON, 0);
-	mdelay(10);
-	gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
 }
 
 #ifdef CONFIG_PM
@@ -825,7 +803,6 @@ static struct gpio global_gpios[] = {
 	{ GPIO62_HX4700_LCD_nRESET,       GPIOF_OUT_INIT_HIGH, "LCD_RESET" },
 	{ GPIO70_HX4700_LCD_SLIN1,        GPIOF_OUT_INIT_HIGH, "LCD_SLIN1" },
 	{ GPIO84_HX4700_LCD_SQN,          GPIOF_OUT_INIT_HIGH, "LCD_SQN" },
-	{ GPIO110_HX4700_LCD_LVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_LVDD" },
 	{ GPIO111_HX4700_LCD_AVDD_3V3_ON, GPIOF_OUT_INIT_HIGH, "LCD_AVDD" },
 	{ GPIO32_HX4700_RS232_ON,         GPIOF_OUT_INIT_HIGH, "RS232_ON" },
 	{ GPIO71_HX4700_ASIC3_nRESET,     GPIOF_OUT_INIT_HIGH, "ASIC3_nRESET" },
@@ -846,6 +823,8 @@ static void __init hx4700_init(void)
 	pxa_set_btuart_info(NULL);
 	pxa_set_stuart_info(NULL);
 
+	sony_lcd_off();
+
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 
 	pxa_set_ficp_info(&ficp_info);