Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: mach-shmobile: mackerel: 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>

authored by

Laurent Pinchart and committed by
Simon Horman
14bd03e0 67b43e59

+17 -17
+17 -17
arch/arm/mach-shmobile/board-mackerel.c
··· 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> ··· 50 49 #include <linux/tca6416_keypad.h> 51 50 #include <linux/usb/renesas_usbhs.h> 52 51 #include <linux/dma-mapping.h> 53 - 54 52 #include <video/sh_mobile_hdmi.h> 55 53 #include <video/sh_mobile_lcdc.h> 56 54 #include <media/sh_mobile_ceu.h> ··· 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", ··· 361 361 .sync = 0, 362 362 }, 363 363 }; 364 - 365 - static int mackerel_set_brightness(int brightness) 366 - { 367 - gpio_set_value(31, brightness); 368 - 369 - return 0; 370 - } 371 364 372 365 static const struct sh_mobile_meram_cfg lcd_meram_cfg = { 373 366 .icb[0] = { ··· 386 393 .width = 152, 387 394 .height = 91, 388 395 }, 389 - .bl_info = { 390 - .name = "sh_mobile_lcdc_bl", 391 - .max_brightness = 1, 392 - .set_brightness = mackerel_set_brightness, 393 - }, 394 396 .meram_cfg = &lcd_meram_cfg, 395 397 } 396 398 }; ··· 410 422 .dev = { 411 423 .platform_data = &lcdc_info, 412 424 .coherent_dma_mask = ~0, 425 + }, 426 + }; 427 + 428 + static struct gpio_backlight_platform_data gpio_backlight_data = { 429 + .fbdev = &lcdc_device.dev, 430 + .gpio = 31, 431 + .def_value = 1, 432 + .name = "backlight", 433 + }; 434 + 435 + static struct platform_device gpio_backlight_device = { 436 + .name = "gpio-backlight", 437 + .dev = { 438 + .platform_data = &gpio_backlight_data, 413 439 }, 414 440 }; 415 441 ··· 1233 1231 &nor_flash_device, 1234 1232 &smc911x_device, 1235 1233 &lcdc_device, 1234 + &gpio_backlight_device, 1236 1235 &usbhs0_device, 1237 1236 &usbhs1_device, 1238 1237 &leds_device, ··· 1443 1440 pinctrl_register_mappings(mackerel_pinctrl_map, 1444 1441 ARRAY_SIZE(mackerel_pinctrl_map)); 1445 1442 sh7372_pinmux_init(); 1446 - 1447 - /* backlight, off by default */ 1448 - gpio_request_one(31, GPIOF_OUT_INIT_LOW, NULL); 1449 1443 1450 1444 gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ 1451 1445