Support tapTowake feature on android R for novatek

- Since moto display notifier has been changed to common
interface, for implement tap to wake need some changes to
match display.
NO_PROP_NEEDED: needn't for shm2018

Change-Id: I9642787a29e9326e9ac648138e2fe47800783ed0
Signed-off-by: wengjun1 <wengjun1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1793188
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jianqiu Huang <huangjq9@motorola.com>
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wengjun1 2020-11-04 15:17:02 +08:00 • committed by Jun Weng
commit 2d92c538ad
4 changed files with 37 additions and 4 deletions

View file

@ -11,6 +11,10 @@ ifneq ($(BOARD_USES_DOUBLE_TAP),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_ENABLE_DOUBLE_TAP=y
endif
ifneq ($(MOTO_PANEL_CHECK_TOUCH_STATE),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_NOTIFY_TOUCH_STATE=y
endif
ifneq ($(BOARD_USES_PANEL_NOTIFICATIONS),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_PANEL_NOTIFICATIONS=y
endif
@ -39,7 +43,14 @@ ifneq ($(BOARD_USES_STYLUS_PALM_RANGE),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE=y
endif
include $(CLEAR_VARS)
ifneq ($(BOARD_USES_DOUBLE_TAP),)
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/sensors_class.ko
endif
ifneq ($(BOARD_USES_PEN_NOTIFIER),)
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/bu520xx_pen.ko
endif
LOCAL_MODULE := nova_0flash_mmi.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(NOVA_MMI_MODULE_PATH)
KBUILD_OPTIONS_GKI += GKI_OBJ_MODULE_DIR=gki
include $(DLKM_DIR)/AndroidKernelModule.mk

View file

@ -10,6 +10,9 @@ ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_0FLASH_MMI_ENABLE_DOUBLE_TAP)),)
EXTRA_CFLAGS += -DNVT_SENSOR_EN
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../sensors/$(GKI_OBJ_MODULE_DIR)/Module.symvers
endif
ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_0FLASH_MMI_NOTIFY_TOUCH_STATE)),)
EXTRA_CFLAGS += -DNVT_SET_TOUCH_STATE
endif
ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_PANEL_NOTIFICATIONS)),)
EXTRA_CFLAGS += -DNVT_CONFIG_PANEL_NOTIFICATIONS
endif
@ -33,7 +36,7 @@ ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE)),)
EXTRA_CFLAGS += -DPALM_GESTURE_RANGE
endif
ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_0FLASH_MMI_PEN_NOTIFIER)),)
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../misc/pen/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../misc/pen/$(GKI_OBJ_MODULE_DIR)/Module.symvers
EXTRA_CFLAGS += -DNOVATECH_PEN_NOTIFIER
endif
nova_0flash_mmi-objs += nt36xxx.o

View file

@ -2703,7 +2703,7 @@ static int32_t nvt_ts_remove(struct spi_device *client)
#if WAKEUP_GESTURE
device_init_wakeup(&ts->input_dev->dev, 0);
#ifdef NVT_CONFIG_PANEL_NOTIFICATIONS
#if defined(NVT_CONFIG_PANEL_NOTIFICATIONS) || defined(NVT_SET_TOUCH_STATE)
touch_set_state(TOUCH_DEEP_SLEEP_STATE, TOUCH_PANEL_IDX_PRIMARY);
#endif
#endif
@ -3002,10 +3002,12 @@ static int nvt_drm_notifier_callback(struct notifier_block *self, unsigned long
if (*blank == MSM_DRM_BLANK_POWERDOWN) {
NVT_LOG("event=%lu, *blank=%d\n", event, *blank);
nvt_ts_suspend(&ts->client->dev);
#ifdef NVT_SENSOR_EN
#if defined(NVT_SENSOR_EN) && defined(NVT_SET_TOUCH_STATE)
if (ts->should_enable_gesture) {
NVT_LOG("double tap gesture suspend\n");
return 1;
touch_set_state(TOUCH_LOW_POWER_STATE, TOUCH_PANEL_IDX_PRIMARY);
} else {
touch_set_state(TOUCH_DEEP_SLEEP_STATE, TOUCH_PANEL_IDX_PRIMARY);
}
#endif
}

View file

@ -267,6 +267,19 @@ typedef enum {
EVENT_MAP_PROJECTID = 0x9A,
} SPI_EVENT_MAP;
#ifdef NVT_SET_TOUCH_STATE
#define MAX_PANEL_IDX 2
enum touch_panel_id {
TOUCH_PANEL_IDX_PRIMARY = 0,
TOUCH_PANEL_MAX_IDX,
};
enum touch_state {
TOUCH_DEEP_SLEEP_STATE = 0,
TOUCH_LOW_POWER_STATE,
};
#endif
//---SPI READ/WRITE---
#define SPI_WRITE_MASK(a) (a | 0x80)
#define SPI_READ_MASK(a) (a & 0x7F)
@ -303,6 +316,10 @@ int32_t nvt_clear_fw_status(void);
int32_t nvt_check_fw_status(void);
int32_t nvt_set_page(uint32_t addr);
int32_t nvt_write_addr(uint32_t addr, uint8_t data);
#ifdef NVT_SET_TOUCH_STATE
int touch_set_state(int state, int panel_idx);
int check_touch_state(int *state, int panel_idx);
#endif
#if NVT_TOUCH_ESD_PROTECT
extern void nvt_esd_check_enable(uint8_t enable);
#endif /* #if NVT_TOUCH_ESD_PROTECT */