From df91ea22997c9ef23acb591bab52d582599dfe8f Mon Sep 17 00:00:00 2001 From: litong Date: Tue, 7 Jul 2020 19:43:05 +0800 Subject: [PATCH] Send the touchscreen status to display When the display and touch IC share power, we need to send the TP status in the gesture mode to notify the display to keep on powering. NO_PROP_NEEDED: Change-Id: I87b56d3d3712c956de88e09b2751f5c355fb7a9b Reviewed-on: https://gerrit.mot.com/1666974 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- .../touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c | 4 ++++ .../touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c | 5 +++++ include/linux/touchscreen_mmi.h | 1 + 3 files changed, 10 insertions(+) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c index 66d2ef1c70cc..cdd33957711f 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c @@ -63,6 +63,8 @@ static int ts_mmi_panel_off(struct ts_mmi_dev *touch_cdev) { dev_info(DEV_MMI, "%s: try to enter Gesture mode\n", __func__); TRY_TO_CALL(panel_state, touch_cdev->pm_mode, TS_MMI_PM_GESTURE); touch_cdev->pm_mode = TS_MMI_PM_GESTURE; + if (touch_cdev->pdata.notify_to_display) + touch_set_state(TS_MMI_PM_GESTURE, TOUCH_PANEL_IDX_PRIMARY); } } if (IS_ACTIVE_MODE) { @@ -71,6 +73,8 @@ static int ts_mmi_panel_off(struct ts_mmi_dev *touch_cdev) { TRY_TO_CALL(panel_state, touch_cdev->pm_mode, TS_MMI_PM_DEEPSLEEP); TRY_TO_CALL(drv_irq, TS_MMI_IRQ_OFF); touch_cdev->pm_mode = TS_MMI_PM_DEEPSLEEP; + if (touch_cdev->pdata.notify_to_display) + touch_set_state(TS_MMI_PM_DEEPSLEEP, TOUCH_PANEL_IDX_PRIMARY); } #ifdef TS_MMI_TOUCH_EDGE_GESTURE diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c index fdfd070b4501..d619f39f32cb 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_panel.c @@ -124,6 +124,11 @@ int ts_mmi_parse_dt(struct ts_mmi_dev *touch_cdev, ppdata->fps_detection = true; } + if (of_property_read_bool(of_node, "mmi,notify_to_display")) { + dev_info(DEV_TS, "%s: using notify to display\n", __func__); + ppdata->notify_to_display = true; + } + if (!of_property_read_u32_array(of_node, "mmi,max_coords", coords, 2)) { dev_info(DEV_TS, "%s: get max_coords property\n", __func__); ppdata->max_x = coords[0] - 1; diff --git a/include/linux/touchscreen_mmi.h b/include/linux/touchscreen_mmi.h index e7475f9e1132..5f91f3189085 100644 --- a/include/linux/touchscreen_mmi.h +++ b/include/linux/touchscreen_mmi.h @@ -285,6 +285,7 @@ struct ts_mmi_dev_pdata { bool gs_distance_ctrl; bool hold_grip_ctrl; bool poison_slot_ctrl; + bool notify_to_display; int max_x; int max_y; int ctrl_dsi;