From 78d8b6b65cc769ee4b616974e27c443bb341ae07 Mon Sep 17 00:00:00 2001 From: litong20 Date: Tue, 25 Jan 2022 18:19:36 +0800 Subject: [PATCH] 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 Submit-Approved: Jira Key --- drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c index de32402f887a..78a09cb09ecb 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c @@ -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; }