30
30
#include <linux/spi/mmc_spi.h>
31
31
#include <linux/input.h>
32
32
#include <linux/input/sh_keysc.h>
33
+ #include <linux/platform_data/gpio_backlight.h>
33
34
#include <linux/sh_eth.h>
34
35
#include <linux/sh_intc.h>
35
36
#include <linux/videodev2.h>
@@ -303,7 +304,7 @@ static struct platform_device usbhs_device = {
303
304
.resource = usbhs_resources ,
304
305
};
305
306
306
- /* LCDC */
307
+ /* LCDC and backlight */
307
308
static const struct fb_videomode ecovec_lcd_modes [] = {
308
309
{
309
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
338
static struct sh_mobile_lcdc_info lcdc_info = {
345
339
.ch [0 ] = {
346
340
.interface_type = RGB18 ,
@@ -350,11 +344,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
350
344
.width = 152 ,
351
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
386
/* CEU0 */
384
387
static struct sh_mobile_ceu_info sh_mobile_ceu0_info = {
385
388
.flags = SH_CEU_FLAG_USE_8BIT_BUS ,
@@ -1049,6 +1052,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
1049
1052
& usb1_common_device ,
1050
1053
& usbhs_device ,
1051
1054
& lcdc_device ,
1055
+ & gpio_backlight_device ,
1052
1056
& ceu0_device ,
1053
1057
& ceu1_device ,
1054
1058
& keysc_device ,
@@ -1239,11 +1243,9 @@ static int __init arch_setup(void)
1239
1243
1240
1244
gpio_request (GPIO_PTE6 , NULL );
1241
1245
gpio_request (GPIO_PTU1 , NULL );
1242
- gpio_request (GPIO_PTR1 , NULL );
1243
1246
gpio_request (GPIO_PTA2 , NULL );
1244
1247
gpio_direction_input (GPIO_PTE6 );
1245
1248
gpio_direction_output (GPIO_PTU1 , 0 );
1246
- gpio_direction_output (GPIO_PTR1 , 0 );
1247
1249
gpio_direction_output (GPIO_PTA2 , 0 );
1248
1250
1249
1251
/* I/O buffer drive ability is high */
@@ -1256,6 +1258,9 @@ static int __init arch_setup(void)
1256
1258
lcdc_info .ch [0 ].lcd_modes = ecovec_dvi_modes ;
1257
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
1264
gpio_set_value (GPIO_PTA2 , 1 );
1260
1265
gpio_set_value (GPIO_PTU1 , 1 );
1261
1266
} else {
@@ -1265,8 +1270,6 @@ static int __init arch_setup(void)
1265
1270
lcdc_info .ch [0 ].lcd_modes = ecovec_lcd_modes ;
1266
1271
lcdc_info .ch [0 ].num_modes = ARRAY_SIZE (ecovec_lcd_modes );
1267
1272
1268
- gpio_set_value (GPIO_PTR1 , 1 );
1269
-
1270
1273
/* FIXME
1271
1274
*
1272
1275
* LCDDON control is needed for Panel,
0 commit comments