fbdev: sh_mobile_lcdc: Store the backlight brightness internally
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 15 Aug 2012 16:10:03 +0000 (18:10 +0200)
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 21 Nov 2012 14:50:01 +0000 (15:50 +0100)
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>
drivers/video/sh_mobile_lcdcfb.c
drivers/video/sh_mobile_lcdcfb.h

index c169581c3a72d3269cba6d47597209120b8f1757..dd8dd41b4acd5393d071880402419d1fa86934c8 100644 (file)
@@ -2282,6 +2282,7 @@ 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);
 }
 
@@ -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);
 
-       return ch->cfg->bl_info.get_brightness();
+       return ch->bl_brightness;
 }
 
 static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev,
index 0f92f6544b94907a7a51b503101c07a705421aed..f839adef1d90a58128a922b78bf28a21bd6d047b 100644 (file)
@@ -94,6 +94,7 @@ struct sh_mobile_lcdc_chan {
 
        /* Backlight */
        struct backlight_device *bl;
+       unsigned int bl_brightness;
 
        /* FB */
        struct fb_info *info;