Skip to content

Commit

Permalink
fbdev: sh_mobile_lcdc: Store the backlight brightness internally
Browse files Browse the repository at this point in the history
There's no need to query the hardware for the currenty brightness value
through a platform data callback when we can cache the value internally
in the LCDC driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
  • Loading branch information
Laurent Pinchart committed Nov 21, 2012
1 parent 074d0da commit 656d4f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/video/sh_mobile_lcdcfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2282,14 +2282,15 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
brightness = 0;

ch->bl_brightness = brightness;
return ch->cfg->bl_info.set_brightness(brightness);
}

static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev)
{
struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev);

return ch->cfg->bl_info.get_brightness();
return ch->bl_brightness;
}

static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
Expand Down
1 change: 1 addition & 0 deletions drivers/video/sh_mobile_lcdcfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ struct sh_mobile_lcdc_chan {

/* Backlight */
struct backlight_device *bl;
unsigned int bl_brightness;

/* FB */
struct fb_info *info;
Expand Down

0 comments on commit 656d4f3

Please sign in to comment.