mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 04:42:04 -04:00
Support receiving dual-screen notifiactions.
Support receiving dual-screen notifications to support touch ic suspend and resume. Change-Id: I2af3fb7632ca164c85626957f42c0d3dca2af179 Reviewed-on: https://gerrit.mot.com/2188839 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jichao Zou <zoujc@motorola.com> Reviewed-by: <zhuwg1@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
08435d13fe
commit
12e78678a8
3 changed files with 25 additions and 16 deletions
|
|
@ -166,12 +166,12 @@ static void ts_mmi_panel_cb(enum panel_event_notifier_tag tag,
|
|||
event = notification->notif_type;
|
||||
evdata = notification->notif_data;
|
||||
|
||||
dev_dbg(DEV_MMI, "%s: %s Notify_type=%d, early=%d\n", __func__,
|
||||
dev_dbg(DEV_MMI, "%s: %s Notify_type=%d, early=%d, ctrl_dsi=%d\n", __func__,
|
||||
EVENT_PRE_DISPLAY_OFF ? "EVENT_PRE_DISPLAY_OFF" :
|
||||
(EVENT_DISPLAY_OFF ? "EVENT_DISPLAY_OFF" :
|
||||
(EVENT_PRE_DISPLAY_ON ? "EVENT_PRE_DISPLAY_ON" :
|
||||
(EVENT_DISPLAY_ON ? "EVENT_DISPLAY_ON" : "Unknown"))),
|
||||
event, (evdata.early_trigger ? 1 : 0));
|
||||
event, (evdata.early_trigger ? 1 : 0), touch_cdev->pdata.ctrl_dsi);
|
||||
|
||||
panel_event = EVENT_PRE_DISPLAY_OFF ? TS_MMI_EVENT_PRE_DISPLAY_OFF :
|
||||
(EVENT_DISPLAY_OFF ? TS_MMI_EVENT_DISPLAY_OFF :
|
||||
|
|
@ -349,7 +349,7 @@ static void ts_mmi_worker_func(struct work_struct *w)
|
|||
|
||||
case TS_MMI_TASK_INIT:
|
||||
#if defined (CONFIG_DRM_PANEL_NOTIFICATIONS) || defined (CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)
|
||||
ret = ts_mmi_check_drm_panel(DEV_TS->of_node);
|
||||
ret = ts_mmi_check_drm_panel(touch_cdev, DEV_TS->of_node);
|
||||
if (ret < 0) {
|
||||
dev_err(DEV_TS, "%s: check drm panel failed. %d\n", __func__, ret);
|
||||
touch_cdev->panel_status = -1;
|
||||
|
|
|
|||
|
|
@ -236,9 +236,8 @@ done:
|
|||
}
|
||||
|
||||
#if defined(CONFIG_DRM_PANEL_NOTIFICATIONS) || defined (CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)
|
||||
struct drm_panel *active_panel;
|
||||
|
||||
static int ts_mmi_check_dt(struct device_node *np)
|
||||
static int ts_mmi_check_dt(struct ts_mmi_dev *touch_cdev, struct device_node *np)
|
||||
{
|
||||
|
||||
int i = 0;
|
||||
|
|
@ -248,7 +247,7 @@ static int ts_mmi_check_dt(struct device_node *np)
|
|||
|
||||
count = of_count_phandle_with_args(np, "panel", NULL);
|
||||
if (count <= 0) {
|
||||
pr_err("%s: find drm_panel count(%d) fail", __func__, count);
|
||||
dev_err(DEV_TS, "%s: find drm_panel count(%d) fail", __func__, count);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -257,12 +256,12 @@ static int ts_mmi_check_dt(struct device_node *np)
|
|||
panel = of_drm_find_panel(node);
|
||||
of_node_put(node);
|
||||
if (!IS_ERR(panel)) {
|
||||
pr_info("%s: find drm_panel successfully", __func__);
|
||||
active_panel = panel;
|
||||
dev_info(DEV_TS, "%s: find drm_panel successfully", __func__);
|
||||
touch_cdev->active_panel = panel;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
pr_err("%s: No find drm_panel", __func__);
|
||||
dev_err(DEV_TS, "%s: No find drm_panel", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
|
@ -311,13 +310,13 @@ out:
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ts_mmi_check_drm_panel(struct device_node *of_node)
|
||||
int ts_mmi_check_drm_panel(struct ts_mmi_dev* touch_cdev, struct device_node *of_node)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = ts_mmi_check_dt(of_node);
|
||||
ret = ts_mmi_check_dt(touch_cdev, of_node);
|
||||
if (ret) {
|
||||
pr_err( "%s: parse drm-panel fail\n", __func__);
|
||||
dev_err(DEV_TS, "%s: parse drm-panel fail\n", __func__);
|
||||
if (!ts_mmi_check_default_tp(of_node, "qcom,mmi-touch-active"))
|
||||
ret = -EPROBE_DEFER;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -59,9 +59,16 @@ extern struct drm_panel *active_panel;
|
|||
|
||||
#define REGISTER_PANEL_NOTIFIER { \
|
||||
void *cookie = NULL; \
|
||||
cookie = panel_event_notifier_register(PANEL_EVENT_NOTIFICATION_PRIMARY, \
|
||||
PANEL_EVENT_NOTIFIER_CLIENT_PRIMARY_TOUCH, active_panel, \
|
||||
&ts_mmi_panel_cb, touch_cdev); \
|
||||
struct ts_mmi_dev_pdata *ppdata = &touch_cdev->pdata; \
|
||||
if (!ppdata->ctrl_dsi) { \
|
||||
cookie = panel_event_notifier_register(PANEL_EVENT_NOTIFICATION_PRIMARY, \
|
||||
PANEL_EVENT_NOTIFIER_CLIENT_PRIMARY_TOUCH, touch_cdev->active_panel, \
|
||||
&ts_mmi_panel_cb, touch_cdev); \
|
||||
} else { \
|
||||
cookie = panel_event_notifier_register(PANEL_EVENT_NOTIFICATION_SECONDARY, \
|
||||
PANEL_EVENT_NOTIFIER_CLIENT_SECONDARY_TOUCH, touch_cdev->active_panel, \
|
||||
&ts_mmi_panel_cb, touch_cdev); \
|
||||
} \
|
||||
if (!cookie) \
|
||||
ret = -1; \
|
||||
else \
|
||||
|
|
@ -435,6 +442,9 @@ struct ts_mmi_dev {
|
|||
int forcereflash;
|
||||
int panel_status;
|
||||
struct ts_mmi_dev_pdata pdata;
|
||||
#if defined(CONFIG_DRM_PANEL_NOTIFICATIONS) || defined (CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)
|
||||
struct drm_panel *active_panel;
|
||||
#endif
|
||||
#ifdef CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS
|
||||
void *notifier_cookie;
|
||||
#else
|
||||
|
|
@ -545,7 +555,7 @@ extern int ts_mmi_palm_remove(struct ts_mmi_dev *data);
|
|||
extern int ts_mmi_gesture_suspend(struct ts_mmi_dev *touch_cdev);
|
||||
#endif
|
||||
#if defined (CONFIG_DRM_PANEL_NOTIFICATIONS) || defined (CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)
|
||||
int ts_mmi_check_drm_panel(struct device_node *of_node);
|
||||
int ts_mmi_check_drm_panel(struct ts_mmi_dev* touch_cdev, struct device_node *of_node);
|
||||
#endif
|
||||
extern bool ts_mmi_is_panel_match(const char *panel_node, char *touch_ic_name);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue