diff --git a/drivers/input/touchscreen/nova_0flash_mmi/Android.mk b/drivers/input/touchscreen/nova_0flash_mmi/Android.mk index cf57dd59972e..2f85d4d6fdf6 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/Android.mk +++ b/drivers/input/touchscreen/nova_0flash_mmi/Android.mk @@ -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 diff --git a/drivers/input/touchscreen/nova_0flash_mmi/Kbuild b/drivers/input/touchscreen/nova_0flash_mmi/Kbuild index 408d244e20c8..72ba0933f9ee 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/Kbuild +++ b/drivers/input/touchscreen/nova_0flash_mmi/Kbuild @@ -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 diff --git a/drivers/input/touchscreen/nova_0flash_mmi/Makefile b/drivers/input/touchscreen/nova_0flash_mmi/Makefile index 4191dea22679..ff20fa5e17dd 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/Makefile +++ b/drivers/input/touchscreen/nova_0flash_mmi/Makefile @@ -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 diff --git a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c index 39591d94f7ce..97ab3e8e0f00 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c +++ b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx.c @@ -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) diff --git a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_ext_proc.c b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_ext_proc.c index fc36ea4cd047..b946aca1fe69 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_ext_proc.c +++ b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_ext_proc.c @@ -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 /******************************************************* diff --git a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_mp_ctrlram.c b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_mp_ctrlram.c index c25f62e94aeb..4dff2d77ff07 100644 --- a/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_mp_ctrlram.c +++ b/drivers/input/touchscreen/nova_0flash_mmi/nt36xxx_mp_ctrlram.c @@ -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 /*******************************************************