Merge pull request #14 from sticpaper/16.0

xiaomi nabu device touchpanel changes
This commit is contained in:
Pranav Vashi
2026-01-04 20:06:30 +05:30
committed by GitHub
8 changed files with 24631 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ TS_ENABLE_FOPS(double_tap)
TS_ENABLE_FOPS(fod_status)
TS_ENABLE_FOPS(pen)
TS_ENABLE_FOPS(pen_gen2_force)
TS_ENABLE_FOPS(game_mode)
static int __init tp_common_init(void)
{

View File

@@ -153,6 +153,29 @@ static struct tp_common_ops double_tap_ops = {
#endif
#endif
#ifdef CONFIG_TOUCHSCREEN_COMMON
static ssize_t nvt_game_mode_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%d\n", ts->nvt_game_mode);
}
static ssize_t nvt_game_mode_store(struct kobject *kobj,
struct kobj_attribute *attr, const char *buf, size_t count)
{
int value;
kstrtoint(buf, 10, &value);
ts->nvt_game_mode = !!value;
return count;
}
static struct tp_common_ops game_mode_ops = {
.show = nvt_game_mode_show,
.store = nvt_game_mode_store,
};
#endif
#ifdef CONFIG_MTK_SPI
const struct mt_chip_conf spi_ctrdata = {
.setuptime = 25,
@@ -3417,6 +3440,10 @@ static int32_t nvt_ts_probe(struct spi_device *client)
xiaomitouch_register_modedata(&xiaomi_touch_interfaces);
#endif
#ifdef CONFIG_TOUCHSCREEN_COMMON
tp_common_set_game_mode_ops(&game_mode_ops);
#endif
bTouchIsAwake = 1;
NVT_LOG("end\n");

View File

@@ -113,7 +113,7 @@ extern const uint16_t gesture_key_array[];
#define CHECK_PEN_DATA_CHECKSUM 0
//---ESD Protect.---
#define NVT_TOUCH_ESD_PROTECT 1
#define NVT_TOUCH_ESD_PROTECT 0
#define NVT_TOUCH_ESD_CHECK_PERIOD 1500 /* ms */
#define NVT_TOUCH_WDT_RECOVERY 1
@@ -224,6 +224,9 @@ struct nvt_ts_data {
void *testdata;
#endif
bool pen_gen2_force;
#ifdef CONFIG_TOUCHSCREEN_COMMON
bool nvt_game_mode;
#endif
};
#if NVT_TOUCH_PROC

View File

@@ -370,6 +370,20 @@ static int32_t update_firmware_request(const char *filename)
NVT_LOG("filename was changed to %s\n", filename);
}
#ifdef CONFIG_TOUCHSCREEN_COMMON
if (ts->nvt_game_mode) {
u8 *lockdown = ts->lockdown_info;
if (lockdown[1] == 0x42) {
pr_info("[touch]: cur csot Display panel use 0042 firmware\n");
filename = "novatek_nt36523_fw01_0042.bin";
} else if (lockdown[1] == 0x36) {
pr_info("[touch]: cur tianma Display panel use 0036 firmware\n");
filename = "novatek_nt36523_fw02_0036.bin";
}
}
#endif
if (NULL == filename) {
return -ENOENT;
}

View File

@@ -44,6 +44,8 @@ fw-shipped-$(CONFIG_TOUCHSCREEN_NT36523_HOSTDL_SPI) += novatek_ts_fw.bin novatek
fw-shipped-$(CONFIG_TOUCHSCREEN_NT36523_HOSTDL_SPI) += novatek_nt36523_fw01.bin novatek_nt36523_mp01.bin
fw-shipped-$(CONFIG_TOUCHSCREEN_NT36523_HOSTDL_SPI) += novatek_nt36523_fw02.bin novatek_nt36523_mp02.bin
fw-shipped-$(CONFIG_TOUCHSCREEN_NT36523_HOSTDL_SPI) += novatek_nt36523_fw01_pen.bin novatek_nt36523_mp01_pen.bin
fw-shipped-$(CONFIG_TOUCHSCREEN_NT36523_HOSTDL_SPI) += novatek_nt36523_fw01_0042.bin
fw-shipped-$(CONFIG_TOUCHSCREEN_NT36523_HOSTDL_SPI) += novatek_nt36523_fw02_0036.bin
fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -13,3 +13,4 @@ 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);
int tp_common_set_game_mode_ops(struct tp_common_ops *ops);