Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 656d4f33 authored by Laurent Pinchart's avatar Laurent Pinchart
Browse files

fbdev: sh_mobile_lcdc: Store the backlight brightness internally



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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 074d0da4
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2282,6 +2282,7 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev)
	    bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
	    bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
		brightness = 0;
		brightness = 0;


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


@@ -2289,7 +2290,7 @@ 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);


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


static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
+1 −0
Original line number Original line Diff line number Diff line
@@ -94,6 +94,7 @@ struct sh_mobile_lcdc_chan {


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


	/* FB */
	/* FB */
	struct fb_info *info;
	struct fb_info *info;