diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild b/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild index 8d3103c00771..61f8910998d4 100644 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/Kbuild @@ -30,6 +30,7 @@ ifneq ($(filter ft8756,$(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME)),) endif ifneq ($(filter ft8006s_aa,$(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME)),) EXTRA_CFLAGS += -DCONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT8006S_AA + EXTRA_CFLAGS += -DFOCALTECH_ESD_EN focaltech_0flash_mmi-objs += focaltech_test/supported_ic/focaltech_test_ft8006sp.o focaltech_0flash_mmi-objs += focaltech_flash_ft8006s.o focaltech_0flash_mmi-objs += focaltech_spi_v1_1_1.o diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h index 5f61d5022521..21960c64064e 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_config.h @@ -178,8 +178,13 @@ * ESD check & protection * default: disable */ -#if defined(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT8006S_AA) +#ifdef FOCALTECH_ESD_EN #define FTS_ESDCHECK_EN 1 +#if defined(CONFIG_INPUT_FOCALTECH_0FLASH_MMI_IC_NAME_FT8006S_AA) +#define FTS_DEBUG_ESD_EN 1 +#else +#define FTS_DEBUG_ESD_EN 0 +#endif #else #define FTS_ESDCHECK_EN 0 #endif diff --git a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_esdcheck.c b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_esdcheck.c index efd595fbcb14..3780212b5e4f 100755 --- a/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_esdcheck.c +++ b/drivers/input/touchscreen/focaltech_0flash_mmi/focaltech_esdcheck.c @@ -46,6 +46,26 @@ #define ESDCHECK_WAIT_TIME 1000 /* ms */ #define LCD_ESD_PATCH 0 +#if (!FTS_DEBUG_EN) +#if FTS_DEBUG_ESD_EN +#undef FTS_DEBUG +#undef FTS_FUNC_ENTER +#undef FTS_FUNC_EXIT +#define FTS_DEBUG(fmt, args...) do { \ + printk("[FTS_TS]%s:"fmt"\n", __func__, ##args); \ +} while (0) + +#define FTS_FUNC_ENTER() do { \ + printk("[FTS_TS]%s: Enter\n", __func__); \ +} while (0) + +#define FTS_FUNC_EXIT() do { \ + printk("[FTS_TS]%s: Exit(%d)\n", __func__, __LINE__); \ +} while (0) + +#endif +#endif + /***************************************************************************** * Private enumerations, structures and unions using typedef *****************************************************************************/ @@ -283,6 +303,7 @@ static void esdcheck_func(struct work_struct *work) fts_read_reg(FTS_REG_ESDCHECK_DISABLE, &val); if (0xA5 == val) { fts_esdcheck_data.mode = DISABLE; + FTS_DEBUG("[ESD]: is_incell, read REG 0x%x=0x%x\n, return", FTS_REG_ESDCHECK_DISABLE, val); return; } }