aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-07 15:49:17 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-07 15:49:17 -0400
commit132452ee2368cf775ccbef9746b51e3d2ba58b85 (patch)
tree68652e7a5d11776184e7b05c04dfc94baa429f2a /arch/sh
parent174457391a83d70215d441cb3bc0aa7d7443b63e (diff)
parent97fb85076c2d3adcc559dee577e0a3bf7215d48e (diff)
Merge branch 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6
* 'fbdev-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/fbdev-2.6: efifb: Add override for 11" Macbook Air 3,1 efifb: Support overriding fields FW tells us with the DMI data. fb: Reduce priority of resource conflict message savagefb: Remove obsolete else clause in savage_setup_i2c_bus savagefb: Set up I2C based on chip family instead of card id savagefb: Replace magic register address with define drivers/video/bfin-lq035q1-fb.c: introduce missing kfree video: s3c-fb: fix checkpatch errors and warning efifb: support AMD Radeon HD 6490 s3fb: fix Virge/GX2 fbcon: Remove unused 'display *p' variable from fb_flashcursor() fbdev: sh_mobile_lcdcfb: fix module lock acquisition fbdev: sh_mobile_lcdcfb: add blanking support viafb: initialize margins correct viafb: refresh rate bug collection sh: mach-ap325rxa: move backlight control code sh: mach-ecovec24: support for main lcd backlight
Diffstat (limited to 'arch/sh')
-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 636d8318a72a..618bd566cf53 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 30ae2e4283f0..86a0d565aded 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};