modify backlight chip configration for black screen
authortanhua1 <tanhua1@lenovo.com>
Wed, 13 Feb 2019 11:57:37 +0000 (19:57 +0800)
committerxiest1 <xiest1@lenovo.com>
Tue, 5 Nov 2019 09:30:45 +0000 (17:30 +0800)
Modify Backlight driver PWM hysteresis from 4LSBs to 3LSBs.
Fix the backlight can not be turned on after resume.

Change-Id: I8cfbc450f9920085ccdd79c42fa949a0369ea99d
Signed-off-by: xingbin <xingbin@huaqin.com>
Reviewed-on: https://gerrit.mot.com/1308605
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

drivers/video/backlight/lm36923.c

index 2395472e1b1c79c9e477bba29b081736fcc5b636..7ce4c37d0b38a4a5c283b818cf3e2a39c7c88aa8 100755 (executable)
@@ -256,6 +256,16 @@ static int lm36923_resume(struct lm36923_data *dev_data)
            pr_err("%s: kzalloc error\n",__func__);\r
            return -ENOMEM;\r
     }\r
+       if(mutex_trylock(&dev_data->lock)==0){\r
+               pr_err("%s: lm36923 dev is busy\n",__func__);\r
+               goto exit;\r
+       }\r
+       ret = backlight_i2c_write(dev_data, LM_PWMCTL_REG, 0xEE);\r
+       if(ret < 0) {\r
+               pr_err("%s: write new value[0xEE] to reg[0x%x] error\n", __func__, LM_PWMCTL_REG);\r
+       }\r
+       mutex_unlock(&dev_data->lock);\r
+\r
     pr_info("%s:now write mode to %d\n",__func__,dev_data->mode);\r
     if(1 == dev_data->mode){\r
                if(mutex_trylock(&dev_data->lock)==0){\r
@@ -393,6 +403,10 @@ static int lm36923_probe(struct i2c_client *client,
         if(ret < 0){\r
             pr_err("%s:NR mode:write lm chip MSB error\n",__func__);\r
         }\r
+        ret = backlight_i2c_write(lm, LM_PWMCTL_REG, 0xEE);\r
+               if(ret < 0) {\r
+            pr_err("%s: write new value[0xEE] to reg[0x%x] error\n", __func__, LM_PWMCTL_REG);\r
+        }\r
         mutex_unlock(&lm->lock);\r
     }\r
     else{\r