From de31178d74fe4ed22768ca3b5775535933d00e1e Mon Sep 17 00:00:00 2001 From: bchhq23 Date: Thu, 23 Dec 2021 18:07:34 +0800 Subject: [PATCH] rhodep:open charger mode; kernel/tp: open charger mode; wait probe is ok that send cmd; Change-Id: I186884262858227efdfcd5a6588b70e4414b1556 Signed-off-by: bchhq23 Reviewed-on: https://gerrit.mot.com/2153152 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jun Weng Reviewed-by: Hujun Liao Submit-Approved: Jira Key --- drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c | 6 ++++++ 1 file changed, 6 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 fc9ca4cd3de4..f649e80e33ce 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_mmi.c @@ -741,11 +741,17 @@ static int goodix_ts_mmi_methods_power(struct device *dev, int on) { static int goodix_ts_mmi_charger_mode(struct device *dev, int mode) { int ret = 0; + int timeout = 50; struct platform_device *pdev; struct goodix_ts_core *core_data; const struct goodix_ts_hw_ops *hw_ops; GET_GOODIX_DATA(dev); + + /* 5000ms timeout */ + while (core_data->init_stage < CORE_INIT_STAGE2 && timeout--) + msleep(100); + hw_ops = core_data->hw_ops; goodix_ts_send_cmd(core_data, CHARGER_MODE_CMD, 5, mode, 0x00);