From 5c64bb1f675bf1c3bf53badb93e04cb01d5e3fd5 Mon Sep 17 00:00:00 2001 From: Konstantin Makariev Date: Mon, 6 Jan 2020 15:34:59 -0600 Subject: [PATCH] touchscreen_mmi: match panel notifier with control dsi In multiple display configuration, panel notifier will be called for each display. Control DSI associated with display is passed as a parameter to panel notifier and will only be actionable in the case when notification belongs to display. Change-Id: I6abbf2d34aaedd230ac1de79100babed20ed712b Signed-off-by: Konstantin Makariev Reviewed-on: https://gerrit.mot.com/1482868 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Konstantin Makariev Submit-Approved: Jira Key --- .../touchscreen_mmi/touchscreen_mmi_notif.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c index 2bd37d1e6737..621c502cd4b4 100644 --- a/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c +++ b/drivers/input/touchscreen/touchscreen_mmi/touchscreen_mmi_notif.c @@ -82,12 +82,24 @@ static int inline ts_mmi_panel_on(struct ts_mmi_dev *touch_cdev) { static int ts_mmi_panel_cb(struct notifier_block *nb, unsigned long event, void *evd) { + int idx = evd ? *(int *)evd : -1; struct ts_mmi_dev *touch_cdev = container_of(nb, struct ts_mmi_dev, panel_nb); if (!touch_cdev) return 0; +#if defined(CONFIG_PANEL_NOTIFICATIONS) + dev_dbg(DEV_MMI,"%s: %s event(%lu), ctrl_dsi=%d, idx=%d\n", __func__, + event == PANEL_EVENT_PRE_DISPLAY_OFF ? "PANEL_EVENT_PRE_DISPLAY_OFF" : + (event == PANEL_EVENT_DISPLAY_OFF ? "PANEL_EVENT_DISPLAY_OFF" : + (event == PANEL_EVENT_PRE_DISPLAY_ON ? "PANEL_EVENT_PRE_DISPLAY_ON" : + (event == PANEL_EVENT_DISPLAY_ON ? "PANEL_EVENT_DISPLAY_ON" : "Unknown"))), + event, touch_cdev->pdata.ctrl_dsi, idx); +#endif + if (touch_cdev->pdata.ctrl_dsi != idx) + return 0; + /* entering suspend upon early blank event */ /* to ensure shared power supply is still on */ /* for in-cell design touch solutions */