diff options
author | Magnus Damm <damm@opensource.se> | 2011-03-21 03:49:45 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-23 09:57:02 -0400 |
commit | 1fbdfcdeac3ec49b5fbb5a882ed8ce3309a73b6d (patch) | |
tree | 703a9458ae3a25f901f53be5da27f170d2a5c8d8 /arch/arm/mach-shmobile | |
parent | 6447f55da90b77faec1697d499ed7986bb4f6de6 (diff) |
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>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/board-mackerel.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c index 1a63c213e45d..badd8ada0659 100644 --- a/arch/arm/mach-shmobile/board-mackerel.c +++ b/arch/arm/mach-shmobile/board-mackerel.c | |||
@@ -295,6 +295,18 @@ static struct fb_videomode mackerel_lcdc_modes[] = { | |||
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 | static struct sh_mobile_lcdc_info lcdc_info = { | 310 | static struct sh_mobile_lcdc_info lcdc_info = { |
299 | .clock_source = LCDC_CLK_BUS, | 311 | .clock_source = LCDC_CLK_BUS, |
300 | .ch[0] = { | 312 | .ch[0] = { |
@@ -307,6 +319,14 @@ static struct sh_mobile_lcdc_info lcdc_info = { | |||
307 | .flags = 0, | 319 | .flags = 0, |
308 | .lcd_size_cfg.width = 152, | 320 | .lcd_size_cfg.width = 152, |
309 | .lcd_size_cfg.height = 91, | 321 | .lcd_size_cfg.height = 91, |
322 | .board_cfg = { | ||
323 | .set_brightness = mackerel_set_brightness, | ||
324 | .get_brightness = mackerel_get_brightness, | ||
325 | }, | ||
326 | .bl_info = { | ||
327 | .name = "sh_mobile_lcdc_bl", | ||
328 | .max_brightness = 1, | ||
329 | }, | ||
310 | } | 330 | } |
311 | }; | 331 | }; |
312 | 332 | ||
@@ -1059,7 +1079,7 @@ static void __init mackerel_init(void) | |||
1059 | gpio_request(GPIO_FN_LCDDCK, NULL); | 1079 | gpio_request(GPIO_FN_LCDDCK, NULL); |
1060 | 1080 | ||
1061 | gpio_request(GPIO_PORT31, NULL); /* backlight */ | 1081 | gpio_request(GPIO_PORT31, NULL); /* backlight */ |
1062 | gpio_direction_output(GPIO_PORT31, 1); | 1082 | gpio_direction_output(GPIO_PORT31, 0); /* off by default */ |
1063 | 1083 | ||
1064 | gpio_request(GPIO_PORT151, NULL); /* LCDDON */ | 1084 | gpio_request(GPIO_PORT151, NULL); /* LCDDON */ |
1065 | gpio_direction_output(GPIO_PORT151, 1); | 1085 | gpio_direction_output(GPIO_PORT151, 1); |