Files
android_kernel_motorola_sm6225/include/linux/panel_notifier.h
T
houdz1 b50e45fab9 panel_notify: add api for touch state
Touch driver can call the api to set the touch state.
And panel driver can call the api to get the touch state.
And when the touch state is not 0,
we can not power down panel.

Change-Id: I3cb0dceeb7ff9b0f731c0ce2d9f2fea2e648d223
Signed-off-by: houdz1 <houdz1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1499392
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Reviewed-on: https://gerrit.mot.com/1509882
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
2023-06-01 00:47:06 -03:00

67 lines
1.6 KiB
C

/* Copyright (c) 2016, Motorola Mobility, LLC.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#ifndef __PANEL_NOTIFIER_H__
#define __PANEL_NOTIFIER_H__
#include <linux/notifier.h>
enum panel_event {
PANEL_EVENT_PRE_DISPLAY_OFF,
PANEL_EVENT_PRE_DISPLAY_ON,
PANEL_EVENT_DISPLAY_OFF,
PANEL_EVENT_DISPLAY_ON,
};
#ifdef CONFIG_PANEL_NOTIFICATIONS
#define MAX_PANEL_IDX 2
enum touch_panel_id {
TOUCH_PANEL_IDX_PRIMARY = 0,
TOUCH_PANEL_MAX_IDX,
};
int panel_register_notifier(struct notifier_block *nb);
int panel_unregister_notifier(struct notifier_block *nb);
int panel_notify(unsigned int event, void *data);
int touch_set_state(int state, int panel_idx);
int check_touch_state(int *state, int panel_idx);
#else
#include <linux/errno.h>
static inline int panel_register_notifier(struct notifier_block *nb)
{
return -ENOSYS;
}
static inline int panel_unregister_notifier(struct notifier_block *nb)
{
return -ENOSYS;
}
static inline int panel_notify(unsigned int event, void *data)
{
return -ENOSYS;
}
static inline int touch_set_state(int state, int panel_idx);
{
return -ENOSYS;
}
static inline int check_touch_state(int *state, int panel_idx);
{
return -ENOSYS;
}
#endif
#endif