From 75b0a4d48705c8a9d9dcf351a8c974f2133e9d90 Mon Sep 17 00:00:00 2001 From: litong20 Date: Wed, 16 Jun 2021 19:55:05 +0800 Subject: [PATCH] Need to update fw on resume for zero-flash touch IC. The kernel does not have permission to access the /data/vendor partition, so send the update firmware notify to touchUpg service on resume for zero-flash touch IC. avc: denied { search } for name="param" dev="dm-6" ino=275 scontext=u:r:kernel:s0 tcontext=u:object_r:param_data_file:s0 tclass=dir permissive=0 Change-Id: I5d5c9f39bab25a8d3377e0475e79a0411d93b56b Reviewed-on: https://gerrit.mot.com/1979786 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Konstantin Makariev Reviewed-by: Jichao Zou Reviewed-by: Jun Weng Submit-Approved: Jira Key --- .../touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c | 8 ++++++++ .../touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c | 5 +++++ include/linux/touchscreen_mmi.h | 1 + 3 files changed, 14 insertions(+) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c index 29fafccf2dc2..85cf7f3d8e34 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c @@ -186,6 +186,14 @@ static void ts_mmi_queued_resume(struct ts_mmi_dev *touch_cdev) if (atomic_cmpxchg(&touch_cdev->touch_stopped, 1, 0) == 0) return; +#ifdef TS_MMI_TOUCH_MULTIWAY_UPDATE_FW + if (touch_cdev->flash_mode == FW_PARAM_MODE &&\ + touch_cdev->pdata.fw_load_resume) { + dev_info(DEV_MMI, "%s: send sysfs notify to touchUpg\n", __func__); + sysfs_notify(touch_cdev->mdata->exports.kobj_notify, NULL, "flash_mode"); + } +#endif + TRY_TO_CALL(pre_resume); /* touch IC baseline update always done when IC resume. diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c index 8cbc1f392902..9fb489180c92 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c @@ -71,6 +71,11 @@ int ts_mmi_parse_dt(struct ts_mmi_dev *touch_cdev, dev_info(DEV_TS, "%s: using %u reset on resume\n", __func__, ppdata->reset); + if (of_property_read_bool(of_node, "mmi,fw-load-on-resume")) { + dev_info(DEV_TS, "%s: load firmware on resume\n", __func__); + ppdata->fw_load_resume = true; + } + if (of_property_read_bool(of_node, "mmi,power-off-suspend")) { dev_info(DEV_TS, "%s: using power off in suspend\n", __func__); ppdata->power_off_suspend = true; diff --git a/include/linux/touchscreen_mmi.h b/include/linux/touchscreen_mmi.h index aaa222040af6..c12d86b01bc8 100644 --- a/include/linux/touchscreen_mmi.h +++ b/include/linux/touchscreen_mmi.h @@ -340,6 +340,7 @@ struct ts_mmi_dev_pdata { bool update_refresh_rate; bool gestures_enabled; bool palm_enabled; + bool fw_load_resume; bool suppression_ctrl; bool pill_region_ctrl; bool hold_distance_ctrl;