aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
diff options
context:
space:
mode:
authorEric Bénard <eric@eukrea.com>2010-05-19 12:45:57 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2010-07-26 08:17:37 -0400
commitfc04ad0e326e82b90506b3cb83ddd58a6fb5b5d2 (patch)
treebc551fe75ebe01e97e7b80d365e0572ff1a33ee8 /arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
parent4eaad66adf607ba005e2cf118e9a542899bf0187 (diff)
eukrea_mbimx27-baseboard: add generic-bl and platform-lcd controls
Signed-off-by: Eric Bénard <eric@eukrea.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c')
-rw-r--r--arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c55
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 c9e4452e5dba..0f201c56fccf 100644
--- a/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
+++ b/arch/arm/mach-mx2/eukrea_mbimx27-baseboard.c
@@ -24,6 +24,8 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/spi/spi.h> 25#include <linux/spi/spi.h>
26#include <linux/spi/ads7846.h> 26#include <linux/spi/ads7846.h>
27#include <linux/backlight.h>
28#include <video/platform_lcd.h>
27 29
28#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
29 31
@@ -103,12 +105,6 @@ static struct gpio_led gpio_leds[] = {
103 .active_low = 1, 105 .active_low = 1,
104 .gpio = GPIO_PORTF | 19, 106 .gpio = GPIO_PORTF | 19,
105 }, 107 },
106 {
107 .name = "backlight",
108 .default_trigger = "backlight",
109 .active_low = 0,
110 .gpio = GPIO_PORTE | 5,
111 },
112}; 108};
113 109
114static struct gpio_led_platform_data gpio_led_info = { 110static struct gpio_led_platform_data gpio_led_info = {
@@ -153,6 +149,47 @@ static struct imx_fb_platform_data eukrea_mbimx27_fb_data = {
153 .dmacr = 0x00040060, 149 .dmacr = 0x00040060,
154}; 150};
155 151
152static void eukrea_mbimx27_bl_set_intensity(int intensity)
153{
154 if (intensity)
155 gpio_direction_output(GPIO_PORTE | 5, 1);
156 else
157 gpio_direction_output(GPIO_PORTE | 5, 0);
158}
159
160static struct generic_bl_info eukrea_mbimx27_bl_info = {
161 .name = "eukrea_mbimx27-bl",
162 .max_intensity = 0xff,
163 .default_intensity = 0xff,
164 .set_bl_intensity = eukrea_mbimx27_bl_set_intensity,
165};
166
167static struct platform_device eukrea_mbimx27_bl_dev = {
168 .name = "generic-bl",
169 .id = 1,
170 .dev = {
171 .platform_data = &eukrea_mbimx27_bl_info,
172 },
173};
174
175static void eukrea_mbimx27_lcd_power_set(struct plat_lcd_data *pd,
176 unsigned int power)
177{
178 if (power)
179 gpio_direction_output(GPIO_PORTA | 25, 1);
180 else
181 gpio_direction_output(GPIO_PORTA | 25, 0);
182}
183
184static struct plat_lcd_data eukrea_mbimx27_lcd_power_data = {
185 .set_power = eukrea_mbimx27_lcd_power_set,
186};
187
188static struct platform_device eukrea_mbimx27_lcd_powerdev = {
189 .name = "platform-lcd",
190 .dev.platform_data = &eukrea_mbimx27_lcd_power_data,
191};
192
156static struct imxuart_platform_data uart_pdata[] = { 193static struct imxuart_platform_data uart_pdata[] = {
157 { 194 {
158 .flags = IMXUART_HAVE_RTSCTS, 195 .flags = IMXUART_HAVE_RTSCTS,
@@ -244,6 +281,12 @@ void __init eukrea_mbimx27_baseboard_init(void)
244 mxc_gpio_mode(GPIO_PORTF | 19 | GPIO_GPIO | GPIO_OUT); 281 mxc_gpio_mode(GPIO_PORTF | 19 | GPIO_GPIO | GPIO_OUT);
245 /* Backlight */ 282 /* Backlight */
246 mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_OUT); 283 mxc_gpio_mode(GPIO_PORTE | 5 | GPIO_GPIO | GPIO_OUT);
284 gpio_request(GPIO_PORTE | 5, "backlight");
285 platform_device_register(&eukrea_mbimx27_bl_dev);
286 /* LCD Reset */
287 mxc_gpio_mode(GPIO_PORTA | 25 | GPIO_GPIO | GPIO_OUT);
288 gpio_request(GPIO_PORTA | 25, "lcd_enable");
289 platform_device_register(&eukrea_mbimx27_lcd_powerdev);
247 290
248 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 291 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
249} 292}