diff options
author | Magnus Damm <damm@opensource.se> | 2011-03-21 07:49:45 +0000 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-23 22:57:02 +0900 |
commit | 1fbdfcdeac3ec49b5fbb5a882ed8ce3309a73b6d (patch) | |
tree | 703a9458ae3a25f901f53be5da27f170d2a5c8d8 | |
parent | 6447f55da90b77faec1697d499ed7986bb4f6de6 (diff) | |
download | kernel_samsung_aries-1fbdfcdeac3ec49b5fbb5a882ed8ce3309a73b6d.zip kernel_samsung_aries-1fbdfcdeac3ec49b5fbb5a882ed8ce3309a73b6d.tar.gz kernel_samsung_aries-1fbdfcdeac3ec49b5fbb5a882ed8ce3309a73b6d.tar.bz2 |
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>
-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 1a63c21..badd8ad 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[] = { }, }; +static int mackerel_set_brightness(void *board_data, int brightness) +{ + gpio_set_value(GPIO_PORT31, brightness); + + return 0; +} + +static int mackerel_get_brightness(void *board_data) +{ + return gpio_get_value(GPIO_PORT31); +} + static struct sh_mobile_lcdc_info lcdc_info = { .clock_source = LCDC_CLK_BUS, .ch[0] = { @@ -307,6 +319,14 @@ static struct sh_mobile_lcdc_info lcdc_info = { .flags = 0, .lcd_size_cfg.width = 152, .lcd_size_cfg.height = 91, + .board_cfg = { + .set_brightness = mackerel_set_brightness, + .get_brightness = mackerel_get_brightness, + }, + .bl_info = { + .name = "sh_mobile_lcdc_bl", + .max_brightness = 1, + }, } }; @@ -1059,7 +1079,7 @@ static void __init mackerel_init(void) gpio_request(GPIO_FN_LCDDCK, NULL); gpio_request(GPIO_PORT31, NULL); /* backlight */ - gpio_direction_output(GPIO_PORT31, 1); + gpio_direction_output(GPIO_PORT31, 0); /* off by default */ gpio_request(GPIO_PORT151, NULL); /* LCDDON */ gpio_direction_output(GPIO_PORT151, 1); |