tp:fogona 2nd tp bringup[2/4]

WHY:tp bringup
HOW:add tp driver

Change-Id: Ie96309e9508f91aa0c941127d87eb6a3e4372b00
Reviewed-on: https://gerrit.mot.com/2682411
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Reviewed-by: Yan Zhang <zhangy26@motorola.com>
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
This commit is contained in:
longc 2023-07-20 11:55:59 +08:00 • committed by longc157
commit 2c3be28891
4 changed files with 22 additions and 7 deletions

View file

@ -33,6 +33,7 @@ endif
ifeq ($(CONFIG_INPUT_NOVA_USES_CHIP_VER_1),true)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_CHIP_VER_1=y
KBUILD_OPTIONS += CONFIG_INPUT_NOVA_CHIP_VER_1=y
endif
ifeq ($(CONFIG_INPUT_NOVA_ESD_ENABLE),true)

View file

@ -630,7 +630,6 @@ return:
static int32_t nvt_write_firmware(const u8 *fwdata, size_t fwsize)
{
uint32_t list = 0;
char *name;
uint32_t BIN_addr, SRAM_addr, size;
int32_t ret = 0;
@ -641,7 +640,6 @@ static int32_t nvt_write_firmware(const u8 *fwdata, size_t fwsize)
SRAM_addr = bin_map[list].SRAM_addr;
size = bin_map[list].size;
BIN_addr = bin_map[list].BIN_addr;
name = bin_map[list].name;
// NVT_LOG("[%d][%s] SRAM (0x%08X), SIZE (0x%08X), BIN (0x%08X)\n",
// list, name, SRAM_addr, size, BIN_addr);

View file

@ -448,10 +448,10 @@ static int nvt_mmi_methods_get_config_id(struct device *dev, void *cdata)
static int nvt_mmi_methods_get_bus_type(struct device *dev, void *idata)
{
struct nvt_ts_data *ts_data;
struct input_dev *input_dev;
GET_TS_DATA(dev);
input_dev = ts_data->input_dev;
TO_INT(idata) = ts->input_dev->id.bustype == BUS_SPI ?
TOUCHSCREEN_MMI_BUS_TYPE_SPI : TOUCHSCREEN_MMI_BUS_TYPE_I2C;
return 0;

View file

@ -359,9 +359,11 @@ static int32_t nvt_save_rawdata_to_csv(int32_t *rawdata, uint8_t x_ch, uint8_t y
int32_t iArrayIndex = 0;
struct file *fp = NULL;
char *fbufp = NULL;
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
mm_segment_t org_fs;
#endif
int32_t write_ret = 0;
uint32_t output_len = 0;
uint32_t output_len= 0;
loff_t pos = 0;
#if TOUCH_KEY_NUM > 0
int32_t k = 0;
@ -394,13 +396,21 @@ static int32_t nvt_save_rawdata_to_csv(int32_t *rawdata, uint8_t x_ch, uint8_t y
printk("\n");
sprintf(fbufp + y_ch * x_ch * 7 + y_ch * 2 + Key_Channel * 7, "\r\n");
#endif /* #if TOUCH_KEY_NUM > 0 */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
if (offset == 0)
fp = filp_open(file_path, O_RDWR | O_CREAT | O_TRUNC, 0666);
else
fp = filp_open(file_path, O_RDWR | O_CREAT, 0666);
#else
org_fs = get_fs();
set_fs(KERNEL_DS);
fp = filp_open(file_path, O_RDWR | O_CREAT, 0644);
#endif
if (fp == NULL || IS_ERR(fp)) {
NVT_ERR("open %s failed\n", file_path);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
set_fs(org_fs);
#endif
if (fbufp) {
kfree(fbufp);
fbufp = NULL;
@ -418,10 +428,15 @@ static int32_t nvt_save_rawdata_to_csv(int32_t *rawdata, uint8_t x_ch, uint8_t y
write_ret = vfs_write(fp, (char __user *)fbufp, output_len, &pos);
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
write_ret = kernel_write(fp, (char __user *)fbufp, output_len, &pos);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
write_ret = kernel_write(fp, (char __user *)fbufp, output_len, &pos);
#endif
if (write_ret <= 0) {
NVT_ERR("write %s failed\n", file_path);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
set_fs(org_fs);
#endif
if (fp) {
filp_close(fp, NULL);
fp = NULL;
@ -432,8 +447,9 @@ static int32_t nvt_save_rawdata_to_csv(int32_t *rawdata, uint8_t x_ch, uint8_t y
}
return -1;
}
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
set_fs(org_fs);
#endif
if (fp) {
filp_close(fp, NULL);
fp = NULL;