From: Daniel Morsing <daniel.morsing@gmail.com>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-omap@vger.kernel.org, Thomas Weber <weber@corscience.de>,
Daniel Morsing <daniel.morsing@gmail.com>
Subject: [PATCH 3/3] omap3: devkit8000: Use generic gpio for second lcd enable
Date: Fri, 14 Jan 2011 01:03:29 +0100 [thread overview]
Message-ID: <1294963409-29891-4-git-send-email-daniel.morsing@gmail.com> (raw)
In-Reply-To: <1294963409-29891-1-git-send-email-daniel.morsing@gmail.com>
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.
Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com>
---
arch/arm/mach-omap2/board-devkit8000.c | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 8dc7a24..c1fdb1e 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -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");
--
1.7.3.4
next prev parent reply other threads:[~2011-01-14 0:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 0:03 [PATCH 0/3] omap3: devkit8000: misc fixes Daniel Morsing
2011-01-14 0:03 ` [PATCH 1/3] omap3: devkit8000: Fix indentation issue Daniel Morsing
2011-01-14 0:03 ` [PATCH 2/3] omap3: devkit8000: fix tps65930 pullup/pulldown configuration Daniel Morsing
2011-01-14 11:49 ` Daniel Morsing
2011-01-14 0:03 ` Daniel Morsing [this message]
2011-01-14 8:48 ` [PATCH 0/3] omap3: devkit8000: misc fixes Thomas Weber
2011-01-14 9:44 ` Daniel Morsing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294963409-29891-4-git-send-email-daniel.morsing@gmail.com \
--to=daniel.morsing@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=tony@atomide.com \
--cc=weber@corscience.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox