backlight: add aw99703 map type for linear or exponential mode

add aw99703 map type configuration to support
linear or exponential mode.

Change-Id: Ie9ea130f1c6bbc6b3029520ccf8bd7e59a934cb2
Signed-off-by: tanhua1 <tanhua1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2034924
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Dezhen Hou <houdz1@motorola.com>
Reviewed-by: Shanshan Dai <daiss1@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
tanhua1 2021-08-06 14:34:26 +08:00 • committed by Hua Tan
commit 051bd1e0f8
2 changed files with 10 additions and 1 deletions

View file

@ -271,7 +271,7 @@ static int aw99703_backlight_init(struct aw99703_data *drvdata)
aw99703_i2c_write_bit(drvdata->client,
AW99703_REG_MODE,
AW99703_MODE_MAP_MASK,
AW99703_MODE_MAP_LINEAR);
drvdata->map_type);
/*default OVPSEL 38V*/
aw99703_i2c_write_bit(drvdata->client,
@ -509,6 +509,14 @@ aw99703_get_dt_data(struct device *dev, struct aw99703_data *drvdata)
else
pr_info("%s pwm_mode=%d\n", __func__, drvdata->pwm_mode);
rc = of_property_read_u32(np, "aw99703,map-type", &drvdata->map_type);
if (rc != 0) {
drvdata->map_type = AW99703_MODE_MAP_LINEAR;
pr_err("%s map-type not found\n", __func__);
}
else
pr_info("%s map-type=%d\n", __func__, drvdata->map_type);
drvdata->using_lsb = of_property_read_bool(np, "aw99703,using-lsb");
pr_info("%s using_lsb --<%d>\n", __func__, drvdata->using_lsb);

View file

@ -230,6 +230,7 @@ struct aw99703_data {
unsigned short *brt_code_table;
int hwen_gpio;
unsigned int pwm_mode;
unsigned int map_type;
bool using_lsb;
bool bl_reconfig_enable;
char panel_info[16];