From a57d3b21493106585f5c88ec96495c885354a768 Mon Sep 17 00:00:00 2001 From: wangyq13 Date: Thu, 24 Nov 2022 11:25:27 +0800 Subject: [PATCH] input: ili9882_mmi: remove unused netlink codes ili9882_mmi: Removed unused netlink codes, fix vts test fail. Change-Id: I2b4734252a8dff2bf783201f96acf3d24c75c03a Signed-off-by: wangyq13 Reviewed-on: https://gerrit.mot.com/2438674 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Reviewed-by: Huosheng Liao Submit-Approved: Jira Key --- drivers/input/touchscreen/ili9882_mmi/ili9882.h | 2 ++ drivers/input/touchscreen/ili9882_mmi/ili9882_node.c | 8 ++++++++ drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c | 2 ++ drivers/input/touchscreen/ili9882_mmi/ili9882_touch.c | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882.h b/drivers/input/touchscreen/ili9882_mmi/ili9882.h index 2480aee2cfa5..4a250fbede4a 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882.h +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882.h @@ -942,7 +942,9 @@ struct ilitek_ts_data { bool wq_bat_ctrl; bool panel_gesture_enable; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) bool netlink; +#endif bool report; bool gesture; bool mp_retry; diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c index 36e68ab5e6f4..7b1bc274d782 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_node.c @@ -1683,9 +1683,11 @@ static ssize_t ilitek_node_ioctl_write(struct file *filp, const char *buff, size } else if (strncmp(cmd, "gestureinfo", strlen(cmd)) == 0) { ilits->gesture_mode = DATA_FORMAT_GESTURE_INFO; ILI_INFO("gesture mode = %d\n", ilits->gesture_mode); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) } else if (strncmp(cmd, "netlink", strlen(cmd)) == 0) { ilits->netlink = !ilits->netlink; ILI_INFO("netlink flag= %d\n", ilits->netlink); +#endif } else if (strncmp(cmd, "switchtestmode", strlen(cmd)) == 0) { ili_switch_tp_mode(P5_X_FW_TEST_MODE); } else if (strncmp(cmd, "switchdebugmode", strlen(cmd)) == 0) { @@ -2193,6 +2195,7 @@ static long ilitek_node_ioctl(struct file *filp, unsigned int cmd, unsigned long ret = -ENOTTY; } break; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) case ILITEK_IOCTL_TP_NETLINK_CTRL: if (copy_from_user(szBuf, (u8 *) arg, 1)) { ILI_ERR("Failed to copy data from user space\n"); @@ -2215,6 +2218,7 @@ static long ilitek_node_ioctl(struct file *filp, unsigned int cmd, unsigned long ret = -ENOTTY; } break; +#endif case ILITEK_IOCTL_TP_MODE_CTRL: if (copy_from_user(szBuf, (u8 *) arg, 10)) { ILI_ERR("Failed to copy data from user space\n"); @@ -2622,6 +2626,7 @@ proc_node iliproc[] = { }; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) #define NETLINK_USER 21 static struct sock *netlink_skb; static struct nlmsghdr *netlink_head; @@ -2706,6 +2711,7 @@ static int netlink_init(void) } return ret; } +#endif #ifndef CONFIG_INPUT_TOUCHSCREEN_MMI static ssize_t path_show(struct device *pDevice, struct device_attribute *pAttr, char *pBuf) @@ -2825,7 +2831,9 @@ void ili_node_init(void) ILI_INFO("Succeed to create %s under /proc\n", iliproc[i].name); } } +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) netlink_init(); +#endif #ifndef CONFIG_INPUT_TOUCHSCREEN_MMI ilitek_sys_init(); #endif diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c index 950424c3f245..855d453c95e2 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c @@ -735,7 +735,9 @@ static int ilitek_spi_probe(struct spi_device *spi) ilits->gesture_demo_ctrl = DISABLE; ilits->wtd_ctrl = OFF; ilits->report = ENABLE; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) ilits->netlink = DISABLE; +#endif ilits->dnp = DISABLE; ilits->irq_tirgger_type = IRQF_TRIGGER_FALLING; ilits->info_from_hex = ENABLE; diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_touch.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_touch.c index afd36429def1..765deb3b2b47 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_touch.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_touch.c @@ -832,6 +832,7 @@ static void ilitek_tddi_touch_send_debug_data(u8 *buf, int len) mutex_lock(&ilits->debug_mutex); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) if (!ilits->netlink && !ilits->dnp) goto out; @@ -840,6 +841,10 @@ static void ilitek_tddi_touch_send_debug_data(u8 *buf, int len) ili_netlink_reply_msg(buf, len); goto out; } +#else + if (!ilits->dnp) + goto out; +#endif /* Sending data to apk via the node of debug_message node */ if (ilits->dnp) {