mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
touch:nt36xxx: support nt36525c
Caprip: 1st djn+NT36525c nt36535c touch driver support NO_PROP_NEEDED: needn't for shm2018 Change-Id: I8b609a7e0c6e050ddff12c8675e68e4488ca721d Signed-off-by: hujing3 <hujing3@lenovo.com> Reviewed-on: https://gerrit.mot.com/1763079 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
9e84ff86b7
commit
5fbaf3f0b4
4 changed files with 38 additions and 7 deletions
|
|
@ -15,8 +15,12 @@ ifneq ($(BOARD_USES_PANEL_NOTIFICATIONS),)
|
|||
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_PANEL_NOTIFICATIONS=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_INPUT_ENABLE_DRM_PANEL),)
|
||||
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_DRM_PANEL=y
|
||||
ifeq ($(CONFIG_INPUT_ENABLE_DRM_PANEL),true)
|
||||
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_DRM_PANEL=y
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_NOVA_USES_CHIP_VER_1),true)
|
||||
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_CHIP_VER_1=y
|
||||
endif
|
||||
|
||||
ifneq ($(BOARD_USES_PEN_NOTIFIER),)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@ ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_DRM_PANEL)),)
|
|||
EXTRA_CFLAGS += -DNVT_CONFIG_DRM_PANEL
|
||||
endif
|
||||
|
||||
ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_CHIP_VER_1)),)
|
||||
EXTRA_CFLAGS += -DNVT_CONFIG_CHIP_VER_1
|
||||
endif
|
||||
|
||||
ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM)),)
|
||||
EXTRA_CFLAGS += -DPALM_GESTURE
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -1145,12 +1145,14 @@ static int nova_check_dt(struct device_node *np)
|
|||
if (count <= 0)
|
||||
return 0;
|
||||
|
||||
NVT_LOG("nova_check_dt, count=%d\n", count);
|
||||
for (i = 0; i < count; i++) {
|
||||
node = of_parse_phandle(np, "panel", i);
|
||||
panel = of_drm_find_panel(node);
|
||||
of_node_put(node);
|
||||
if (!IS_ERR(panel)) {
|
||||
active_panel = panel;
|
||||
NVT_LOG("nova_check_dt, active_panel found!\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1694,7 +1696,7 @@ Description:
|
|||
return:
|
||||
Executive outcomes. 0---NVT IC. -1---not NVT IC.
|
||||
*******************************************************/
|
||||
static int8_t nvt_ts_check_chip_ver_trim(void)
|
||||
static int8_t nvt_ts_check_chip_ver_trim(uint32_t chip_ver_trim_addr)
|
||||
{
|
||||
uint8_t buf[8] = {0};
|
||||
int32_t retry = 0;
|
||||
|
|
@ -1708,10 +1710,9 @@ static int8_t nvt_ts_check_chip_ver_trim(void)
|
|||
|
||||
nvt_bootloader_reset();
|
||||
|
||||
//---set xdata index to 0x1F600---
|
||||
nvt_set_page(0x1F64E);
|
||||
nvt_set_page(chip_ver_trim_addr);
|
||||
|
||||
buf[0] = 0x4E;
|
||||
buf[0] = chip_ver_trim_addr & 0x7F;
|
||||
buf[1] = 0x00;
|
||||
buf[2] = 0x00;
|
||||
buf[3] = 0x00;
|
||||
|
|
@ -1719,6 +1720,7 @@ static int8_t nvt_ts_check_chip_ver_trim(void)
|
|||
buf[5] = 0x00;
|
||||
buf[6] = 0x00;
|
||||
CTP_SPI_READ(ts->client, buf, 7);
|
||||
NVT_LOG("nvt_ts_check_chip_ver_trim: buf[0]=0x%02X\n", buf[0]);
|
||||
NVT_LOG("buf[1]=0x%02X, buf[2]=0x%02X, buf[3]=0x%02X, buf[4]=0x%02X, buf[5]=0x%02X, buf[6]=0x%02X\n",
|
||||
buf[1], buf[2], buf[3], buf[4], buf[5], buf[6]);
|
||||
|
||||
|
|
@ -2174,7 +2176,15 @@ static int32_t nvt_ts_probe(struct spi_device *client)
|
|||
msleep(10);
|
||||
|
||||
//---check chip version trim---
|
||||
ret = nvt_ts_check_chip_ver_trim();
|
||||
#ifdef NVT_CONFIG_CHIP_VER_1
|
||||
ret = nvt_ts_check_chip_ver_trim(CHIP_VER_TRIM_ADDR_V1);
|
||||
if (ret) {
|
||||
NVT_LOG("try to check from old chip ver trim address\n");
|
||||
ret = nvt_ts_check_chip_ver_trim(CHIP_VER_TRIM_ADDR_V0);
|
||||
}
|
||||
#else
|
||||
ret = nvt_ts_check_chip_ver_trim(CHIP_VER_TRIM_ADDR_V0);
|
||||
#endif
|
||||
if (ret) {
|
||||
NVT_ERR("chip is not identified\n");
|
||||
ret = -EINVAL;
|
||||
|
|
@ -2926,6 +2936,7 @@ static int nvt_drm_notifier_callback(struct notifier_block *self, unsigned long
|
|||
struct nvt_ts_data *ts =
|
||||
container_of(self, struct nvt_ts_data, drm_notif);
|
||||
|
||||
NVT_LOG("nvt_drm_notifier_callback start\n");
|
||||
if (!evdata)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
* more details.
|
||||
*
|
||||
*/
|
||||
#define CHIP_VER_TRIM_ADDR_V1 0x3F004
|
||||
#define CHIP_VER_TRIM_ADDR_V0 0x1F64E
|
||||
|
||||
struct nvt_ts_mem_map {
|
||||
uint32_t EVENT_BUF_ADDR;
|
||||
|
|
@ -254,6 +256,16 @@ struct nvt_ts_trim_id_table {
|
|||
};
|
||||
|
||||
static const struct nvt_ts_trim_id_table trim_id_table[] = {
|
||||
{.trim_id = "NT36675",.id = {0x0D, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
|
||||
.mmap = &NT36675_memory_map, .hwinfo = &NT36675_hw_info},
|
||||
{.trim_id = "NT36675",.id = {0x20, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
|
||||
.mmap = &NT36675_memory_map, .hwinfo = &NT36675_hw_info},
|
||||
{.trim_id = "NT36675",.id = {0x00, 0xFF, 0xFF, 0x80, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
|
||||
.mmap = &NT36675_memory_map, .hwinfo = &NT36675_hw_info},
|
||||
{.trim_id = "NT36525C",.id = {0x0C, 0xFF, 0xFF, 0x25, 0x65, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
|
||||
.mmap = &NT36672A_memory_map, .hwinfo = &NT36672A_hw_info},
|
||||
{.trim_id = "NT36675",.id = {0x0E, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
|
||||
.mmap = &NT36675_memory_map, .hwinfo = &NT36675_hw_info},
|
||||
{.trim_id = "NT36672C",.id = {0x0C, 0xFF, 0xFF, 0x72, 0x66, 0x03}, .mask = {1, 0, 0, 1, 1, 1},
|
||||
.mmap = &NT36675_memory_map, .hwinfo = &NT36675_hw_info},
|
||||
{.trim_id = "NT36526",.id = {0xFF, 0xFF, 0xFF, 0x26, 0x65, 0x03}, .mask = {0, 0, 0, 1, 1, 1},
|
||||
|
|
|
|||
Loading…
Reference in a new issue