fbdev: sh_mobile_lcdc: Move brightness ops to sh_mobile_lcdc_bl_info
Update board code accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
018882aa66
commit
43059b0f46
arch
drivers/video
include/video
|
@ -391,13 +391,11 @@ static struct sh_mobile_lcdc_info lcdc_info = {
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.lcd_size_cfg.width = 152,
|
.lcd_size_cfg.width = 152,
|
||||||
.lcd_size_cfg.height = 91,
|
.lcd_size_cfg.height = 91,
|
||||||
.board_cfg = {
|
|
||||||
.set_brightness = mackerel_set_brightness,
|
|
||||||
.get_brightness = mackerel_get_brightness,
|
|
||||||
},
|
|
||||||
.bl_info = {
|
.bl_info = {
|
||||||
.name = "sh_mobile_lcdc_bl",
|
.name = "sh_mobile_lcdc_bl",
|
||||||
.max_brightness = 1,
|
.max_brightness = 1,
|
||||||
|
.set_brightness = mackerel_set_brightness,
|
||||||
|
.get_brightness = mackerel_get_brightness,
|
||||||
},
|
},
|
||||||
.meram_cfg = &lcd_meram_cfg,
|
.meram_cfg = &lcd_meram_cfg,
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,12 +220,12 @@ static struct sh_mobile_lcdc_info lcdc_info = {
|
||||||
.board_cfg = {
|
.board_cfg = {
|
||||||
.display_on = ap320_wvga_power_on,
|
.display_on = ap320_wvga_power_on,
|
||||||
.display_off = ap320_wvga_power_off,
|
.display_off = ap320_wvga_power_off,
|
||||||
.set_brightness = ap320_wvga_set_brightness,
|
|
||||||
.get_brightness = ap320_wvga_get_brightness,
|
|
||||||
},
|
},
|
||||||
.bl_info = {
|
.bl_info = {
|
||||||
.name = "sh_mobile_lcdc_bl",
|
.name = "sh_mobile_lcdc_bl",
|
||||||
.max_brightness = 1,
|
.max_brightness = 1,
|
||||||
|
.set_brightness = ap320_wvga_set_brightness,
|
||||||
|
.get_brightness = ap320_wvga_get_brightness,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -331,13 +331,11 @@ static struct sh_mobile_lcdc_info lcdc_info = {
|
||||||
.width = 152,
|
.width = 152,
|
||||||
.height = 91,
|
.height = 91,
|
||||||
},
|
},
|
||||||
.board_cfg = {
|
|
||||||
.set_brightness = ecovec24_set_brightness,
|
|
||||||
.get_brightness = ecovec24_get_brightness,
|
|
||||||
},
|
|
||||||
.bl_info = {
|
.bl_info = {
|
||||||
.name = "sh_mobile_lcdc_bl",
|
.name = "sh_mobile_lcdc_bl",
|
||||||
.max_brightness = 1,
|
.max_brightness = 1,
|
||||||
|
.set_brightness = ecovec24_set_brightness,
|
||||||
|
.get_brightness = ecovec24_get_brightness,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -1317,22 +1317,20 @@ static struct fb_ops sh_mobile_lcdc_ops = {
|
||||||
static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
|
static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
|
||||||
{
|
{
|
||||||
struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
|
struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
|
||||||
struct sh_mobile_lcdc_board_cfg *cfg = &ch->cfg.board_cfg;
|
|
||||||
int brightness = bdev->props.brightness;
|
int brightness = bdev->props.brightness;
|
||||||
|
|
||||||
if (bdev->props.power != FB_BLANK_UNBLANK ||
|
if (bdev->props.power != FB_BLANK_UNBLANK ||
|
||||||
bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
|
bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
|
||||||
brightness = 0;
|
brightness = 0;
|
||||||
|
|
||||||
return cfg->set_brightness(brightness);
|
return ch->cfg.bl_info.set_brightness(brightness);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
|
static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
|
||||||
{
|
{
|
||||||
struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
|
struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);
|
||||||
struct sh_mobile_lcdc_board_cfg *cfg = &ch->cfg.board_cfg;
|
|
||||||
|
|
||||||
return cfg->get_brightness();
|
return ch->cfg.bl_info.get_brightness();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
|
static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
|
||||||
|
|
|
@ -154,8 +154,6 @@ struct sh_mobile_lcdc_board_cfg {
|
||||||
struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
|
struct sh_mobile_lcdc_sys_bus_ops *sys_ops);
|
||||||
void (*display_on)(void);
|
void (*display_on)(void);
|
||||||
void (*display_off)(void);
|
void (*display_off)(void);
|
||||||
int (*set_brightness)(int brightness);
|
|
||||||
int (*get_brightness)(void);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
|
struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
|
||||||
|
@ -167,6 +165,8 @@ struct sh_mobile_lcdc_lcd_size_cfg { /* width and height of panel in mm */
|
||||||
struct sh_mobile_lcdc_bl_info {
|
struct sh_mobile_lcdc_bl_info {
|
||||||
const char *name;
|
const char *name;
|
||||||
int max_brightness;
|
int max_brightness;
|
||||||
|
int (*set_brightness)(int brightness);
|
||||||
|
int (*get_brightness)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sh_mobile_lcdc_chan_cfg {
|
struct sh_mobile_lcdc_chan_cfg {
|
||||||
|
|
Loading…
Reference in New Issue