Skip to contentSkip to conversation

omap3: devkit8000: misc fixes

PATCH In review Daniel Morsing 2 participants 7 messages Jan 14, 2011

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

cover omap3: devkit8000: misc fixes

Here is a set of misc fixes for the devkit8000.

The only really notable one is the lcd enable gpio fix. It gets rid of some nasty low level twl4030 calls and replaces them with generic gpio calls. It also fixes a bug where the screen would not turn off when blanking.

Daniel Morsing (3):
omap3: devkit8000: Fix indentation issue
omap3: devkit8000: fix tps65930 pullup/pulldown configuration
omap3: devkit8000: Use generic gpio for second lcd enable

 arch/arm/mach-omap2/board-devkit8000.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)
Signature · 1 line
1.7.3.4
#1 lore raw

PATCH 1/3 omap3: devkit8000: Fix indentation issue

Comment line uses 8 spaces as indentation. Replace with a hard tab

---
 arch/arm/mach-omap2/board-devkit8000.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-devkit8000.c +1 -1
index 451e7ff..864a08f 100644
@@ -245,7 +245,7 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
 	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
 	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
-        /* gpio + 1 is "LCD_PWREN" (out, active high) */
+	/* gpio + 1 is "LCD_PWREN" (out, active high) */
 	devkit8000_lcd_device.reset_gpio = gpio + 1;
 	gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
 	/* Disable until needed */
Signature · 1 line
1.7.3.4
#2 lore raw

PATCH 2/3 omap3: devkit8000: fix tps65930 pullup/pulldown configuration

In reply to Daniel Morsing

gpio1 and gpio7 on the tps65930 are used as outputs on the devkit8000. Remove them from the pu/pd configuration.

---
 arch/arm/mach-omap2/board-devkit8000.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/board-devkit8000.c +2 -3
index 864a08f..8dc7a24 100644
@@ -265,9 +265,8 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
 	.irq_base	= TWL4030_GPIO_IRQ_BASE,
 	.irq_end	= TWL4030_GPIO_IRQ_END,
 	.use_leds	= true,
-	.pullups	= BIT(1),
-	.pulldowns	= BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
-				| BIT(15) | BIT(16) | BIT(17),
+	.pulldowns	= BIT(2) | BIT(6) | BIT(8) | BIT(13) | BIT(15)
+				| BIT(16) | BIT(17),
 	.setup		= devkit8000_twl_gpio_setup,
 };
 
Signature · 1 line
1.7.3.4
#3 lore raw

Re: [PATCH 2/3] omap3: devkit8000: fix tps65930 pullup/pulldown configuration

gpio7 on the tps65930 is used as an output on the devkit8000 and gpio1 is not connected. Remove gpio7 and change gpio1 to pulldown

---

Since Thomas pointed out that I am unable to read schemas, here's an updated fix.

 arch/arm/mach-omap2/board-devkit8000.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-devkit8000.c +1 -2
index 864a08f..81c8f38 100644
@@ -265,8 +265,7 @@ static struct twl4030_gpio_platform_data devkit8000_gpio_data = {
 	.irq_base	= TWL4030_GPIO_IRQ_BASE,
 	.irq_end	= TWL4030_GPIO_IRQ_END,
 	.use_leds	= true,
-	.pullups	= BIT(1),
-	.pulldowns	= BIT(2) | BIT(6) | BIT(7) | BIT(8) | BIT(13)
+	.pulldowns	= BIT(1) | BIT(2) | BIT(6) | BIT(8) | BIT(13)
 				| BIT(15) | BIT(16) | BIT(17),
 	.setup		= devkit8000_twl_gpio_setup,
 };
Signature · 1 line
1.7.3.4
#4 lore raw

PATCH 3/3 omap3: devkit8000: Use generic gpio for second lcd enable

In reply to Daniel Morsing

The Devkit8000 uses 2 gpios for the lcd enable line. twl4030_gpio1 and twl4030_ledA, with ledA configured as an output only gpio. gpio1 is used through the generic gpio functions while ledA is used via low level twl4030 calls. Remove the low level calls and use the generic gpio functions for initialization and use of ledA.

This also fixes a bug where the lcd would not power down when blanking.

---
 arch/arm/mach-omap2/board-devkit8000.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/board-devkit8000.c +17 -2
index 8dc7a24..c1fdb1e 100644
@@ -112,10 +112,16 @@ static struct omap2_hsmmc_info mmc[] = {
 	{}	/* Terminator */
 };
 
+/* This board uses 2 gpios for the lcd reset line, so use
+ * omap_dss_device.reset_gpio for storing one and this variable
+ * for storing the other.
+ */
+static int lcd_enable_gpio = -EINVAL; /* will be replaced */
+
 static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
 {
-	twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
-	twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
+	if (gpio_is_valid(lcd_enable_gpio))
+		gpio_set_value_cansleep(lcd_enable_gpio, 1);
 
 	if (gpio_is_valid(dssdev->reset_gpio))
 		gpio_set_value_cansleep(dssdev->reset_gpio, 1);
@@ -124,6 +130,9 @@ static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
 
 static void devkit8000_panel_disable_lcd(struct omap_dss_device *dssdev)
 {
+	if (gpio_is_valid(lcd_enable_gpio))
+		gpio_set_value_cansleep(lcd_enable_gpio, 0);
+
 	if (gpio_is_valid(dssdev->reset_gpio))
 		gpio_set_value_cansleep(dssdev->reset_gpio, 0);
 }
@@ -251,6 +260,12 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
 	/* Disable until needed */
 	gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
 
+	/* TWL4030_GPIO_MAX + 0 == ledA which is also "LCD_PWREN" */
+	lcd_enable_gpio = gpio + TWL4030_GPIO_MAX + 0;
+	gpio_request(lcd_enable_gpio, "LCD_PWREN");
+	/* Disable until needed */
+	gpio_direction_output(lcd_enable_gpio, 0);
+
 	/* gpio + 7 is "DVI_PD" (out, active low) */
 	devkit8000_dvi_device.reset_gpio = gpio + 7;
 	gpio_request(devkit8000_dvi_device.reset_gpio, "DVI PowerDown");
Signature · 1 line
1.7.3.4
#5 lore raw
In reply to Daniel Morsing

Am 14.01.2011 01:03, schrieb Daniel Morsing:

Quoted 7 lines

Here is a set of misc fixes for the devkit8000.

The only really notable one is the lcd enable gpio fix. It gets rid of some nasty low level twl4030 calls and replaces them with generic gpio calls. It also fixes a bug where the screen would not turn off when blanking.

Quoted 8 lines

Daniel Morsing (3):
omap3: devkit8000: Fix indentation issue
omap3: devkit8000: fix tps65930 pullup/pulldown configuration
omap3: devkit8000: Use generic gpio for second lcd enable

 arch/arm/mach-omap2/board-devkit8000.c |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

Hello Daniel,

the LCD_PWREN is connected to TWL4030 LEDA only. The TWL4030 GPIO.1 has a not connected resistor (R61).

My test case is:

# echo 0 > /sys/devices/omapdss/display0/enabled
# echo 1 > /sys/devices/omapdss/display0/enabled

I changed your patch the following way.
I think I cannot write a sign-off-by for you.

Thomas

-----

commit b93fb7d72993e20de4cedb9393dda793c88c7deb

Author: Daniel Morsing <[email protected]>
Date:   Fri Jan 14 00:03:29 2011 +0000

OMAP3: Devkit8000: Use generic gpio for lcd power pin

The reset_gpio pin for lcd is connected with TWL4030 LedA. The TWL4030 GPIO.1 has a not connected resistor in the line.

(quoted diff) +0 -0

b/arch/arm/mach-omap2/board-devkit8000.c
index 8dc7a24..54f1f7f 100644

arch/arm/mach-omap2/board-devkit8000.c +2 -5
@@ -114,9 +114,6 @@ static struct omap2_hsmmc_info mmc[] = {
 
 static int devkit8000_panel_enable_lcd(struct omap_dss_device *dssdev)
 {
-       twl_i2c_write_u8(TWL4030_MODULE_GPIO, 0x80, REG_GPIODATADIR1);
-       twl_i2c_write_u8(TWL4030_MODULE_LED, 0x0, 0x0);
-
        if (gpio_is_valid(dssdev->reset_gpio))
                gpio_set_value_cansleep(dssdev->reset_gpio, 1);
        return 0;
@@ -245,8 +242,8 @@ static int devkit8000_twl_gpio_setup(struct device *dev,
        /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
        gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
 
-       /* gpio + 1 is "LCD_PWREN" (out, active high) */
-       devkit8000_lcd_device.reset_gpio = gpio + 1;
+       /* TWL4030_GPIO_MAX + 0 is "LCD_PWREN" (out, active high) */
+       devkit8000_lcd_device.reset_gpio = gpio + TWL4030_GPIO_MAX + 0;
        gpio_request(devkit8000_lcd_device.reset_gpio, "LCD_PWREN");
        /* Disable until needed */
        gpio_direction_output(devkit8000_lcd_device.reset_gpio, 0);
#6 lore raw
Quoted 5 lines · Thomas Weber

Hello Daniel,

the LCD_PWREN is connected to TWL4030 LEDA only. The TWL4030 GPIO.1 has a not connected resistor (R61).

Quoted 7 lines

My test case is:

# echo 0 > /sys/devices/omapdss/display0/enabled
# echo 1 > /sys/devices/omapdss/display0/enabled

I changed your patch the following way.

I just checked and you are correct. This would also mean that the pullup/pulldown patch is incorrect since gpio.1 is now not connected and should be pulled down.

Quoted 1 line

I think I cannot write a sign-off-by for you.

Fine by me.

Quoted 1 line

Author: Daniel Morsing <[email protected]>

I don't think i can rightfully call myself the author of this patch anymore :)

Regards,
Daniel