linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: eric@eukrea.com (Eric Bénard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 02/13] eukrea_mbimx27-baseboard: add generic-bl and platform-lcd controls
Date: Wed, 19 May 2010 18:45:57 +0200	[thread overview]
Message-ID: <1274287568-30253-2-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1274287568-30253-1-git-send-email-eric@eukrea.com>

Signed-off-by: Eric B?nard <eric@eukrea.com>
---
 arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c |   55 +++++++++++++++++++++++---
 1 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
index c9e4452..0f201c5 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -24,6 +24,8 @@
 #include <linux/platform_device.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/ads7846.h>
+#include <linux/backlight.h>
+#include <video/platform_lcd.h>
 
 #include <asm/mach/arch.h>
 
@@ -103,12 +105,6 @@ static struct gpio_led gpio_leds[] = {
 		.active_low		= 1,
 		.gpio			= GPIO_PORTF | 19,
 	},
-	{
-		.name			= "backlight",
-		.default_trigger	= "backlight",
-		.active_low		= 0,
-		.gpio			= GPIO_PORTE | 5,
-	},
 };
 
 static struct gpio_led_platform_data gpio_led_info = {
@@ -153,6 +149,47 @@ static struct imx_fb_platform_data eukrea_mbimx27_fb_data = {
 	.dmacr		= 0x00040060,
 };
 
+static void eukrea_mbimx27_bl_set_intensity(int intensity)
+{
+	if (intensity)
+		gpio_direction_output(GPIO_PORTE | 5, 1);
+	else
+		gpio_direction_output(GPIO_PORTE | 5, 0);
+}
+
+static struct generic_bl_info eukrea_mbimx27_bl_info = {
+	.name			= "eukrea_mbimx27-bl",
+	.max_intensity		= 0xff,
+	.default_intensity	= 0xff,
+	.set_bl_intensity	= eukrea_mbimx27_bl_set_intensity,
+};
+
+static struct platform_device eukrea_mbimx27_bl_dev = {
+	.name			= "generic-bl",
+	.id			= 1,
+	.dev = {
+		.platform_data	= &eukrea_mbimx27_bl_info,
+	},
+};
+
+static void eukrea_mbimx27_lcd_power_set(struct plat_lcd_data *pd,
+				   unsigned int power)
+{
+	if (power)
+		gpio_direction_output(GPIO_PORTA | 25, 1);
+	else
+		gpio_direction_output(GPIO_PORTA | 25, 0);
+}
+
+static struct plat_lcd_data eukrea_mbimx27_lcd_power_data = {
+	.set_power		= eukrea_mbimx27_lcd_power_set,
+};
+
+static struct platform_device eukrea_mbimx27_lcd_powerdev = {
+	.name			= "platform-lcd",
+	.dev.platform_data	= &eukrea_mbimx27_lcd_power_data,
+};
+
 static struct imxuart_platform_data uart_pdata[] = {
 	{
 		.flags = IMXUART_HAVE_RTSCTS,
@@ -244,6 +281,12 @@ void __init eukrea_mbimx27_baseboard_init(void)
 	mxc_gpio_mode(GPIO_PORTF | 19 | GPIO_GPIO | GPIO_OUT);
 	/* Backlight */
 	mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_OUT);
+	gpio_request(GPIO_PORTE | 5, "backlight");
+	platform_device_register(&eukrea_mbimx27_bl_dev);
+	/* LCD Reset */
+	mxc_gpio_mode(GPIO_PORTA | 25 | GPIO_GPIO | GPIO_OUT);
+	gpio_request(GPIO_PORTA | 25, "lcd_enable");
+	platform_device_register(&eukrea_mbimx27_lcd_powerdev);
 
 	platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
 }
-- 
1.6.3.3

  reply	other threads:[~2010-05-19 16:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 16:45 [PATCH 01/13] eukrea_mbimx27-baseboard: fix typo in display name Eric Bénard
2010-05-19 16:45 ` Eric Bénard [this message]
2010-05-19 16:45   ` [PATCH 03/13] eukrea_mbimx27-baseboard: add timings for DVI output Eric Bénard
2010-05-19 16:45     ` [PATCH 04/13] cpuimx27 and mbimx27: allow fine control of UART4 and SDHC2 usage Eric Bénard
2010-05-19 16:46       ` [PATCH 05/13] mach-cpuimx27: fix QuadUART's IRQ typo in pins'setup Eric Bénard
2010-05-19 16:46         ` [PATCH 06/13] eukrea_mbimx27: fix ADS7846 support Eric Bénard
2010-05-19 16:46           ` [PATCH 07/13] mach-cpuimx27: add USB Host2 and OTG support Eric Bénard
2010-05-19 16:46             ` [PATCH 08/13] mach-cpuimx27: register wdt and w1_master resources Eric Bénard
2010-05-19 16:46               ` [PATCH 09/13] mxcmmc: add card detect through DAT3 possibility Eric Bénard
2010-05-19 16:46                 ` [PATCH 10/13] eukrea_mbimx27: use card detect through DAT3 for SDHC1 Eric Bénard
2010-05-19 16:46                   ` [PATCH 11/13] MX2X: Add Keypad device definition for MX2X arch Eric Bénard
2010-05-19 16:46                     ` [PATCH 12/13] eukrea_mbimx27: add support for the keyboard Eric Bénard
2010-05-19 16:46                       ` [PATCH 13/13] mx27_defconfig: update to enable cpuimx27 & mbimx27 Eric Bénard
2010-05-19 17:11                 ` [PATCH 09/13] mxcmmc: add card detect through DAT3 possibility Daniel Mack
2010-05-19 17:21                   ` Eric Bénard
2010-05-19 17:23                     ` Daniel Mack
2010-05-27 17:54                 ` [PATCH] " Eric Bénard
2010-05-20  6:39           ` [PATCH 06/13] eukrea_mbimx27: fix ADS7846 support Sascha Hauer
2010-05-20  7:22             ` [PATCH v2] " Eric Bénard
2010-05-20  6:33   ` [PATCH 02/13] eukrea_mbimx27-baseboard: add generic-bl and platform-lcd controls Sascha Hauer

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=1274287568-30253-2-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).