ARM: mach-shmobile: Dynamic backlight control for Mackerel

Use GPIO_PORT31 to control the backlight on the Mackerel board.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

authored by Magnus Damm and committed by Paul Mundt 1fbdfcde 6447f55d

+21 -1
+21 -1
arch/arm/mach-shmobile/board-mackerel.c
··· 295 295 }, 296 296 }; 297 297 298 + static int mackerel_set_brightness(void *board_data, int brightness) 299 + { 300 + gpio_set_value(GPIO_PORT31, brightness); 301 + 302 + return 0; 303 + } 304 + 305 + static int mackerel_get_brightness(void *board_data) 306 + { 307 + return gpio_get_value(GPIO_PORT31); 308 + } 309 + 298 310 static struct sh_mobile_lcdc_info lcdc_info = { 299 311 .clock_source = LCDC_CLK_BUS, 300 312 .ch[0] = { ··· 319 307 .flags = 0, 320 308 .lcd_size_cfg.width = 152, 321 309 .lcd_size_cfg.height = 91, 310 + .board_cfg = { 311 + .set_brightness = mackerel_set_brightness, 312 + .get_brightness = mackerel_get_brightness, 313 + }, 314 + .bl_info = { 315 + .name = "sh_mobile_lcdc_bl", 316 + .max_brightness = 1, 317 + }, 322 318 } 323 319 }; 324 320 ··· 1079 1059 gpio_request(GPIO_FN_LCDDCK, NULL); 1080 1060 1081 1061 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1082 - gpio_direction_output(GPIO_PORT31, 1); 1062 + gpio_direction_output(GPIO_PORT31, 0); /* off by default */ 1083 1063 1084 1064 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1085 1065 gpio_direction_output(GPIO_PORT151, 1);