Skip to content

Commit d9e2b6e

Browse files
brglLee Jones
authored andcommitted
sh: ecovec24: add additional properties to the backlight device
Add a GPIO lookup entry and a device property for GPIO backlight to the board file. Tie them to the platform device which is now registered using platform_device_register_full() because of the properties. These changes are inactive now but will be used once the gpio backlight driver is modified. Signed-off-by: Bartosz Golaszewski <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Tested-by: Jacopo Mondi <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 706dc68 commit d9e2b6e

File tree

1 file changed

+25
-5
lines changed
  • arch/sh/boards/mach-ecovec24

1 file changed

+25
-5
lines changed

arch/sh/boards/mach-ecovec24/setup.c

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,20 +371,35 @@ static struct platform_device lcdc_device = {
371371
},
372372
};
373373

374+
static struct gpiod_lookup_table gpio_backlight_lookup = {
375+
.dev_id = "gpio-backlight.0",
376+
.table = {
377+
GPIO_LOOKUP("sh7724_pfc", GPIO_PTR1, NULL, GPIO_ACTIVE_HIGH),
378+
{ }
379+
},
380+
};
381+
382+
static struct property_entry gpio_backlight_props[] = {
383+
PROPERTY_ENTRY_BOOL("default-on"),
384+
{ }
385+
};
386+
374387
static struct gpio_backlight_platform_data gpio_backlight_data = {
375388
.fbdev = &lcdc_device.dev,
376389
.gpio = GPIO_PTR1,
377390
.def_value = 1,
378391
.name = "backlight",
379392
};
380393

381-
static struct platform_device gpio_backlight_device = {
394+
static const struct platform_device_info gpio_backlight_device_info = {
382395
.name = "gpio-backlight",
383-
.dev = {
384-
.platform_data = &gpio_backlight_data,
385-
},
396+
.data = &gpio_backlight_data,
397+
.size_data = sizeof(gpio_backlight_data),
398+
.properties = gpio_backlight_props,
386399
};
387400

401+
static struct platform_device *gpio_backlight_device;
402+
388403
/* CEU0 */
389404
static struct ceu_platform_data ceu0_pdata = {
390405
.num_subdevs = 2,
@@ -1006,7 +1021,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
10061021
&usb1_common_device,
10071022
&usbhs_device,
10081023
&lcdc_device,
1009-
&gpio_backlight_device,
10101024
&keysc_device,
10111025
&cn12_power,
10121026
#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
@@ -1462,6 +1476,12 @@ static int __init arch_setup(void)
14621476
#endif
14631477
#endif
14641478

1479+
gpiod_add_lookup_table(&gpio_backlight_lookup);
1480+
gpio_backlight_device = platform_device_register_full(
1481+
&gpio_backlight_device_info);
1482+
if (IS_ERR(gpio_backlight_device))
1483+
return PTR_ERR(gpio_backlight_device);
1484+
14651485
return platform_add_devices(ecovec_devices,
14661486
ARRAY_SIZE(ecovec_devices));
14671487
}

0 commit comments

Comments
 (0)