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 }, 296 }; 297 298 static struct sh_mobile_lcdc_info lcdc_info = { 299 .clock_source = LCDC_CLK_BUS, 300 .ch[0] = { ··· 319 .flags = 0, 320 .lcd_size_cfg.width = 152, 321 .lcd_size_cfg.height = 91, 322 } 323 }; 324 ··· 1079 gpio_request(GPIO_FN_LCDDCK, NULL); 1080 1081 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1082 - gpio_direction_output(GPIO_PORT31, 1); 1083 1084 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1085 gpio_direction_output(GPIO_PORT151, 1);
··· 295 }, 296 }; 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 + 310 static struct sh_mobile_lcdc_info lcdc_info = { 311 .clock_source = LCDC_CLK_BUS, 312 .ch[0] = { ··· 307 .flags = 0, 308 .lcd_size_cfg.width = 152, 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 + }, 318 } 319 }; 320 ··· 1059 gpio_request(GPIO_FN_LCDDCK, NULL); 1060 1061 gpio_request(GPIO_PORT31, NULL); /* backlight */ 1062 + gpio_direction_output(GPIO_PORT31, 0); /* off by default */ 1063 1064 gpio_request(GPIO_PORT151, NULL); /* LCDDON */ 1065 gpio_direction_output(GPIO_PORT151, 1);