input: genevn: optimize ili7807s driver for kernel 5.10

input:
(1)optimize ili7807s driver for kernek 5.10

Change-Id: If3c0b9644f5df5dc5c3c6c8a5469249c97becf53
Reviewed-on: https://gerrit.mot.com/2376968
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yeqing Wang <wangyq13@motorola.com>
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Jing Hu <hujing3@lenovo.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Xiaojun Lv 2022-09-02 13:22:25 +08:00 • committed by lvxj4
commit 3bae2782e9
4 changed files with 132 additions and 9 deletions

View file

@ -1,10 +1,18 @@
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

@ -1040,9 +1040,11 @@ static void run_tx_rx_delta_test(int index)
static char *get_date_time_str(void)
{
static char time_data_buf[128] = { 0 };
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 14, 0)
struct timespec now_time;
struct rtc_time rtc_now_time;
static char time_data_buf[128] = { 0 };
getnstimeofday(&now_time);
rtc_time_to_tm(now_time.tv_sec, &rtc_now_time);
@ -1050,6 +1052,15 @@ static char *get_date_time_str(void)
(rtc_now_time.tm_year + 1900), rtc_now_time.tm_mon + 1,
rtc_now_time.tm_mday, rtc_now_time.tm_hour, rtc_now_time.tm_min,
rtc_now_time.tm_sec);
#else
struct tm tm;
time64_to_tm(ktime_get_real_seconds(), 0, &tm);
snprintf(time_data_buf, sizeof(time_data_buf), "%04d%02d%02d-%02d%02d%02d",
(int)(tm.tm_year + 1900), tm.tm_mon + 1,
tm.tm_mday, tm.tm_hour, tm.tm_min,
tm.tm_sec);
#endif
return time_data_buf;
}

View file

@ -2329,37 +2329,90 @@ out:
static struct proc_dir_entry *proc_dir_ilitek;
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
typedef struct {
char *name;
struct proc_dir_entry *node;
struct proc_ops *fops;
bool isCreated;
} proc_node;
#else
typedef struct {
char *name;
struct proc_dir_entry *node;
struct file_operations *fops;
bool isCreated;
} proc_node;
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_mp_lcm_on_test_fops = {
.proc_read = ilitek_node_mp_lcm_on_test_read,
};
#else
static struct file_operations proc_mp_lcm_on_test_fops = {
.read = ilitek_node_mp_lcm_on_test_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_mp_lcm_off_test_fops = {
.proc_read = ilitek_node_mp_lcm_off_test_read,
};
#else
static struct file_operations proc_mp_lcm_off_test_fops = {
.read = ilitek_node_mp_lcm_off_test_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_ver_info_fops = {
.proc_read = ilitek_node_ver_info_read,
};
#else
static struct file_operations proc_ver_info_fops = {
.read = ilitek_node_ver_info_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_change_list_fops = {
.proc_read = ilitek_node_change_list_read,
};
#else
static struct file_operations proc_change_list_fops = {
.read = ilitek_node_change_list_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_debug_message_fops = {
.proc_read = ilitek_proc_debug_message_read,
};
#else
static struct file_operations proc_debug_message_fops = {
.read = ilitek_proc_debug_message_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_debug_message_switch_fops = {
.proc_read = ilitek_proc_debug_switch_read,
};
#else
static struct file_operations proc_debug_message_switch_fops = {
.read = ilitek_proc_debug_switch_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_ioctl_fops = {
.proc_ioctl = ilitek_node_ioctl,
#ifdef CONFIG_COMPAT
.proc_compat_ioctl = ilitek_node_compat_ioctl,
#endif
.proc_write = ilitek_node_ioctl_write,
};
#else
static struct file_operations proc_ioctl_fops = {
.unlocked_ioctl = ilitek_node_ioctl,
#ifdef CONFIG_COMPAT
@ -2367,40 +2420,91 @@ static struct file_operations proc_ioctl_fops = {
#endif
.write = ilitek_node_ioctl_write,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_fw_upgrade_fops = {
.proc_read = ilitek_node_fw_upgrade_read,
};
#else
static struct file_operations proc_fw_upgrade_fops = {
.read = ilitek_node_fw_upgrade_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_fw_process_fops = {
.proc_read = ilitek_proc_fw_process_read,
};
#else
static struct file_operations proc_fw_process_fops = {
.read = ilitek_proc_fw_process_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_get_delta_data_fops = {
.proc_read = ilitek_proc_get_delta_data_read,
};
#else
static struct file_operations proc_get_delta_data_fops = {
.read = ilitek_proc_get_delta_data_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_get_raw_data_fops = {
.proc_read = ilitek_proc_fw_get_raw_data_read,
};
#else
static struct file_operations proc_get_raw_data_fops = {
.read = ilitek_proc_fw_get_raw_data_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_rw_tp_reg_fops = {
.proc_read = ilitek_proc_rw_tp_reg_read,
.proc_write = ilitek_proc_rw_tp_reg_write,
};
#else
static struct file_operations proc_rw_tp_reg_fops = {
.read = ilitek_proc_rw_tp_reg_read,
.write = ilitek_proc_rw_tp_reg_write,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_fw_pc_counter_fops = {
.proc_read = ilitek_proc_fw_pc_counter_read,
};
#else
static struct file_operations proc_fw_pc_counter_fops = {
.read = ilitek_proc_fw_pc_counter_read,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_get_debug_mode_data_fops = {
.proc_read = ilitek_proc_get_debug_mode_data_read,
.proc_write = ilitek_proc_get_debug_mode_data_write,
};
#else
static struct file_operations proc_get_debug_mode_data_fops = {
.read = ilitek_proc_get_debug_mode_data_read,
.write = ilitek_proc_get_debug_mode_data_write,
};
#endif
#if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)
static struct proc_ops proc_debug_level_fops = {
.proc_read = ilitek_proc_debug_level_read,
};
#else
static struct file_operations proc_debug_level_fops = {
.read = ilitek_proc_debug_level_read,
};
#endif
proc_node iliproc[] = {
{"ioctl", NULL, &proc_ioctl_fops, false},

View file

@ -441,7 +441,7 @@ int ili_sysfs_remove_device(struct device *dev) {
}
#else
#ifdef CONFIG_DRM
#if (defined(CONFIG_DRM) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)))
static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long event, void *data)
{
int *blank;
@ -718,8 +718,8 @@ int ili_sensor_remove(struct ilitek_ts_data *data)
static void ilitek_plat_sleep_init(void)
{
ILI_INFO("Init notifier_fb struct\n");
#if (defined(CONFIG_DRM) && (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)))
ilits->notifier_fb.notifier_call = ilitek_plat_notifier_fb;
#if defined(CONFIG_DRM)
{
int ret = 0;
extern struct drm_panel *ili_active_panel;