41
41
#include <linux/mtd/physmap.h>
42
42
#include <linux/mtd/sh_flctl.h>
43
43
#include <linux/pinctrl/machine.h>
44
+ #include <linux/platform_data/gpio_backlight.h>
44
45
#include <linux/pm_clock.h>
45
46
#include <linux/regulator/fixed.h>
46
47
#include <linux/regulator/machine.h>
49
50
#include <linux/tca6416_keypad.h>
50
51
#include <linux/usb/renesas_usbhs.h>
51
52
#include <linux/dma-mapping.h>
52
-
53
53
#include <video/sh_mobile_hdmi.h>
54
54
#include <video/sh_mobile_lcdc.h>
55
55
#include <media/sh_mobile_ceu.h>
@@ -346,7 +346,7 @@ static struct platform_device meram_device = {
346
346
},
347
347
};
348
348
349
- /* LCDC */
349
+ /* LCDC and backlight */
350
350
static struct fb_videomode mackerel_lcdc_modes [] = {
351
351
{
352
352
.name = "WVGA Panel" ,
@@ -362,13 +362,6 @@ static struct fb_videomode mackerel_lcdc_modes[] = {
362
362
},
363
363
};
364
364
365
- static int mackerel_set_brightness (int brightness )
366
- {
367
- gpio_set_value (31 , brightness );
368
-
369
- return 0 ;
370
- }
371
-
372
365
static const struct sh_mobile_meram_cfg lcd_meram_cfg = {
373
366
.icb [0 ] = {
374
367
.meram_size = 0x40 ,
@@ -393,11 +386,6 @@ static struct sh_mobile_lcdc_info lcdc_info = {
393
386
.width = 152 ,
394
387
.height = 91 ,
395
388
},
396
- .bl_info = {
397
- .name = "sh_mobile_lcdc_bl" ,
398
- .max_brightness = 1 ,
399
- .set_brightness = mackerel_set_brightness ,
400
- },
401
389
.meram_cfg = & lcd_meram_cfg ,
402
390
}
403
391
};
@@ -425,6 +413,20 @@ static struct platform_device lcdc_device = {
425
413
},
426
414
};
427
415
416
+ static struct gpio_backlight_platform_data gpio_backlight_data = {
417
+ .fbdev = & lcdc_device .dev ,
418
+ .gpio = 31 ,
419
+ .def_value = 1 ,
420
+ .name = "backlight" ,
421
+ };
422
+
423
+ static struct platform_device gpio_backlight_device = {
424
+ .name = "gpio-backlight" ,
425
+ .dev = {
426
+ .platform_data = & gpio_backlight_data ,
427
+ },
428
+ };
429
+
428
430
/* HDMI */
429
431
static struct sh_mobile_hdmi_info hdmi_info = {
430
432
.flags = HDMI_SND_SRC_SPDIF ,
@@ -1231,6 +1233,7 @@ static struct platform_device *mackerel_devices[] __initdata = {
1231
1233
& nor_flash_device ,
1232
1234
& smc911x_device ,
1233
1235
& lcdc_device ,
1236
+ & gpio_backlight_device ,
1234
1237
& usbhs0_device ,
1235
1238
& usbhs1_device ,
1236
1239
& leds_device ,
@@ -1441,9 +1444,6 @@ static void __init mackerel_init(void)
1441
1444
ARRAY_SIZE (mackerel_pinctrl_map ));
1442
1445
sh7372_pinmux_init ();
1443
1446
1444
- /* backlight, off by default */
1445
- gpio_request_one (31 , GPIOF_OUT_INIT_LOW , NULL );
1446
-
1447
1447
gpio_request_one (151 , GPIOF_OUT_INIT_HIGH , NULL ); /* LCDDON */
1448
1448
1449
1449
/* USBHS0 */
0 commit comments