guam: input add touch ili9882n support

input touch ili9882n
support
NO_PROP_NEEDED

Change-Id: I121bebedd5ecc10ea517b8ac6b2282214e36a291
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1722171
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
dengwei1 2020-08-14 10:27:39 +08:00 • committed by Wei Deng
commit 6d473cd9b0
5 changed files with 22 additions and 13 deletions

View file

@ -27,7 +27,7 @@
#define DEF_INI_NAME_PATH "/sdcard/mp.ini"
#define DEF_FW_FILP_PATH "/sdcard/ILITEK_FW"
#define DEF_INI_REQUEST_PATH "mp.ini"
#define DEF_FW_REQUEST_PATH "ilitek_fw.bin"
#define DEF_FW_REQUEST_PATH "ILITEK_FW"
static unsigned char CTPM_FW_DEF[] = {
};
@ -82,7 +82,7 @@ static unsigned char CTPM_FW_TXD[] = {
#define TM_INI_NAME_PATH "/sdcard/mp_tm.ini"
#define TM_FW_FILP_PATH "/sdcard/ILITEK_FW_TM"
#define TM_INI_REQUEST_PATH "mp_tm.ini"
#define TM_FW_REQUEST_PATH "ILITEK_FW_TM"
#define TM_FW_REQUEST_PATH "ILITEK_FW_TM.hex"
static unsigned char CTPM_FW_TM[] = {
0xFF,
};

View file

@ -814,8 +814,7 @@ static int ilitek_get_tp_module(void)
* if there are various tp modules been used in projects.
*/
return 0;
//return MODEL_HLT;
return ilits->tp_module;
}
static void ili_update_tp_module_info(void)
@ -880,7 +879,7 @@ static void ili_update_tp_module_info(void)
ilits->md_fw_ili_size = sizeof(CTPM_FW_TXD);
break;
case MODEL_TM:
ilits->md_name = "TM";
ilits->md_name = "ILITEK_TDDI_TM";
ilits->md_fw_filp_path = TM_FW_REQUEST_PATH;
ilits->md_fw_rq_path = TM_FW_REQUEST_PATH;
ilits->md_ini_path = TM_INI_NAME_PATH;
@ -889,7 +888,7 @@ static void ili_update_tp_module_info(void)
ilits->md_fw_ili_size = sizeof(CTPM_FW_TM);
break;
case MODEL_HLT:
ilits->md_name = "HLT";
ilits->md_name = "ILITEK_TDDI_HLT";
ilits->md_fw_filp_path = HLT_FW_REQUEST_PATH;
ilits->md_fw_rq_path = HLT_FW_REQUEST_PATH;
ilits->md_ini_path = HLT_INI_NAME_PATH;
@ -901,7 +900,7 @@ static void ili_update_tp_module_info(void)
break;
}
if (module == 0 || ilits->md_fw_ili_size < ILI_FILE_HEADER) {
if (module == 0) {
ILI_ERR("Couldn't find any tp modules, applying default settings\n");
ilits->md_name = "DEF";
ilits->md_fw_filp_path = DEF_FW_FILP_PATH;
@ -918,8 +917,6 @@ static void ili_update_tp_module_info(void)
ilits->md_fw_filp_path,
ilits->md_fw_rq_path,
ilits->md_fw_ili_size);
ilits->tp_module = module;
}
int ili_tddi_init(void)

View file

@ -429,7 +429,7 @@ struct report_info_block {
#define TOUCH_SCREEN_Y_MIN 0
#define TOUCH_SCREEN_X_MAX 720
#define TOUCH_SCREEN_Y_MAX 1600
#define MAX_TOUCH_NUM 5
#define MAX_TOUCH_NUM 10
/* define the range on panel */
#define TPD_HEIGHT 2048

View file

@ -50,7 +50,7 @@ void ili_input_register(void)
return;
}
ilits->input->name = ilits->hwif->name;
ilits->input->name = ilits->md_name;
ilits->input->phys = ilits->phys;
ilits->input->dev.parent = ilits->dev;
ilits->input->id.bustype = ilits->hwif->bus_type;

View file

@ -456,7 +456,17 @@ static int check_dt(struct device_node *np)
of_node_put(node);
if (!IS_ERR(panel)) {
ili_active_panel = panel;
return 0;
pr_err("%s: ili9882h HLT actived\n", __func__);
return MODEL_HLT;
} else {
node = of_parse_phandle(np, "panel2", i);
panel = of_drm_find_panel(node);
of_node_put(node);
if (!IS_ERR(panel)) {
ili_active_panel = panel;
pr_err("%s: ili9882n TM actived\n", __func__);
return MODEL_TM;
}
}
}
if (node)
@ -470,6 +480,7 @@ static int ilitek_spi_probe(struct spi_device *spi)
struct touch_bus_info *info =
container_of(to_spi_driver(spi->dev.driver),
struct touch_bus_info, bus_driver);
int tp_module = 0;
ILI_INFO("ilitek spi probe\n");
@ -481,7 +492,7 @@ static int ilitek_spi_probe(struct spi_device *spi)
#ifdef CONFIG_DRM
{
struct device_node *dp = spi->dev.of_node;
if (check_dt(dp)) {
if ((tp_module = check_dt(dp)) < 0) {
ILI_ERR("%s: %s not actived\n", __func__, dp->name);
return -ENODEV;
}
@ -538,6 +549,7 @@ static int ilitek_spi_probe(struct spi_device *spi)
ilits->detect_int_stat = ili_ic_check_int_pulse;
ilits->int_pulse = true;
ilits->mp_retry = false;
ilits->tp_module = tp_module;
#if SPI_DMA_TRANSFER_SPLIT
ilits->spi_write_then_read = ili_spi_write_then_read_split;