diff options
author | Donghwa Lee <dh09.lee@samsung.com> | 2014-01-03 10:03:34 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 11:46:08 +0900 |
commit | 2ed9f036739f9531805f9de7b8f2def67c5e1ed8 (patch) | |
tree | 553c34280751837cd292f78ac30c86c2663f39f8 /drivers/video | |
parent | 8946620311f047cca2fdafb469d57fb1cf154462 (diff) | |
download | linux-3.10-2ed9f036739f9531805f9de7b8f2def67c5e1ed8.tar.gz linux-3.10-2ed9f036739f9531805f9de7b8f2def67c5e1ed8.tar.bz2 linux-3.10-2ed9f036739f9531805f9de7b8f2def67c5e1ed8.zip |
video: display: s6e8aa0: adjust brightness value to driver level
Nevertheless there is only support 24 brightness steps in driver,
platform brightness status bar is suitable maximum size for 100.
Operation about brightness bar on the tizen looks that there is
something wrong. So I would adjust brightness value to driver's
brightness level.
Change-Id: Ia653a127b470208b0da9bc448f58422005e05d72
Signed-off-by: Donghwa Lee <dh09.lee@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/display/panel-s6e8aa0.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/video/display/panel-s6e8aa0.c b/drivers/video/display/panel-s6e8aa0.c index 1bfa30f0511..9f82a9cc58a 100644 --- a/drivers/video/display/panel-s6e8aa0.c +++ b/drivers/video/display/panel-s6e8aa0.c @@ -35,6 +35,7 @@ #include <video/panel-s6e8aa0.h> #define LDI_MTP_LENGTH 24 +#define MAX_BRIGHTNESS 100 #define GAMMA_LEVEL_NUM 25 #define GAMMA_TABLE_LEN 26 #define S6E8AA0_PANEL_COND_LEN 39 @@ -906,6 +907,16 @@ static int s6e8aa0_get_brightness(struct backlight_device *bd) return bd->props.brightness; } +static int s6e8aa0_convert_brightness(int brightness) +{ + if (brightness >= MAX_BRIGHTNESS) + return GAMMA_LEVEL_NUM - 1; + else if (brightness > 0) + return (brightness / 4); + else + return 0; +} + static int s6e8aa0_update_status(struct backlight_device *bd) { struct s6e8aa0 *lcd = bl_get_data(bd); @@ -914,7 +925,7 @@ static int s6e8aa0_update_status(struct backlight_device *bd) mutex_lock(&lcd->mutex); - lcd->brightness = bd->props.brightness; + lcd->brightness = s6e8aa0_convert_brightness(bd->props.brightness); if (lcd->entity.state != DISPLAY_ENTITY_STATE_ON) goto unlock; @@ -1342,8 +1353,8 @@ static int s6e8aa0_probe(struct platform_device *pdev) mutex_init(&lcd->mutex); - lcd->bd->props.max_brightness = GAMMA_LEVEL_NUM - 1; - lcd->bd->props.brightness = GAMMA_LEVEL_NUM - 1; + lcd->bd->props.max_brightness = MAX_BRIGHTNESS; + lcd->bd->props.brightness = MAX_BRIGHTNESS; lcd->brightness = GAMMA_LEVEL_NUM - 1; lcd->entity.of_node = pdev->dev.of_node; |