From 08a0bce0e5922ee58a4e16844f6d29d6de584a2a Mon Sep 17 00:00:00 2001 From: Wenge Zhu Date: Mon, 6 Nov 2023 16:01:22 +0800 Subject: [PATCH] Add IC type of GT9615 TP: Add IC type of GT9615(Marseille). Change-Id: If78eb28e317424b37b86c7677b38b01c35035465 Signed-off-by: Wenge Zhu Reviewed-on: https://gerrit.mot.com/2786221 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jun Weng Reviewed-by: Jichao Zou Submit-Approved: Jira Key --- .../goodix_gt96x_mmi/goodix_brl_fwupdate.c | 22 ++++++++++++++++++- .../goodix_gt96x_mmi/goodix_brl_hw.c | 3 ++- .../goodix_gt96x_mmi/goodix_brl_i2c.c | 1 + .../goodix_gt96x_mmi/goodix_brl_spi.c | 1 + .../goodix_gt96x_mmi/goodix_ts_core.h | 5 +++-- .../goodix_gt96x_mmi/goodix_ts_inspect.c | 15 ++++++++----- .../goodix_gt96x_mmi/goodix_ts_utils.c | 5 +++++ 7 files changed, 43 insertions(+), 9 deletions(-) diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_fwupdate.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_fwupdate.c index f975ee979162..ee845316b985 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_fwupdate.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_fwupdate.c @@ -40,16 +40,20 @@ #define ISP_RAM_ADDR_BRA 0x18400 #define ISP_RAM_ADDR_BRB 0x57000 #define ISP_RAM_ADDR_BRD 0x23800 +#define ISP_RAM_ADDR_MAR 0x3B800 #define HW_REG_CPU_RUN_FROM 0x10000 #define FLASH_CMD_REG_BRA 0x10400 #define FLASH_CMD_REG_BRB 0x13400 #define FLASH_CMD_REG_BRD 0x12400 +#define FLASH_CMD_REG_MAR 0x10174 #define HW_REG_ISP_BUFFER_BRA 0x10410 #define HW_REG_ISP_BUFFER_BRB 0x13410 #define HW_REG_ISP_BUFFER_BRD 0x12410 +#define HW_REG_ISP_BUFFER_MAR 0x12400 #define CONFIG_DATA_ADDR_BRA 0x3E000 #define CONFIG_DATA_ADDR_BRB 0x40000 #define CONFIG_DATA_ADDR_BRD 0x3E000 +#define CONFIG_DATA_ADDR_MAR 0x3F000 #define HOLD_CPU_REG_W 0x0002 #define HOLD_CPU_REG_R 0x2000 @@ -131,6 +135,19 @@ struct update_info_t update_brd = { ENABLE_MISCTL_BRD, }; +/* Marseille update info */ +struct update_info_t update_mar = { + FW_HEADER_SIZE, + FW_SUBSYS_INFO_OFFSET, + ISP_RAM_ADDR_MAR, + FLASH_CMD_REG_MAR, + HW_REG_ISP_BUFFER_MAR, + CONFIG_DATA_ADDR_MAR, + MISCTL_REG_BRD, + WATCH_DOG_REG_BRD, + ENABLE_MISCTL_BRD, +}; + enum compare_status { COMPARE_EQUAL = 0, COMPARE_NOCODE, @@ -484,7 +501,8 @@ static int goodix_update_prepare(struct fw_update_ctrl *fwu_ctrl) /* enable misctl clock */ if (fwu_ctrl->core_data->bus->ic_type == IC_TYPE_BERLIN_D || - fwu_ctrl->core_data->bus->ic_type == IC_TYPE_NOTTINGHAM) + fwu_ctrl->core_data->bus->ic_type == IC_TYPE_NOTTINGHAM || + fwu_ctrl->core_data->bus->ic_type == IC_TYPE_MARSEILLE) hw_ops->write(cd, misctl_reg, (u8 *)&enable_misctl_val, 4); else hw_ops->write(cd, misctl_reg, (u8 *)&enable_misctl_val, 1); @@ -1202,6 +1220,8 @@ int goodix_fw_update_init(struct goodix_ts_core *core_data) core_data->update_ctrl.update_info = &update_bra; else if (core_data->bus->ic_type == IC_TYPE_BERLIN_B) core_data->update_ctrl.update_info = &update_brb; + else if (core_data->bus->ic_type == IC_TYPE_MARSEILLE) + core_data->update_ctrl.update_info = &update_mar; else core_data->update_ctrl.update_info = &update_brd; diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c index a75f0947eb59..68c66484053c 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c @@ -1585,7 +1585,8 @@ static int brl_get_capacitance_data(struct goodix_ts_core *cd, } if (cd->bus->ic_type == IC_TYPE_BERLIN_D || - cd->bus->ic_type == IC_TYPE_NOTTINGHAM) + cd->bus->ic_type == IC_TYPE_NOTTINGHAM || + cd->bus->ic_type == IC_TYPE_MARSEILLE) return brld_get_cap_data(cd, info); /* disable irq & close esd */ diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_i2c.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_i2c.c index 664ad4192881..94b6abe59544 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_i2c.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_i2c.c @@ -208,6 +208,7 @@ static const struct of_device_id i2c_matchs[] = { {.compatible = "goodix,brl-b",}, {.compatible = "goodix,brl-d",}, {.compatible = "goodix,nottingham",}, + {.compatible = "goodix,marseille",}, {}, }; MODULE_DEVICE_TABLE(of, i2c_matchs); diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_spi.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_spi.c index aaf2c8782936..ebb58e111e1a 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_spi.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_spi.c @@ -245,6 +245,7 @@ static const struct of_device_id spi_matchs[] = { {.compatible = "goodix,brl-b",}, {.compatible = "goodix,brl-d",}, {.compatible = "goodix,nottingham",}, + {.compatible = "goodix,marseille",}, {}, }; #endif diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h index faafcca88bfc..31b92ce7a079 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h @@ -49,7 +49,7 @@ #define GOODIX_CORE_DRIVER_NAME "goodix_ts" #define GOODIX_PEN_DRIVER_NAME "goodix_ts,pen" -#define GOODIX_DRIVER_VERSION "v1.3.13" +#define GOODIX_DRIVER_VERSION "v1.3.14" #define GOODIX_MAX_TOUCH 10 #define GOODIX_MAX_KEY 10 #define GOODIX_PEN_MAX_PRESSURE 4096 @@ -117,7 +117,8 @@ enum IC_TYPE_ID { IC_TYPE_BERLIN_A, IC_TYPE_BERLIN_B, IC_TYPE_BERLIN_D, - IC_TYPE_NOTTINGHAM + IC_TYPE_NOTTINGHAM, + IC_TYPE_MARSEILLE }; /* SUB-ID diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c index 26f0c9f41357..a5b05ac7974c 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c @@ -1495,7 +1495,8 @@ static int goodix_cap_test_prepare(struct goodix_ts_test *ts_test) /* switch rawdata mode */ if (ts_test->ts->bus->ic_type == IC_TYPE_BERLIN_D || - ts_test->ts->bus->ic_type == IC_TYPE_NOTTINGHAM) { + ts_test->ts->bus->ic_type == IC_TYPE_NOTTINGHAM || + ts_test->ts->bus->ic_type == IC_TYPE_MARSEILLE) { temp_cmd.cmd = 0x90; temp_cmd.data[0] = 0x81; temp_cmd.len = 5; @@ -1532,7 +1533,8 @@ static int goodix_poll_rawdata(struct goodix_ts_test *ts_test, u8 data_type, u8 int retry; if (ts_test->ts->bus->ic_type == IC_TYPE_BERLIN_D || - ts_test->ts->bus->ic_type == IC_TYPE_NOTTINGHAM) + ts_test->ts->bus->ic_type == IC_TYPE_NOTTINGHAM || + ts_test->ts->bus->ic_type == IC_TYPE_MARSEILLE) flag_addr = ts_test->ts->ic_info.misc.frame_data_addr; if (data_type == GTP_MUTUAL_RAW) { @@ -1563,7 +1565,8 @@ static int goodix_poll_rawdata(struct goodix_ts_test *ts_test, u8 data_type, u8 frame_buf = kzalloc(FRAME_DATA_MAX_SIZE, GFP_KERNEL); if (cd->bus->ic_type == IC_TYPE_BERLIN_D || - cd->bus->ic_type == IC_TYPE_NOTTINGHAM) { + cd->bus->ic_type == IC_TYPE_NOTTINGHAM || + cd->bus->ic_type == IC_TYPE_MARSEILLE) { ret = ts_test_read(ts_test, flag_addr, frame_buf, FRAME_DATA_MAX_SIZE); if (ret < 0) goto free_exit; @@ -1611,7 +1614,8 @@ static int goodix_cache_rawdata(struct goodix_ts_test *ts_test) u32 flag_addr = ts_test->ts->ic_info.misc.touch_data_addr; if (ts_test->ts->bus->ic_type == IC_TYPE_BERLIN_D || - ts_test->ts->bus->ic_type == IC_TYPE_NOTTINGHAM) + ts_test->ts->bus->ic_type == IC_TYPE_NOTTINGHAM || + ts_test->ts->bus->ic_type == IC_TYPE_MARSEILLE) flag_addr = ts_test->ts->ic_info.misc.frame_data_addr; for (i = 0; i < DISCARD_FRAMES; i++) { @@ -1717,7 +1721,8 @@ static int goodix_cache_noisedata(struct goodix_ts_test *ts_test) u32 flag_addr = ts_test->ts->ic_info.misc.touch_data_addr; if (cd->bus->ic_type == IC_TYPE_BERLIN_D || - cd->bus->ic_type == IC_TYPE_NOTTINGHAM) { + cd->bus->ic_type == IC_TYPE_NOTTINGHAM || + cd->bus->ic_type == IC_TYPE_MARSEILLE) { flag_addr = ts_test->ts->ic_info.misc.frame_data_addr; temp_cmd.cmd = 0x90; temp_cmd.data[0] = 0x82; diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_utils.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_utils.c index de90dfb94bc6..dfdce7bf8197 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_utils.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_utils.c @@ -273,6 +273,11 @@ int goodix_get_ic_type(struct device_node *node, bus_inf->ic_type = IC_TYPE_NOTTINGHAM; return 0; } + if (strstr(ic_name, "marseille")) { + ts_info("ic type is marseille"); + bus_inf->ic_type = IC_TYPE_MARSEILLE; + return 0; + } ts_err("unsupported ic type %s", ic_name); return -EINVAL;