focaltech_0flash_mmi: Make sure SPI bus not suspend

TP:
When Palm sensor is enabled, make sure device is in active state.
Because in this situation, TP interrupt is active, and data need read
from SPI bus.

Change-Id: I5769a987d278a299b5a7de9ea19ac421cb3c9fe3
Signed-off-by: haojl2 <haojl2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1411932
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
haojl2 2019-08-28 17:13:58 +08:00 • committed by Jialei Hao
commit 14cb51b3f8

View file

@ -843,25 +843,6 @@ static void fts_irq_read_report(void)
static irqreturn_t fts_irq_handler(int irq, void *data)
{
/*
* If palm detect function is enabled, interrupt will not disable, IC works in
* normal mode. But in case touch event is reported to input subsystem, skip
* touch event when suspend flag is true. So input subsystem will not take
* wakelock because no one report event.
* In this case, we still need read data from IC, so AP can not enter suspend.
* Add a 10ms wakelock when this function is enabled. (TP report rate is around
* 100Hz).
*/
#ifdef FOCALTECH_PALM_SENSOR_EN
if (fts_data->palm_detection_enabled) {
#ifdef CONFIG_HAS_WAKELOCK
wake_lock_timeout(&fts_data->palm_gesture_read_wakelock, 10);
#else
__pm_wakeup_event(&fts_data->palm_gesture_read_wakelock, 10);
#endif
}
#endif
fts_irq_read_report();
return IRQ_HANDLED;
}
@ -977,7 +958,19 @@ static void fts_palm_sensor_release_timer_handler(unsigned long data)
static int _fts_palm_sensor_set_enable(unsigned int enable)
{
FTS_INFO("Palm gesture set enable %d!", enable);
/*
* If palm detect function is enabled, interrupt will not disable, IC works in
* normal mode. But in case touch event is reported to input subsystem, skip
* touch event when suspend flag is true. So input subsystem will not take
* wakelock because no one report event.
* In this case, we still need read data from IC, so AP can not enter suspend.
*/
if (enable == 1) {
#ifdef CONFIG_HAS_WAKELOCK
wake_lock(&fts_data->palm_gesture_read_wakelock);
#else
__pm_stay_awake(&fts_data->palm_gesture_read_wakelock);
#endif
fts_data->palm_detection_enabled = true;
fts_write_reg(0xB0, 0x01);
} else if (enable == 0) {
@ -987,6 +980,11 @@ static int _fts_palm_sensor_set_enable(unsigned int enable)
del_timer(&fts_data->palm_release_fimer);
}
fts_write_reg(0xB0, 0x00);
#ifdef CONFIG_HAS_WAKELOCK
wake_unlock(&fts_data->palm_gesture_read_wakelock);
#else
__pm_relax(&fts_data->palm_gesture_read_wakelock);
#endif
} else {
FTS_INFO("unknown enable symbol\n");
}