diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c index 811ce61464c2..9a4fc2ef9d15 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c @@ -3045,6 +3045,14 @@ device_destroy: return -ENODEV; } +#if defined(HX_RESUME_SET_FW) +void himax_resume_work_func(struct work_struct *work) +{ + struct himax_ts_data *ts = private_ts; + himax_chip_common_resume(ts); + return; +} +#endif int himax_chip_common_init(void) { @@ -3199,6 +3207,14 @@ FW_force_upgrade: queue_delayed_work(ts->himax_0f_update_wq, &ts->work_0f_update, msecs_to_jiffies(2000)); #endif +#ifdef HX_RESUME_SET_FW + ts->ts_int_workqueue = create_singlethread_workqueue("himax_ts_resume_wq"); + if (!ts->ts_int_workqueue) { + E("%s: create ts_resume workqueue failed\n", __func__); + goto err_create_ts_resume_wq_failed; + } + INIT_WORK(&ts->ts_int_work, himax_resume_work_func); +#endif /*Himax Power On and Load Config*/ if (himax_loadSensorConfig(pdata)) { E("%s: Load Sesnsor configuration failed, unload driver.\n", __func__); @@ -3313,6 +3329,11 @@ err_get_intr_bit_failed: err_input_register_device_failed: input_free_device(ts->input_dev); err_detect_failed: +#ifdef HX_RESUME_SET_FW + cancel_work_sync(&ts->ts_int_work); + destroy_workqueue(ts->ts_int_workqueue); +err_create_ts_resume_wq_failed: +#endif #ifdef HX_ZERO_FLASH cancel_delayed_work_sync(&ts->work_0f_update); destroy_workqueue(ts->himax_0f_update_wq); @@ -3497,10 +3518,13 @@ int himax_chip_common_resume(struct himax_ts_data *ts) if (ts->pdata->powerOff3V3 && ts->pdata->power) ts->pdata->power(1); +#ifndef HX_RESUME_SET_FW #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); #endif +#endif + #if defined(HX_ZERO_FLASH) && defined(HX_RESUME_SET_FW) #ifdef HX_SMART_WAKEUP if (!ts->SMWP_enable) { diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.h b/drivers/input/touchscreen/himax_v2_mmi/himax_common.h index 499c446bc859..e8aaf541274d 100755 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.h +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.h @@ -80,7 +80,7 @@ #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*/ +#define HX_RESUME_SET_FW /*#if defined(HX_ZERO_FLASH)*/ /*#define HX_CODE_OVERLAY*/ /*#define HX_EDGE_LIMIT*/ @@ -408,6 +408,10 @@ struct himax_ts_data { struct workqueue_struct *himax_0f_update_wq; struct delayed_work work_0f_update; #endif +#ifdef HX_RESUME_SET_FW + struct workqueue_struct *ts_int_workqueue; + struct work_struct ts_int_work; +#endif struct workqueue_struct *himax_diag_wq; struct delayed_work himax_diag_delay_wrok; 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 eead5c73a82a..2191632c6faa 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 @@ -844,6 +844,15 @@ static int himax_common_suspend(struct device *dev) return 0; } +#if defined(HX_RESUME_SET_FW) +void himax_resume_thread_func(void) +{ + struct himax_ts_data *ts = private_ts; + I("%s: TP resume from thread\n", __func__); + queue_work(ts->ts_int_workqueue, &ts->ts_int_work); + return; +} +#endif static int himax_common_resume(struct device *dev) { struct himax_ts_data *ts = dev_get_drvdata(dev); @@ -859,7 +868,11 @@ static int himax_common_resume(struct device *dev) return -ECANCELED; } #endif +#if defined(HX_RESUME_SET_FW) + himax_resume_thread_func(); +#else himax_chip_common_resume(ts); +#endif return 0; }