Loading drivers/input/touchscreen/tp_common.c +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ struct kobject *touchpanel_kobj; TS_ENABLE_FOPS(double_tap) TS_ENABLE_FOPS(fod_status) TS_ENABLE_FOPS(pen) TS_ENABLE_FOPS(pen_gen2_force) static int __init tp_common_init(void) { Loading drivers/input/touchscreen/xiaomi/nt36523/nt36xxx.c +32 −0 Original line number Diff line number Diff line Loading @@ -2127,6 +2127,32 @@ static struct tp_common_ops pen_ops = { .show = pen_show, .store = pen_store, }; static ssize_t pen_gen2_force_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%d\n", ts->pen_gen2_force); } static ssize_t pen_gen2_force_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int rc, val; rc = kstrtoint(buf, 10, &val); if (rc) return -EINVAL; ts->pen_gen2_force = !!val; return count; } static struct tp_common_ops pen_gen2_force_ops = { .show = pen_gen2_force_show, .store = pen_gen2_force_store, }; #endif #ifdef CONFIG_TOUCHSCREEN_XIAOMI_TOUCHFEATURE Loading Loading @@ -3170,6 +3196,12 @@ static int32_t nvt_ts_probe(struct spi_device *client) NVT_ERR("%s: Failed to create pen node err=%d\n", __func__, ret); } ret = tp_common_set_pen_gen2_force_ops(&pen_gen2_force_ops); if (ret < 0) { NVT_ERR("%s: Failed to create pen gen2 force node err=%d\n", __func__, ret); } #endif } /* if (ts->pen_support) */ Loading drivers/input/touchscreen/xiaomi/nt36523/nt36xxx.h +1 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,7 @@ struct nvt_ts_data { #ifndef NVT_SAVE_TESTDATA_IN_FILE void *testdata; #endif bool pen_gen2_force; }; #if NVT_TOUCH_PROC Loading drivers/input/touchscreen/xiaomi/nt36523/nt36xxx_fw_update.c +7 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,13 @@ static int32_t update_firmware_request(const char *filename) uint8_t retry = 0; int32_t ret = 0; if (ts->pen_gen2_force) { NVT_LOG("pen_gen2_force is enabled, force new pen fw.\n"); // clear the file name filename = "novatek_nt36523_k82_fw01_pen.bin"; NVT_LOG("filename was changed to %s\n", filename); } if (NULL == filename) { return -ENOENT; } Loading include/linux/input/tp_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -12,3 +12,4 @@ struct tp_common_ops { int tp_common_set_double_tap_ops(struct tp_common_ops *ops); int tp_common_set_fod_status_ops(struct tp_common_ops *ops); int tp_common_set_pen_ops(struct tp_common_ops *ops); int tp_common_set_pen_gen2_force_ops(struct tp_common_ops *ops); Loading
drivers/input/touchscreen/tp_common.c +1 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ struct kobject *touchpanel_kobj; TS_ENABLE_FOPS(double_tap) TS_ENABLE_FOPS(fod_status) TS_ENABLE_FOPS(pen) TS_ENABLE_FOPS(pen_gen2_force) static int __init tp_common_init(void) { Loading
drivers/input/touchscreen/xiaomi/nt36523/nt36xxx.c +32 −0 Original line number Diff line number Diff line Loading @@ -2127,6 +2127,32 @@ static struct tp_common_ops pen_ops = { .show = pen_show, .store = pen_store, }; static ssize_t pen_gen2_force_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { return sprintf(buf, "%d\n", ts->pen_gen2_force); } static ssize_t pen_gen2_force_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) { int rc, val; rc = kstrtoint(buf, 10, &val); if (rc) return -EINVAL; ts->pen_gen2_force = !!val; return count; } static struct tp_common_ops pen_gen2_force_ops = { .show = pen_gen2_force_show, .store = pen_gen2_force_store, }; #endif #ifdef CONFIG_TOUCHSCREEN_XIAOMI_TOUCHFEATURE Loading Loading @@ -3170,6 +3196,12 @@ static int32_t nvt_ts_probe(struct spi_device *client) NVT_ERR("%s: Failed to create pen node err=%d\n", __func__, ret); } ret = tp_common_set_pen_gen2_force_ops(&pen_gen2_force_ops); if (ret < 0) { NVT_ERR("%s: Failed to create pen gen2 force node err=%d\n", __func__, ret); } #endif } /* if (ts->pen_support) */ Loading
drivers/input/touchscreen/xiaomi/nt36523/nt36xxx.h +1 −0 Original line number Diff line number Diff line Loading @@ -223,6 +223,7 @@ struct nvt_ts_data { #ifndef NVT_SAVE_TESTDATA_IN_FILE void *testdata; #endif bool pen_gen2_force; }; #if NVT_TOUCH_PROC Loading
drivers/input/touchscreen/xiaomi/nt36523/nt36xxx_fw_update.c +7 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,13 @@ static int32_t update_firmware_request(const char *filename) uint8_t retry = 0; int32_t ret = 0; if (ts->pen_gen2_force) { NVT_LOG("pen_gen2_force is enabled, force new pen fw.\n"); // clear the file name filename = "novatek_nt36523_k82_fw01_pen.bin"; NVT_LOG("filename was changed to %s\n", filename); } if (NULL == filename) { return -ENOENT; } Loading
include/linux/input/tp_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -12,3 +12,4 @@ struct tp_common_ops { int tp_common_set_double_tap_ops(struct tp_common_ops *ops); int tp_common_set_fod_status_ops(struct tp_common_ops *ops); int tp_common_set_pen_ops(struct tp_common_ops *ops); int tp_common_set_pen_gen2_force_ops(struct tp_common_ops *ops);