(CR):[Kane]:[factory]tm lcd adjust brightness
authorwangjiao <wangjiao1@huaqin.com>
Tue, 23 Oct 2018 08:43:56 +0000 (16:43 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:29:50 +0000 (17:29 +0800)
Change-Id: Icb096800756b924a126de96c9f7ec5cc9fce11d2
Signed-off-by: wangjiao <wangjiao1@huaqin.com>
drivers/video/fbdev/exynos/dpu20/panels/hix83112a_mipi_lcd.c

index 1ac640f504369ff32d607af8c57512e25c8a3ddc..8e6a1d2284a73fc3f91a1b648d511a5d24530868 100755 (executable)
@@ -141,14 +141,22 @@ static int hix83112a_get_backlight_level(int brightness)
        return backlightlevel;
 }
 
-unsigned char set_brightness_level[3] = {0x51, 0xFF, 0xFF};
+unsigned char set_brightness_level[3] = {0x51, 0x0F, 0xFF};
 static int hix83112a_update_brightness(int brightness)
 {
        int backlightlevel;
 
        backlightlevel = hix83112a_get_backlight_level(brightness);
 
-       pr_info("brightness [%d]\n", brightness);
+       if(brightness!=0){
+               set_brightness_level[1] = (unsigned char)((brightness*(0xFFF/0xFF)+0x0F)>>8);
+               set_brightness_level[2] = (unsigned char)((brightness*(0xFFF/0xFF)+0x0F)&0x0FF);
+       }else{
+               set_brightness_level[1] = 0x00;
+               set_brightness_level[2] = 0x00;
+       }
+
+       pr_info("brightness [%d]\n",brightness);
 
        if(dsim_wr_data(0, MIPI_DSI_DCS_LONG_WRITE,
                                (unsigned long)set_brightness_level, 3))