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

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>

authored by

Laurent Pinchart and committed by
Simon Horman
fe79f919 14bd03e0

+20 -17
+20 -17
arch/sh/boards/mach-ecovec24/setup.c
··· 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> ··· 304 303 .resource = usbhs_resources, 305 304 }; 306 305 307 - /* LCDC */ 306 + /* LCDC and backlight */ 308 307 static const struct fb_videomode ecovec_lcd_modes[] = { 309 308 { 310 309 .name = "Panel", ··· 335 334 }, 336 335 }; 337 336 338 - static int ecovec24_set_brightness(int brightness) 339 - { 340 - gpio_set_value(GPIO_PTR1, brightness); 341 - 342 - return 0; 343 - } 344 - 345 337 static struct sh_mobile_lcdc_info lcdc_info = { 346 338 .ch[0] = { 347 339 .interface_type = RGB18, ··· 343 349 .panel_cfg = { /* 7.0 inch */ 344 350 .width = 152, 345 351 .height = 91, 346 - }, 347 - .bl_info = { 348 - .name = "sh_mobile_lcdc_bl", 349 - .max_brightness = 1, 350 - .set_brightness = ecovec24_set_brightness, 351 352 }, 352 353 } 353 354 }; ··· 366 377 .resource = lcdc_resources, 367 378 .dev = { 368 379 .platform_data = &lcdc_info, 380 + }, 381 + }; 382 + 383 + static struct gpio_backlight_platform_data gpio_backlight_data = { 384 + .fbdev = &lcdc_device.dev, 385 + .gpio = GPIO_PTR1, 386 + .def_value = 1, 387 + .name = "backlight", 388 + }; 389 + 390 + static struct platform_device gpio_backlight_device = { 391 + .name = "gpio-backlight", 392 + .dev = { 393 + .platform_data = &gpio_backlight_data, 369 394 }, 370 395 }; 371 396 ··· 1052 1049 &usb1_common_device, 1053 1050 &usbhs_device, 1054 1051 &lcdc_device, 1052 + &gpio_backlight_device, 1055 1053 &ceu0_device, 1056 1054 &ceu1_device, 1057 1055 &keysc_device, ··· 1243 1239 1244 1240 gpio_request(GPIO_PTE6, NULL); 1245 1241 gpio_request(GPIO_PTU1, NULL); 1246 - gpio_request(GPIO_PTR1, NULL); 1247 1242 gpio_request(GPIO_PTA2, NULL); 1248 1243 gpio_direction_input(GPIO_PTE6); 1249 1244 gpio_direction_output(GPIO_PTU1, 0); 1250 - gpio_direction_output(GPIO_PTR1, 0); 1251 1245 gpio_direction_output(GPIO_PTA2, 0); 1252 1246 1253 1247 /* I/O buffer drive ability is high */ ··· 1258 1256 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes; 1259 1257 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes); 1260 1258 1259 + /* No backlight */ 1260 + gpio_backlight_data.fbdev = NULL; 1261 + 1261 1262 gpio_set_value(GPIO_PTA2, 1); 1262 1263 gpio_set_value(GPIO_PTU1, 1); 1263 1264 } else { ··· 1269 1264 lcdc_info.ch[0].clock_divider = 2; 1270 1265 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes; 1271 1266 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes); 1272 - 1273 - gpio_set_value(GPIO_PTR1, 1); 1274 1267 1275 1268 /* FIXME 1276 1269 *