diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-08-15 12:10:03 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2012-11-21 09:50:01 -0500 |
commit | 656d4f332c02b14e62fe3f4247a1dcdc33961de6 (patch) | |
tree | 899b8e3bb7c5abb1283e5450c6c8e872884871f6 | |
parent | 074d0da486e2a5b8e80c35070ede7104f302f6da (diff) |
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 3 | ||||
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index c169581c3a72..dd8dd41b4acd 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -2282,6 +2282,7 @@ static int sh_mobile_lcdc_update_bl(struct backlight_device *bdev) | |||
2282 | bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) | 2282 | bdev->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) |
2283 | brightness = 0; | 2283 | brightness = 0; |
2284 | 2284 | ||
2285 | ch->bl_brightness = brightness; | ||
2285 | return ch->cfg->bl_info.set_brightness(brightness); | 2286 | return ch->cfg->bl_info.set_brightness(brightness); |
2286 | } | 2287 | } |
2287 | 2288 | ||
@@ -2289,7 +2290,7 @@ static int sh_mobile_lcdc_get_brightness(struct backlight_device *bdev) | |||
2289 | { | 2290 | { |
2290 | struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev); | 2291 | struct sh_mobile_lcdc_chan *ch = bl_get_data(bdev); |
2291 | 2292 | ||
2292 | return ch->cfg->bl_info.get_brightness(); | 2293 | return ch->bl_brightness; |
2293 | } | 2294 | } |
2294 | 2295 | ||
2295 | static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev, | 2296 | static int sh_mobile_lcdc_check_fb(struct backlight_device *bdev, |
diff --git a/drivers/video/sh_mobile_lcdcfb.h b/drivers/video/sh_mobile_lcdcfb.h index 0f92f6544b94..f839adef1d90 100644 --- a/drivers/video/sh_mobile_lcdcfb.h +++ b/drivers/video/sh_mobile_lcdcfb.h | |||
@@ -94,6 +94,7 @@ struct sh_mobile_lcdc_chan { | |||
94 | 94 | ||
95 | /* Backlight */ | 95 | /* Backlight */ |
96 | struct backlight_device *bl; | 96 | struct backlight_device *bl; |
97 | unsigned int bl_brightness; | ||
97 | 98 | ||
98 | /* FB */ | 99 | /* FB */ |
99 | struct fb_info *info; | 100 | struct fb_info *info; |