Commit d072c35e authored by Laurent Pinchart's avatar Laurent Pinchart

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 37f4dd13
...@@ -283,7 +283,7 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) ...@@ -283,7 +283,7 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
#define MAIN_MLED4 0x40 #define MAIN_MLED4 0x40
#define MAIN_MSW 0x80 #define MAIN_MSW 0x80
static int kfr2r09_lcd_backlight(int on) int kfr2r09_lcd_set_brightness(int brightness)
{ {
struct i2c_adapter *a; struct i2c_adapter *a;
struct i2c_msg msg; struct i2c_msg msg;
...@@ -295,7 +295,7 @@ static int kfr2r09_lcd_backlight(int on) ...@@ -295,7 +295,7 @@ static int kfr2r09_lcd_backlight(int on)
return -ENODEV; return -ENODEV;
buf[0] = 0x00; buf[0] = 0x00;
if (on) if (brightness)
buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW; buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW;
else else
buf[1] = 0; buf[1] = 0;
...@@ -309,7 +309,7 @@ static int kfr2r09_lcd_backlight(int on) ...@@ -309,7 +309,7 @@ static int kfr2r09_lcd_backlight(int on)
return -ENODEV; return -ENODEV;
buf[0] = 0x01; buf[0] = 0x01;
if (on) if (brightness)
buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c; buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c;
else else
buf[1] = 0; buf[1] = 0;
...@@ -324,13 +324,3 @@ static int kfr2r09_lcd_backlight(int on) ...@@ -324,13 +324,3 @@ static int kfr2r09_lcd_backlight(int on)
return 0; return 0;
} }
void kfr2r09_lcd_on(void)
{
kfr2r09_lcd_backlight(1);
}
void kfr2r09_lcd_off(void)
{
kfr2r09_lcd_backlight(0);
}
...@@ -158,8 +158,11 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = { ...@@ -158,8 +158,11 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
.height = 58, .height = 58,
.setup_sys = kfr2r09_lcd_setup, .setup_sys = kfr2r09_lcd_setup,
.start_transfer = kfr2r09_lcd_start, .start_transfer = kfr2r09_lcd_start,
.display_on = kfr2r09_lcd_on, },
.display_off = kfr2r09_lcd_off, .bl_info = {
.name = "sh_mobile_lcdc_bl",
.max_brightness = 1,
.set_brightness = kfr2r09_lcd_set_brightness,
}, },
.sys_bus_cfg = { .sys_bus_cfg = {
.ldmt2r = 0x07010904, .ldmt2r = 0x07010904,
......
...@@ -4,15 +4,13 @@ ...@@ -4,15 +4,13 @@
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE) #if defined(CONFIG_FB_SH_MOBILE_LCDC) || defined(CONFIG_FB_SH_MOBILE_LCDC_MODULE)
void kfr2r09_lcd_on(void); int kfr2r09_lcd_set_brightness(int brightness);
void kfr2r09_lcd_off(void);
int kfr2r09_lcd_setup(void *sys_ops_handle, int kfr2r09_lcd_setup(void *sys_ops_handle,
struct sh_mobile_lcdc_sys_bus_ops *sys_ops); struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
void kfr2r09_lcd_start(void *sys_ops_handle, void kfr2r09_lcd_start(void *sys_ops_handle,
struct sh_mobile_lcdc_sys_bus_ops *sys_ops); struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
#else #else
static void kfr2r09_lcd_on(void) {} static int kfr2r09_lcd_set_brightness(int brightness) {}
static void kfr2r09_lcd_off(void) {}
static int kfr2r09_lcd_setup(void *sys_ops_handle, static int kfr2r09_lcd_setup(void *sys_ops_handle,
struct sh_mobile_lcdc_sys_bus_ops *sys_ops) struct sh_mobile_lcdc_sys_bus_ops *sys_ops)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment