input: genevn: optimize nt36673c driver for kernel 5.10

TP:
(1)optimize nt36672c driver for kernek 5.10
(2)use panel event notifications

Change-Id: I48a0b5c49430cbb1bcceb05384aec6cddeb3a795
Reviewed-on: https://gerrit.mot.com/2372923
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Xiaojun Lv 2022-08-28 17:38:04 +08:00 • committed by lvxj4
commit dc6b2a00e6
6 changed files with 97 additions and 14 deletions

View file

@ -52,6 +52,9 @@ endif
ifeq ($(DRM_PANEL_NOTIFICATIONS),true)
KERNEL_CFLAGS += CONFIG_DRM_PANEL_NOTIFICATIONS=y
endif
ifeq ($(DRM_PANEL_EVENT_NOTIFICATIONS),true)
KBUILD_OPTIONS += CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS=y
endif
ifeq ($(TOUCH_PANEL_NOTIFICATIONS),true)
KERNEL_CFLAGS += CONFIG_TOUCH_PANEL_NOTIFICATIONS=y
endif
@ -69,9 +72,9 @@ 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)
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),)
KERNEL_CFLAGS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
KBUILD_OPTIONS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko
endif
KBUILD_OPTIONS_GKI += GKI_OBJ_MODULE_DIR=gki

View file

@ -58,6 +58,9 @@ nova_0flash_mmi-objs += nt36xxx_mp_ctrlram.o
ifneq ($(filter m y,$(CONFIG_DRM_PANEL_NOTIFICATIONS)),)
EXTRA_CFLAGS += -DCONFIG_DRM_PANEL_NOTIFICATIONS
endif
ifneq ($(filter m y,$(CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)),)
EXTRA_CFLAGS += -DCONFIG_DRM_PANEL_EVENT_NOTIFICATIONS
endif
ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),)
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers
EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI

View file

@ -1,10 +1,17 @@
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
all: modules
all:
$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
modules:
$(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS)
modules_install:
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(M) modules_install
%:
$(MAKE) -C $(KERNEL_SRC) M=$(M) $@ $(KBUILD_OPTIONS)
clean:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
rm -rf .tmp_versions
KBUILD_EXTRA_SYMBOLS += $(M)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(M)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers

View file

@ -199,7 +199,7 @@ int nvt_mcu_pen_detect_set(uint8_t pen_detect);
#endif
#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(NVT_CONFIG_DRM_PANEL))
#if (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))) || defined(NVT_CONFIG_DRM_PANEL))
#if defined(CONFIG_DRM)
static int nvt_drm_notifier_callback(struct notifier_block *self, unsigned long event, void *data);
#ifdef LCM_FAST_LIGHTUP
@ -982,12 +982,21 @@ static int32_t nvt_flash_close(struct inode *inode, struct file *file)
return 0;
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_flash_fops = {
.proc_open = nvt_flash_open,
.proc_read = nvt_flash_read,
.proc_lseek = seq_lseek,
.proc_release = nvt_flash_close,
};
#else
static const struct file_operations nvt_flash_fops = {
.owner = THIS_MODULE,
.open = nvt_flash_open,
.release = nvt_flash_close,
.read = nvt_flash_read,
};
#endif
/*******************************************************
Description:
@ -2952,7 +2961,7 @@ static int32_t nvt_ts_probe(struct spi_device *client)
#endif
#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(NVT_CONFIG_DRM_PANEL))
#if (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))) || defined(NVT_CONFIG_DRM_PANEL))
#if defined(CONFIG_DRM)
ts->drm_notif.notifier_call = nvt_drm_notifier_callback;
if (active_panel &&
@ -3024,7 +3033,7 @@ err_create_touchscreen_class_failed:
nvt_mmi_init(ts, false);
#endif
#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(NVT_CONFIG_DRM_PANEL))
#if (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))) || defined(NVT_CONFIG_DRM_PANEL))
#if defined(CONFIG_DRM)
if (active_panel) {
if (drm_panel_notifier_unregister(active_panel, &ts->drm_notif))
@ -3153,7 +3162,7 @@ static int32_t nvt_ts_remove(struct spi_device *client)
#endif
#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(NVT_CONFIG_DRM_PANEL))
#if (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))) || defined(NVT_CONFIG_DRM_PANEL))
#if defined(CONFIG_DRM)
if (active_panel) {
drm_panel_notifier_unregister(active_panel, &ts->drm_notif);
@ -3256,7 +3265,7 @@ static void nvt_ts_shutdown(struct spi_device *client)
nvt_irq_enable(false);
#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(NVT_CONFIG_DRM_PANEL))
#if (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))) || defined(NVT_CONFIG_DRM_PANEL))
#if defined(CONFIG_DRM)
if (active_panel) {
drm_panel_notifier_unregister(active_panel, &ts->drm_notif);
@ -3529,7 +3538,7 @@ int32_t nvt_ts_resume(struct device *dev)
}
#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI
#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) || defined(NVT_CONFIG_DRM_PANEL))
#if (((LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))) || defined(NVT_CONFIG_DRM_PANEL))
#if defined(CONFIG_DRM)
#ifdef LCM_FAST_LIGHTUP
static void nova_resume_work_func(struct work_struct *work)

View file

@ -346,7 +346,14 @@ static int32_t nvt_fw_version_open(struct inode *inode, struct file *file)
return seq_open(file, &nvt_fw_version_seq_ops);
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_fw_version_fops = {
.proc_open = nvt_fw_version_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
};
#else
static const struct file_operations nvt_fw_version_fops = {
.owner = THIS_MODULE,
.open = nvt_fw_version_open,
@ -354,6 +361,7 @@ static const struct file_operations nvt_fw_version_fops = {
.llseek = seq_lseek,
.release = seq_release,
};
#endif
/*******************************************************
Description:
@ -402,6 +410,14 @@ static int32_t nvt_baseline_open(struct inode *inode, struct file *file)
return seq_open(file, &nvt_seq_ops);
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_baseline_fops = {
.proc_open = nvt_baseline_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
};
#else
static const struct file_operations nvt_baseline_fops = {
.owner = THIS_MODULE,
.open = nvt_baseline_open,
@ -409,6 +425,7 @@ static const struct file_operations nvt_baseline_fops = {
.llseek = seq_lseek,
.release = seq_release,
};
#endif
/*******************************************************
Description:
@ -460,6 +477,14 @@ static int32_t nvt_raw_open(struct inode *inode, struct file *file)
return seq_open(file, &nvt_seq_ops);
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_raw_fops = {
.proc_open = nvt_raw_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
};
#else
static const struct file_operations nvt_raw_fops = {
.owner = THIS_MODULE,
.open = nvt_raw_open,
@ -467,6 +492,7 @@ static const struct file_operations nvt_raw_fops = {
.llseek = seq_lseek,
.release = seq_release,
};
#endif
/*******************************************************
Description:
@ -518,6 +544,14 @@ static int32_t nvt_diff_open(struct inode *inode, struct file *file)
return seq_open(file, &nvt_seq_ops);
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_diff_fops = {
.proc_open = nvt_diff_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
};
#else
static const struct file_operations nvt_diff_fops = {
.owner = THIS_MODULE,
.open = nvt_diff_open,
@ -525,6 +559,7 @@ static const struct file_operations nvt_diff_fops = {
.llseek = seq_lseek,
.release = seq_release,
};
#endif
/*******************************************************
@ -602,10 +637,17 @@ kzalloc_failed:
return ret;
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_fwupdate_fops = {
.proc_read = nvt_fwupdate_read,
.proc_write = NULL,
};
#else
static const struct file_operations nvt_fwupdate_fops = {
.owner = THIS_MODULE,
.read = nvt_fwupdate_read,
};
#endif
#ifdef EDGE_SUPPRESSION
typedef enum{
@ -784,6 +826,15 @@ static int32_t nvt_monitor_control_open(struct inode *inode, struct file *file)
{
return single_open(file, nvt_monitor_control_show, NULL);
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops monitor_control_fops = {
.proc_open = nvt_monitor_control_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
.proc_write = nvt_monitor_control_store,
};
#else
static const struct file_operations monitor_control_fops = {
.owner = THIS_MODULE,
.open = nvt_monitor_control_open,
@ -792,6 +843,7 @@ static const struct file_operations monitor_control_fops = {
.llseek = seq_lseek,
.release = seq_release,
};
#endif
/*******************************************************

View file

@ -1363,6 +1363,14 @@ static int32_t nvt_selftest_open(struct inode *inode, struct file *file)
return seq_open(file, &nvt_selftest_seq_ops);
}
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops nvt_selftest_fops = {
.proc_open = nvt_selftest_open,
.proc_read = seq_read,
.proc_lseek = seq_lseek,
.proc_release = single_release,
};
#else
static const struct file_operations nvt_selftest_fops = {
.owner = THIS_MODULE,
.open = nvt_selftest_open,
@ -1370,6 +1378,7 @@ static const struct file_operations nvt_selftest_fops = {
.llseek = seq_lseek,
.release = seq_release,
};
#endif
#ifdef CONFIG_OF
/*******************************************************