Solve the problem of sending command conflicts

TP:
When sending multiple commands at the same time, the ack signal of
unexpected commands may be read, resulting in command sending errors.

Change-Id: I6f222a20725f5adc1509a01bd29f972c3171e56d
Reviewed-on: https://gerrit.mot.com/2178632
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2022-01-25 18:19:36 +08:00 • committed by litong
commit 78d8b6b65c

View file

@ -781,12 +781,14 @@ static int goodix_ts_mmi_charger_mode(struct device *dev, int mode)
hw_ops = core_data->hw_ops;
mutex_lock(&core_data->mode_lock);
ret = goodix_ts_send_cmd(core_data, CHARGER_MODE_CMD, 5, mode, 0x00);
if (ret < 0) {
ts_err("Failed to set charger mode\n");
}
msleep(20);
ts_err("Success to %s charger mode\n", mode ? "Enable" : "Disable");
mutex_unlock(&core_data->mode_lock);
return 0;
}