diff options
author | Alexandre Courbot <gnurou@gmail.com> | 2011-02-15 22:49:03 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-03-10 06:32:55 -0500 |
commit | bacbe55b63d434b7a33f01a03628b6302c75417b (patch) | |
tree | d24f6755a9afb598b76fdacc3cf39819d3c0bf4a /arch | |
parent | 0839d687f35b2f1a5e15fe5ee03bc4918457798d (diff) |
sh: mach-ap325rxa: move backlight control code
Move the backlight control code into the appropriate hooks for the LCDC
driver.
Signed-off-by: Alexandre Courbot <gnurou@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sh/boards/mach-ap325rxa/setup.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index 3e5fc3bbf3ed..d695e43d3c6b 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -156,24 +156,34 @@ static struct platform_device nand_flash_device = { | |||
156 | #define PORT_DRVCRA 0xA405018A | 156 | #define PORT_DRVCRA 0xA405018A |
157 | #define PORT_DRVCRB 0xA405018C | 157 | #define PORT_DRVCRB 0xA405018C |
158 | 158 | ||
159 | static int ap320_wvga_set_brightness(void *board_data, int brightness) | ||
160 | { | ||
161 | if (brightness) { | ||
162 | gpio_set_value(GPIO_PTS3, 0); | ||
163 | __raw_writew(0x100, FPGA_BKLREG); | ||
164 | } else { | ||
165 | __raw_writew(0, FPGA_BKLREG); | ||
166 | gpio_set_value(GPIO_PTS3, 1); | ||
167 | } | ||
168 | |||
169 | return 0; | ||
170 | } | ||
171 | |||
172 | static int ap320_wvga_get_brightness(void *board_data) | ||
173 | { | ||
174 | return gpio_get_value(GPIO_PTS3); | ||
175 | } | ||
176 | |||
159 | static void ap320_wvga_power_on(void *board_data, struct fb_info *info) | 177 | static void ap320_wvga_power_on(void *board_data, struct fb_info *info) |
160 | { | 178 | { |
161 | msleep(100); | 179 | msleep(100); |
162 | 180 | ||
163 | /* ASD AP-320/325 LCD ON */ | 181 | /* ASD AP-320/325 LCD ON */ |
164 | __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); | 182 | __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); |
165 | |||
166 | /* backlight */ | ||
167 | gpio_set_value(GPIO_PTS3, 0); | ||
168 | __raw_writew(0x100, FPGA_BKLREG); | ||
169 | } | 183 | } |
170 | 184 | ||
171 | static void ap320_wvga_power_off(void *board_data) | 185 | static void ap320_wvga_power_off(void *board_data) |
172 | { | 186 | { |
173 | /* backlight */ | ||
174 | __raw_writew(0, FPGA_BKLREG); | ||
175 | gpio_set_value(GPIO_PTS3, 1); | ||
176 | |||
177 | /* ASD AP-320/325 LCD OFF */ | 187 | /* ASD AP-320/325 LCD OFF */ |
178 | __raw_writew(0, FPGA_LCDREG); | 188 | __raw_writew(0, FPGA_LCDREG); |
179 | } | 189 | } |
@@ -209,6 +219,12 @@ static struct sh_mobile_lcdc_info lcdc_info = { | |||
209 | .board_cfg = { | 219 | .board_cfg = { |
210 | .display_on = ap320_wvga_power_on, | 220 | .display_on = ap320_wvga_power_on, |
211 | .display_off = ap320_wvga_power_off, | 221 | .display_off = ap320_wvga_power_off, |
222 | .set_brightness = ap320_wvga_set_brightness, | ||
223 | .get_brightness = ap320_wvga_get_brightness, | ||
224 | }, | ||
225 | .bl_info = { | ||
226 | .name = "sh_mobile_lcdc_bl", | ||
227 | .max_brightness = 1, | ||
212 | }, | 228 | }, |
213 | } | 229 | } |
214 | }; | 230 | }; |