diff --git a/drivers/input/touchscreen/chipone_tddi_v2_mmi/Kbuild b/drivers/input/touchscreen/chipone_tddi_v2_mmi/Kbuild index f5fd45e08593..bbdd4caa1f36 100644 --- a/drivers/input/touchscreen/chipone_tddi_v2_mmi/Kbuild +++ b/drivers/input/touchscreen/chipone_tddi_v2_mmi/Kbuild @@ -25,6 +25,10 @@ ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),) EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI endif +ifeq ($(TARGET_BUILD_VARIANT),user) + EXTRA_CFLAGS += -DCFG_CTS_FOR_GKI +endif + #obj-$(CONFIG_TOUCHSCREEN_CHIPONE) += chipone-tddi.o obj-m += chipone_tddi_v2_mmi.o diff --git a/drivers/input/touchscreen/ilitek_v3_mmi/Kbuild b/drivers/input/touchscreen/ilitek_v3_mmi/Kbuild index e0947969d105..e68c238671c6 100644 --- a/drivers/input/touchscreen/ilitek_v3_mmi/Kbuild +++ b/drivers/input/touchscreen/ilitek_v3_mmi/Kbuild @@ -51,6 +51,9 @@ ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),) EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI endif +ifeq ($(TARGET_BUILD_VARIANT),user) + EXTRA_CFLAGS += -DGKI_EN_FLAG +endif ilitek_v3_mmi-objs += ilitek_v3.o ilitek_v3_mmi-objs += ilitek_v3_spi.o ilitek_v3_mmi-objs += ilitek_v3_qcom.o diff --git a/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3.h b/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3.h index a8c9da067909..3f24637c06bf 100644 --- a/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3.h +++ b/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3.h @@ -173,7 +173,7 @@ #define MULTI_REPORT_RATE DISABLE #define ENGINEER_FLOW ENABLE #define DMESG_SEQ_FILE ENABLE -#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE +#ifdef GKI_EN_FLAG #define GENERIC_KERNEL_IMAGE ENABLE/*follow gki */ #else #define GENERIC_KERNEL_IMAGE DISABLE/*follow gki */ diff --git a/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3_node.c b/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3_node.c index b636b626215b..309ef78f55bb 100644 --- a/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3_node.c +++ b/drivers/input/touchscreen/ilitek_v3_mmi/ilitek_v3_node.c @@ -1168,6 +1168,11 @@ static int ilitek_proc_debug_all_message_show(struct seq_file *m, void *v) int need_read_data_len = 0; int type = 0; + if (m->size < 500 * K) { + m->count = m->size; + return 0; + } + if (!ilits->dlnp) { ILI_ERR("Debug flag isn't enabled (%d)\n", ilits->dlnp); seq_printf(m, "Debug flag isn't enabled (%d)\n", ilits->dlnp); @@ -1239,6 +1244,11 @@ static int ilitek_proc_debug_message_show(struct seq_file *m, void *v) /* '0' ~ 'F' mapping table */ char charmapping[16] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46 }; + if (m->size < 16 * K) { + m->count = m->size; + return 0; + } + if (!ilits->dnp) { ILI_ERR("Debug flag isn't enabled (%d)\n", ilits->dnp); seq_printf(m, "Debug flag isn't enabled (%d)\n", ilits->dnp); @@ -1557,9 +1567,16 @@ static int ilitek_proc_mp_result_show(struct seq_file *m, void *v) return 0; } + if (m->size < 500 * K) { + m->count = m->size; + return 0; + } + if (m->size < strlen(ilits->mp_result)) { ILI_INFO("size = %d, mp_result = %d\n Unable to print all data\n", (int) m->size, (int) strlen(ilits->mp_result)); + m->count = m->size; + return 0; } seq_printf(m, "%s", ilits->mp_result); @@ -3576,7 +3593,7 @@ static int proc_show_mp_test_result_read(struct inode *inode, struct file *file) return -EINVAL; } - return single_open_size(file, ilitek_proc_mp_result_show, NULL, 512 * K); + return single_open(file, ilitek_proc_mp_result_show, NULL); } #if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0) @@ -3652,7 +3669,7 @@ static int ilitek_proc_seq_debug_message_read(struct inode *inode, struct file * return -EINVAL; } - return single_open_size(file, ilitek_proc_debug_message_show, NULL, 16 * K); + return single_open(file, ilitek_proc_debug_message_show, NULL); } #if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0) @@ -3692,7 +3709,7 @@ static int ilitek_proc_seq_debug_all_message_read(struct inode *inode, struct fi return -EINVAL; } - return single_open_size(file, ilitek_proc_debug_all_message_show, NULL, 500 * K); + return single_open(file, ilitek_proc_debug_all_message_show, NULL); } #if LINUX_VERSION_CODE > KERNEL_VERSION(5, 6, 0)