diff --git a/drivers/input/touchscreen/chipone_tddi_mmi/Android.mk b/drivers/input/touchscreen/chipone_tddi_mmi/Android.mk index aa59519ff5f4..19b33f5b1b41 100644 --- a/drivers/input/touchscreen/chipone_tddi_mmi/Android.mk +++ b/drivers/input/touchscreen/chipone_tddi_mmi/Android.mk @@ -6,6 +6,9 @@ CHIPONE_MMI_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules/ else CHIPONE_MMI_MODULE_PATH := $(KERNEL_MODULES_OUT) endif +ifeq ($(CHIPONE_ESD),true) + KERNEL_CFLAGS += CONFIG_CHIPONE_ESD=y +endif include $(CLEAR_VARS) LOCAL_MODULE := chipone_tddi_mmi.ko diff --git a/drivers/input/touchscreen/chipone_tddi_mmi/Kbuild b/drivers/input/touchscreen/chipone_tddi_mmi/Kbuild index c95271914f3c..5e80594cde76 100644 --- a/drivers/input/touchscreen/chipone_tddi_mmi/Kbuild +++ b/drivers/input/touchscreen/chipone_tddi_mmi/Kbuild @@ -2,6 +2,9 @@ EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include \ -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/chipone_tddi_mmi +ifneq ($(filter m y,$(CONFIG_CHIPONE_ESD)),) +EXTRA_CFLAGS += -DCONFIG_CTS_ESD_PROTECTION +endif obj-m := chipone_tddi_mmi.o diff --git a/drivers/input/touchscreen/chipone_tddi_mmi/cts_core.c b/drivers/input/touchscreen/chipone_tddi_mmi/cts_core.c index 5aaf479d530b..65565cd174dc 100755 --- a/drivers/input/touchscreen/chipone_tddi_mmi/cts_core.c +++ b/drivers/input/touchscreen/chipone_tddi_mmi/cts_core.c @@ -2169,8 +2169,8 @@ int cts_stop_device(struct cts_device *cts_dev) int cts_start_device_esdrecover(struct cts_device *cts_dev) { #ifdef CONFIG_CTS_ESD_PROTECTION - struct chipone_ts_data *cts_data = - container_of(cts_dev, struct chipone_ts_data, cts_dev); + //struct chipone_ts_data *cts_data = + // container_of(cts_dev, struct chipone_ts_data, cts_dev); #endif /* CONFIG_CTS_ESD_PROTECTION */ int ret; diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882.c b/drivers/input/touchscreen/ili9882_mmi/ili9882.c index 1a9910ea3a62..3a09cdb8e86a 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882.c @@ -234,7 +234,7 @@ int ili_wq_esd_i2c_check(void) static void ilitek_tddi_wq_esd_check(struct work_struct *work) { mutex_lock(&ilits->touch_mutex); - if (ilits->esd_recover() < 0) { + if (!ilits->tp_suspend && ilits->esd_recover() < 0) { ILI_ERR("SPI ACK failed, doing spi recovery\n"); ili_spi_recovery(); } diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c index 2a3afdc79e5a..7a0ae39a3ea8 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_qcom.c @@ -443,8 +443,13 @@ static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long ev */ if (event == DRM_PANEL_EARLY_EVENT_BLANK) { - if (ili_sleep_handler(TP_SUSPEND) < 0) - ILI_ERR("TP suspend failed\n"); + if (ilits->tp_module == MODEL_TM) { + if (ili_sleep_handler(TP_DEEP_SLEEP) < 0) + ILI_ERR("TP deep sleep in failed\n"); + } else { + if (ili_sleep_handler(TP_SUSPEND) < 0) + ILI_ERR("TP suspend failed\n"); + } #ifdef ILI_CONFIG_GESTURE touch_set_state(TOUCH_LOW_POWER_STATE, TOUCH_PANEL_IDX_PRIMARY); #endif diff --git a/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c b/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c index 64e26a3c1602..dc0fc43e121b 100755 --- a/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c +++ b/drivers/input/touchscreen/ili9882_mmi/ili9882_spi.c @@ -273,7 +273,7 @@ static int ili_spi_wrapper(u8 *txbuf, u32 wlen, u8 *rxbuf, u32 rlen, bool spi_ir { int ret = 0; int mode = 0, index = 0; - u8 wdata[32] = {0}; + u8 wdata[128] = {0}; u8 checksum = 0; bool ice = atomic_read(&ilits->ice_stat); @@ -286,7 +286,7 @@ static int ili_spi_wrapper(u8 *txbuf, u32 wlen, u8 *rxbuf, u32 rlen, bool spi_ir /* 3 bytes data consist of length and header */ if ((wlen + 3) > sizeof(wdata)) { ILI_ERR("WARNING! wlen(%d) > wdata(%d), using wdata length to transfer\n", wlen, (int)sizeof(wdata)); - wlen = sizeof(wdata); + wlen = sizeof(wdata) - 3; } } @@ -333,9 +333,9 @@ static int ili_spi_wrapper(u8 *txbuf, u32 wlen, u8 *rxbuf, u32 rlen, bool spi_ir index = 3; } - wlen += index; ipio_memcpy(&wdata[index], txbuf, wlen, wlen); + wlen += index; /* * NOTE: If TP driver is doing MP test and commanding 0xF1 to FW, we add a checksum