diff options
| author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2013-07-04 15:13:28 -0400 |
|---|---|---|
| committer | Simon Horman <horms+renesas@verge.net.au> | 2013-07-16 21:06:17 -0400 |
| commit | fe79f919f47eabf6eae08414dcc078b0d89dfd8e (patch) | |
| tree | c9201aae397f0088793bb36cdfab90637de55a60 | |
| parent | 14bd03e08831a52035e601ae85b05a4849214ec4 (diff) | |
sh: ecovec24: Use gpio-backlight
Replace the backlight callback with a gpio-backlight platform device.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
| -rw-r--r-- | arch/sh/boards/mach-ecovec24/setup.c | 37 |
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 61fade0ffa96..bcbb86bd659e 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> |
| @@ -303,7 +304,7 @@ static struct platform_device usbhs_device = { | |||
| 303 | .resource = usbhs_resources, | 304 | .resource = usbhs_resources, |
| 304 | }; | 305 | }; |
| 305 | 306 | ||
| 306 | /* LCDC */ | 307 | /* LCDC and backlight */ |
| 307 | static const struct fb_videomode ecovec_lcd_modes[] = { | 308 | static const struct fb_videomode ecovec_lcd_modes[] = { |
| 308 | { | 309 | { |
| 309 | .name = "Panel", | 310 | .name = "Panel", |
| @@ -334,13 +335,6 @@ static const struct fb_videomode ecovec_dvi_modes[] = { | |||
| 334 | }, | 335 | }, |
| 335 | }; | 336 | }; |
| 336 | 337 | ||
| 337 | static int ecovec24_set_brightness(int brightness) | ||
| 338 | { | ||
| 339 | gpio_set_value(GPIO_PTR1, brightness); | ||
| 340 | |||
| 341 | return 0; | ||
| 342 | } | ||
| 343 | |||
| 344 | static struct sh_mobile_lcdc_info lcdc_info = { | 338 | static struct sh_mobile_lcdc_info lcdc_info = { |
| 345 | .ch[0] = { | 339 | .ch[0] = { |
| 346 | .interface_type = RGB18, | 340 | .interface_type = RGB18, |
| @@ -350,11 +344,6 @@ static struct sh_mobile_lcdc_info lcdc_info = { | |||
| 350 | .width = 152, | 344 | .width = 152, |
| 351 | .height = 91, | 345 | .height = 91, |
| 352 | }, | 346 | }, |
| 353 | .bl_info = { | ||
| 354 | .name = "sh_mobile_lcdc_bl", | ||
| 355 | .max_brightness = 1, | ||
| 356 | .set_brightness = ecovec24_set_brightness, | ||
| 357 | }, | ||
| 358 | } | 347 | } |
| 359 | }; | 348 | }; |
| 360 | 349 | ||
| @@ -380,6 +369,20 @@ static struct platform_device lcdc_device = { | |||
| 380 | }, | 369 | }, |
| 381 | }; | 370 | }; |
| 382 | 371 | ||
| 372 | static struct gpio_backlight_platform_data gpio_backlight_data = { | ||
| 373 | .fbdev = &lcdc_device.dev, | ||
| 374 | .gpio = GPIO_PTR1, | ||
| 375 | .def_value = 1, | ||
| 376 | .name = "backlight", | ||
| 377 | }; | ||
| 378 | |||
| 379 | static struct platform_device gpio_backlight_device = { | ||
| 380 | .name = "gpio-backlight", | ||
| 381 | .dev = { | ||
| 382 | .platform_data = &gpio_backlight_data, | ||
| 383 | }, | ||
| 384 | }; | ||
| 385 | |||
| 383 | /* CEU0 */ | 386 | /* CEU0 */ |
| 384 | static struct sh_mobile_ceu_info sh_mobile_ceu0_info = { | 387 | static struct sh_mobile_ceu_info sh_mobile_ceu0_info = { |
| 385 | .flags = SH_CEU_FLAG_USE_8BIT_BUS, | 388 | .flags = SH_CEU_FLAG_USE_8BIT_BUS, |
| @@ -1049,6 +1052,7 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
| 1049 | &usb1_common_device, | 1052 | &usb1_common_device, |
| 1050 | &usbhs_device, | 1053 | &usbhs_device, |
| 1051 | &lcdc_device, | 1054 | &lcdc_device, |
| 1055 | &gpio_backlight_device, | ||
| 1052 | &ceu0_device, | 1056 | &ceu0_device, |
| 1053 | &ceu1_device, | 1057 | &ceu1_device, |
| 1054 | &keysc_device, | 1058 | &keysc_device, |
| @@ -1239,11 +1243,9 @@ static int __init arch_setup(void) | |||
| 1239 | 1243 | ||
| 1240 | gpio_request(GPIO_PTE6, NULL); | 1244 | gpio_request(GPIO_PTE6, NULL); |
| 1241 | gpio_request(GPIO_PTU1, NULL); | 1245 | gpio_request(GPIO_PTU1, NULL); |
| 1242 | gpio_request(GPIO_PTR1, NULL); | ||
| 1243 | gpio_request(GPIO_PTA2, NULL); | 1246 | gpio_request(GPIO_PTA2, NULL); |
| 1244 | gpio_direction_input(GPIO_PTE6); | 1247 | gpio_direction_input(GPIO_PTE6); |
| 1245 | gpio_direction_output(GPIO_PTU1, 0); | 1248 | gpio_direction_output(GPIO_PTU1, 0); |
| 1246 | gpio_direction_output(GPIO_PTR1, 0); | ||
| 1247 | gpio_direction_output(GPIO_PTA2, 0); | 1249 | gpio_direction_output(GPIO_PTA2, 0); |
| 1248 | 1250 | ||
| 1249 | /* I/O buffer drive ability is high */ | 1251 | /* I/O buffer drive ability is high */ |
| @@ -1256,6 +1258,9 @@ static int __init arch_setup(void) | |||
| 1256 | lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes; | 1258 | lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes; |
| 1257 | lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes); | 1259 | lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes); |
| 1258 | 1260 | ||
| 1261 | /* No backlight */ | ||
| 1262 | gpio_backlight_data.fbdev = NULL; | ||
| 1263 | |||
| 1259 | gpio_set_value(GPIO_PTA2, 1); | 1264 | gpio_set_value(GPIO_PTA2, 1); |
| 1260 | gpio_set_value(GPIO_PTU1, 1); | 1265 | gpio_set_value(GPIO_PTU1, 1); |
| 1261 | } else { | 1266 | } else { |
| @@ -1265,8 +1270,6 @@ static int __init arch_setup(void) | |||
| 1265 | lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes; | 1270 | lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes; |
| 1266 | lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes); | 1271 | lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes); |
| 1267 | 1272 | ||
| 1268 | gpio_set_value(GPIO_PTR1, 1); | ||
| 1269 | |||
| 1270 | /* FIXME | 1273 | /* FIXME |
| 1271 | * | 1274 | * |
| 1272 | * LCDDON control is needed for Panel, | 1275 | * LCDDON control is needed for Panel, |
