diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c index e21f266d3a00..811ce61464c2 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c @@ -3474,7 +3474,7 @@ END: int himax_chip_common_resume(struct himax_ts_data *ts) { -#if defined(HX_RST_PIN_FUNC) && defined(HX_RESUME_HW_RESET) && defined(HX_ZERO_FLASH) +#if defined(HX_ZERO_FLASH) && defined(HX_RESUME_SET_FW) int result = 0; #endif I("%s: enter\n", __func__); @@ -3497,21 +3497,15 @@ int himax_chip_common_resume(struct himax_ts_data *ts) if (ts->pdata->powerOff3V3 && ts->pdata->power) ts->pdata->power(1); - -#if defined(HX_SMART_WAKEUP) || defined(HX_HIGH_SENSE) || defined(HX_USB_DETECT_GLOBAL) - if (g_core_fp.fp_resend_cmd_func != NULL) - g_core_fp.fp_resend_cmd_func(ts->suspended); - -#ifdef HX_CODE_OVERLAY - if (ts->SMWP_enable && ts->in_self_test == 0) - g_core_fp.fp_0f_overlay(3, 0); -#endif - -#elif defined(HX_RST_PIN_FUNC) && defined(HX_RESUME_HW_RESET) +#if defined(HX_RST_PIN_FUNC) && defined(HX_RESUME_HW_RESET) if (g_core_fp.fp_ic_reset != NULL) g_core_fp.fp_ic_reset(false, false); -#ifdef HX_ZERO_FLASH - I("It will update fw after esd event in zero flash mode!\n"); +#endif +#if defined(HX_ZERO_FLASH) && defined(HX_RESUME_SET_FW) +#ifdef HX_SMART_WAKEUP + if (!ts->SMWP_enable) { +#endif + I("It will update fw after resume in zero flash mode!\n"); if (g_core_fp.fp_0f_operation_dirly != NULL) { result = g_core_fp.fp_0f_operation_dirly(); if (result) { @@ -3523,6 +3517,17 @@ int himax_chip_common_resume(struct himax_ts_data *ts) g_core_fp.fp_reload_disable(0); if (g_core_fp.fp_sense_on != NULL) g_core_fp.fp_sense_on(0x00); +#ifdef HX_SMART_WAKEUP + } +#endif +#endif +#if defined(HX_SMART_WAKEUP) || defined(HX_HIGH_SENSE) || defined(HX_USB_DETECT_GLOBAL) + if (g_core_fp.fp_resend_cmd_func != NULL) + g_core_fp.fp_resend_cmd_func(ts->suspended); + +#ifdef HX_CODE_OVERLAY + if (ts->SMWP_enable && ts->in_self_test == 0) + g_core_fp.fp_0f_overlay(3, 0); #endif #endif himax_report_all_leave_event(ts); @@ -3530,7 +3535,7 @@ int himax_chip_common_resume(struct himax_ts_data *ts) if (g_core_fp.fp_sense_on != NULL) g_core_fp.fp_resume_ic_action(); himax_int_enable(1); -#if defined(HX_RST_PIN_FUNC) && defined(HX_RESUME_HW_RESET) && defined(HX_ZERO_FLASH) +#if defined(HX_ZERO_FLASH) && defined(HX_RESUME_SET_FW) ESCAPE_0F_UPDATE: #endif END: diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.h b/drivers/input/touchscreen/himax_v2_mmi/himax_common.h index de840b5acb7d..499c446bc859 100755 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.h +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.h @@ -76,10 +76,11 @@ /*#define HX_USB_DETECT_GLOBAL*/ /*#define HX_USB_DETECT_CALLBACK*/ /*#define HX_PROTOCOL_A*/ /* for MTK special platform.If turning on,it will report to system by using specific format. */ -/*#define HX_RESUME_HW_RESET*/ +#define HX_RESUME_HW_RESET #define HX_PROTOCOL_B_3PA /*#define HX_FIX_TOUCH_INFO*/ /* if open, you need to change the touch info in the fix_touch_info*/ /*#define HX_ZERO_FLASH*/ +/*#define HX_RESUME_SET_FW*/ /*#if defined(HX_ZERO_FLASH)*/ /*#define HX_CODE_OVERLAY*/ /*#define HX_EDGE_LIMIT*/ @@ -361,6 +362,7 @@ struct himax_ts_data { int use_irq; int (*power)(int on); int pre_finger_data[10][2]; + bool vdd_1v8_always_on; struct device *dev; struct workqueue_struct *himax_wq; diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_ic_incell_core.c b/drivers/input/touchscreen/himax_v2_mmi/himax_ic_incell_core.c index 85cde1dea749..aa67c4400e84 100755 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_ic_incell_core.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_ic_incell_core.c @@ -2019,11 +2019,20 @@ static int himax_mcu_fw_ver_bin(void) #ifdef HX_RST_PIN_FUNC static void himax_mcu_pin_reset(void) { - I("%s: Now reset the Touch chip.\n", __func__); + I("%s: Now reset the Touch chip,private_ts->vdd_1v8_always_on = %d \n", + __func__,private_ts->vdd_1v8_always_on); himax_rst_gpio_set(private_ts->rst_gpio, 0); - msleep(20); + if(private_ts->vdd_1v8_always_on) + msleep(10); + else + msleep(20); himax_rst_gpio_set(private_ts->rst_gpio, 1); - msleep(50); +#ifdef HX_ZERO_FLASH + msleep(10); +#else + msleep(50); +#endif + } static void himax_mcu_ic_reset(uint8_t loadconfig, uint8_t int_off) diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c index 6ae8b79a9aaa..eead5c73a82a 100755 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_platform_QCT_SPI.c @@ -196,6 +196,11 @@ int himax_parse_dt(struct himax_ts_data *ts, I(" DT:protocol_type=%d\n", pdata->protocol_type); } + ts->vdd_1v8_always_on = of_property_read_bool(dt, "himax,vdd_1v8_always_on"); + if (ts->vdd_1v8_always_on){ + I(" DT:vdd_1v8_always_on=%d\n", ts->vdd_1v8_always_on); + } + himax_vk_parser(dt, pdata); return 0; }