Close the calibration operation after fwupdate.

TP:
After the touch fwupate, if the config id is different
from before, the calibration operation will be tiggered.
But try not to add calibration operations in touch driver.

Change-Id: Id82c331c4617a03cb2351987380eae96d837fb7e
Reviewed-on: https://gerrit.mot.com/2002079
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2021-07-05 15:38:04 +08:00 • committed by litong
commit 17880786ac
2 changed files with 24 additions and 10 deletions

View file

@ -2857,6 +2857,7 @@ int fts_fw_update(struct fts_ts_info *info)
int error = 0;
int init_type = NO_INIT;
const char *firmware_name;
const struct fts_hw_platform_data *bdata = info->board;
#if defined(PRE_SAVED_METHOD) || defined (COMPUTE_INIT_METHOD)
int keep_cx = 1;
@ -2986,16 +2987,23 @@ int fts_fw_update(struct fts_ts_info *info)
init_type = NO_INIT;
}
if (init_type != NO_INIT) { /* initialization status not correct or
* after FW complete update, do
* initialization. */
error = fts_chip_initialization(info, init_type);
if (error < OK)
logError(1,
"%s %s Cannot initialize the chip ERROR %08X\n",
tag,
__func__, error);
/**
* Note: The fts_chip_initialization function contains the touchscreen calibration
* operation. We close the operation by default, plese be very careful to
* open it if necessary.
*/
if (bdata->need_tp_cal) {
if (init_type != NO_INIT) { /* initialization status not correct or
* after FW complete update, do
* initialization. */
logError(1, "%s Note: Do touch calibration...!\n", tag);
error = fts_chip_initialization(info, init_type);
if (error < OK)
logError(1,
"%s %s Cannot initialize the chip ERROR %08X\n",
tag,
__func__, error);
}
}
error = fts_init_sensing(info);
@ -3971,6 +3979,11 @@ static int parse_dt(struct device *dev, struct fts_hw_platform_data *bdata)
logError(0, "%s flip X\n", tag);
}
if (of_property_read_bool(np, "st,need_tp_cal")) {
bdata->need_tp_cal = true;
logError(0, "%s Need to do calibraion after fw upgrade");
}
if (of_property_read_u8_array(np, "st,interpolation_cmd",
bdata->interpolation_cmd, 10) == 0) {
bdata->interpolation_ctrl = true;

View file

@ -234,6 +234,7 @@ struct fts_hw_platform_data {
unsigned int y_max;
bool y_flip, x_flip;
bool power_on_suspend;
bool need_tp_cal;
u8 jitter_cmd[8]; /* /< support report rate switching */
bool jitter_ctrl; /* /< support report rate switching */
u8 linearity_cmd[3]; /* /< support report rate switching */