diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-08-15 12:48:36 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-11-21 09:50:02 -0500 |
commit | d072c35edcfabe3159766d55252e16ed7864873e (patch) | |
tree | 7a01178869bb3f9947053e760bfab3c4b848bde1 /arch/sh/boards | |
parent | 37f4dd13505bab9f2bbd2f66a2c9375e959452eb (diff) |
sh: kfr2r09: Use the backlight API for brightness control
Don't hook up brightness control in the display on/off operations, use
the backlight API instead.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/boards')
-rw-r--r-- | arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 16 | ||||
-rw-r--r-- | arch/sh/boards/mach-kfr2r09/setup.c | 7 |
2 files changed, 8 insertions, 15 deletions
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c index c148b36ecb65..c62050332629 100644 --- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c +++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | |||
@@ -283,7 +283,7 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) | |||
283 | #define MAIN_MLED4 0x40 | 283 | #define MAIN_MLED4 0x40 |
284 | #define MAIN_MSW 0x80 | 284 | #define MAIN_MSW 0x80 |
285 | 285 | ||
286 | static int kfr2r09_lcd_backlight(int on) | 286 | int kfr2r09_lcd_set_brightness(int brightness) |
287 | { | 287 | { |
288 | struct i2c_adapter *a; | 288 | struct i2c_adapter *a; |
289 | struct i2c_msg msg; | 289 | struct i2c_msg msg; |
@@ -295,7 +295,7 @@ static int kfr2r09_lcd_backlight(int on) | |||
295 | return -ENODEV; | 295 | return -ENODEV; |
296 | 296 | ||
297 | buf[0] = 0x00; | 297 | buf[0] = 0x00; |
298 | if (on) | 298 | if (brightness) |
299 | buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW; | 299 | buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW; |
300 | else | 300 | else |
301 | buf[1] = 0; | 301 | buf[1] = 0; |
@@ -309,7 +309,7 @@ static int kfr2r09_lcd_backlight(int on) | |||
309 | return -ENODEV; | 309 | return -ENODEV; |
310 | 310 | ||
311 | buf[0] = 0x01; | 311 | buf[0] = 0x01; |
312 | if (on) | 312 | if (brightness) |
313 | buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c; | 313 | buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c; |
314 | else | 314 | else |
315 | buf[1] = 0; | 315 | buf[1] = 0; |
@@ -324,13 +324,3 @@ static int kfr2r09_lcd_backlight(int on) | |||
324 | 324 | ||
325 | return 0; | 325 | return 0; |
326 | } | 326 | } |
327 | |||
328 | void kfr2r09_lcd_on(void) | ||
329 | { | ||
330 | kfr2r09_lcd_backlight(1); | ||
331 | } | ||
332 | |||
333 | void kfr2r09_lcd_off(void) | ||
334 | { | ||
335 | kfr2r09_lcd_backlight(0); | ||
336 | } | ||
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index f2a4304fbe23..ab502f12ef57 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
@@ -158,8 +158,11 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = { | |||
158 | .height = 58, | 158 | .height = 58, |
159 | .setup_sys = kfr2r09_lcd_setup, | 159 | .setup_sys = kfr2r09_lcd_setup, |
160 | .start_transfer = kfr2r09_lcd_start, | 160 | .start_transfer = kfr2r09_lcd_start, |
161 | .display_on = kfr2r09_lcd_on, | 161 | }, |
162 | .display_off = kfr2r09_lcd_off, | 162 | .bl_info = { |
163 | .name = "sh_mobile_lcdc_bl", | ||
164 | .max_brightness = 1, | ||
165 | .set_brightness = kfr2r09_lcd_set_brightness, | ||
163 | }, | 166 | }, |
164 | .sys_bus_cfg = { | 167 | .sys_bus_cfg = { |
165 | .ldmt2r = 0x07010904, | 168 | .ldmt2r = 0x07010904, |