aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-03-29 03:06:21 -0400
committerPaul Mundt <lethal@linux-sh.org>2011-03-29 03:06:21 -0400
commit1fcf0069f4715f6f811466db68a547a348b4d5a9 (patch)
tree00817872a00b162b493f65e5a90212ce54ba52ef /arch
parent53f358a81e10e798f44af896ffacaedd7ac0269b (diff)
parent247f99386100d1d1c369ba98120d2edebf5426fc (diff)
Merge branch 'common/fbdev' of master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c32
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c18
2 files changed, 42 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
159static 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
172static int ap320_wvga_get_brightness(void *board_data)
173{
174 return gpio_get_value(GPIO_PTS3);
175}
176
159static void ap320_wvga_power_on(void *board_data, struct fb_info *info) 177static 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
171static void ap320_wvga_power_off(void *board_data) 185static 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};
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index e44480ce2ea8..c68e2863bf86 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -263,6 +263,18 @@ const static struct fb_videomode ecovec_dvi_modes[] = {
263 }, 263 },
264}; 264};
265 265
266static int ecovec24_set_brightness(void *board_data, int brightness)
267{
268 gpio_set_value(GPIO_PTR1, brightness);
269
270 return 0;
271}
272
273static int ecovec24_get_brightness(void *board_data)
274{
275 return gpio_get_value(GPIO_PTR1);
276}
277
266static struct sh_mobile_lcdc_info lcdc_info = { 278static struct sh_mobile_lcdc_info lcdc_info = {
267 .ch[0] = { 279 .ch[0] = {
268 .interface_type = RGB18, 280 .interface_type = RGB18,
@@ -273,6 +285,12 @@ static struct sh_mobile_lcdc_info lcdc_info = {
273 .height = 91, 285 .height = 91,
274 }, 286 },
275 .board_cfg = { 287 .board_cfg = {
288 .set_brightness = ecovec24_set_brightness,
289 .get_brightness = ecovec24_get_brightness,
290 },
291 .bl_info = {
292 .name = "sh_mobile_lcdc_bl",
293 .max_brightness = 1,
276 }, 294 },
277 } 295 }
278}; 296};