aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards/mach-ecovec24/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/boards/mach-ecovec24/setup.c')
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index a4f630f04ea3..65dd81baa7f6 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -30,6 +30,7 @@
30#include <linux/spi/mmc_spi.h> 30#include <linux/spi/mmc_spi.h>
31#include <linux/input.h> 31#include <linux/input.h>
32#include <linux/input/sh_keysc.h> 32#include <linux/input/sh_keysc.h>
33#include <linux/platform_data/gpio_backlight.h>
33#include <linux/sh_eth.h> 34#include <linux/sh_eth.h>
34#include <linux/sh_intc.h> 35#include <linux/sh_intc.h>
35#include <linux/videodev2.h> 36#include <linux/videodev2.h>
@@ -302,7 +303,7 @@ static struct platform_device usbhs_device = {
302 .resource = usbhs_resources, 303 .resource = usbhs_resources,
303}; 304};
304 305
305/* LCDC */ 306/* LCDC and backlight */
306static const struct fb_videomode ecovec_lcd_modes[] = { 307static const struct fb_videomode ecovec_lcd_modes[] = {
307 { 308 {
308 .name = "Panel", 309 .name = "Panel",
@@ -333,13 +334,6 @@ static const struct fb_videomode ecovec_dvi_modes[] = {
333 }, 334 },
334}; 335};
335 336
336static int ecovec24_set_brightness(int brightness)
337{
338 gpio_set_value(GPIO_PTR1, brightness);
339
340 return 0;
341}
342
343static struct sh_mobile_lcdc_info lcdc_info = { 337static struct sh_mobile_lcdc_info lcdc_info = {
344 .ch[0] = { 338 .ch[0] = {
345 .interface_type = RGB18, 339 .interface_type = RGB18,
@@ -349,11 +343,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
349 .width = 152, 343 .width = 152,
350 .height = 91, 344 .height = 91,
351 }, 345 },
352 .bl_info = {
353 .name = "sh_mobile_lcdc_bl",
354 .max_brightness = 1,
355 .set_brightness = ecovec24_set_brightness,
356 },
357 } 346 }
358}; 347};
359 348
@@ -379,6 +368,20 @@ static struct platform_device lcdc_device = {
379 }, 368 },
380}; 369};
381 370
371static struct gpio_backlight_platform_data gpio_backlight_data = {
372 .fbdev = &lcdc_device.dev,
373 .gpio = GPIO_PTR1,
374 .def_value = 1,
375 .name = "backlight",
376};
377
378static struct platform_device gpio_backlight_device = {
379 .name = "gpio-backlight",
380 .dev = {
381 .platform_data = &gpio_backlight_data,
382 },
383};
384
382/* CEU0 */ 385/* CEU0 */
383static struct sh_mobile_ceu_info sh_mobile_ceu0_info = { 386static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
384 .flags = SH_CEU_FLAG_USE_8BIT_BUS, 387 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
@@ -1048,6 +1051,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
1048 &usb1_common_device, 1051 &usb1_common_device,
1049 &usbhs_device, 1052 &usbhs_device,
1050 &lcdc_device, 1053 &lcdc_device,
1054 &gpio_backlight_device,
1051 &ceu0_device, 1055 &ceu0_device,
1052 &ceu1_device, 1056 &ceu1_device,
1053 &keysc_device, 1057 &keysc_device,
@@ -1238,11 +1242,9 @@ static int __init arch_setup(void)
1238 1242
1239 gpio_request(GPIO_PTE6, NULL); 1243 gpio_request(GPIO_PTE6, NULL);
1240 gpio_request(GPIO_PTU1, NULL); 1244 gpio_request(GPIO_PTU1, NULL);
1241 gpio_request(GPIO_PTR1, NULL);
1242 gpio_request(GPIO_PTA2, NULL); 1245 gpio_request(GPIO_PTA2, NULL);
1243 gpio_direction_input(GPIO_PTE6); 1246 gpio_direction_input(GPIO_PTE6);
1244 gpio_direction_output(GPIO_PTU1, 0); 1247 gpio_direction_output(GPIO_PTU1, 0);
1245 gpio_direction_output(GPIO_PTR1, 0);
1246 gpio_direction_output(GPIO_PTA2, 0); 1248 gpio_direction_output(GPIO_PTA2, 0);
1247 1249
1248 /* I/O buffer drive ability is high */ 1250 /* I/O buffer drive ability is high */
@@ -1255,6 +1257,9 @@ static int __init arch_setup(void)
1255 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes; 1257 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes;
1256 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes); 1258 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes);
1257 1259
1260 /* No backlight */
1261 gpio_backlight_data.fbdev = NULL;
1262
1258 gpio_set_value(GPIO_PTA2, 1); 1263 gpio_set_value(GPIO_PTA2, 1);
1259 gpio_set_value(GPIO_PTU1, 1); 1264 gpio_set_value(GPIO_PTU1, 1);
1260 } else { 1265 } else {
@@ -1264,8 +1269,6 @@ static int __init arch_setup(void)
1264 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes; 1269 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes;
1265 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes); 1270 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes);
1266 1271
1267 gpio_set_value(GPIO_PTR1, 1);
1268
1269 /* FIXME 1272 /* FIXME
1270 * 1273 *
1271 * LCDDON control is needed for Panel, 1274 * LCDDON control is needed for Panel,