diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c index 5f7099d152bc..c48d13d9f7ed 100644 --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.c +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.c @@ -581,6 +581,9 @@ static void fts_ts_trusted_touch_tvm_vm_mode_disable(struct fts_ts_data *fts_dat pr_debug("vm irq release succeded\n"); fts_release_all_finger(); + pm_runtime_put_sync(fts_data->client->adapter->dev.parent); + fts_ts_trusted_touch_set_tvm_driver_state(fts_data, + TVM_I2C_SESSION_RELEASED); rc = fts_ts_vm_mem_release(fts_data); if (rc) { pr_err("Failed to release mem rc:%d\n", rc); @@ -589,9 +592,6 @@ static void fts_ts_trusted_touch_tvm_vm_mode_disable(struct fts_ts_data *fts_dat fts_ts_trusted_touch_set_tvm_driver_state(fts_data, TVM_IOMEM_RELEASED); } - pm_runtime_put_sync(fts_data->client->adapter->dev.parent); - fts_ts_trusted_touch_set_tvm_driver_state(fts_data, - TVM_I2C_SESSION_RELEASED); fts_ts_trusted_touch_set_tvm_driver_state(fts_data, TRUSTED_TOUCH_TVM_INIT); atomic_set(&fts_data->trusted_touch_enabled, 0); pr_info("trusted touch disabled\n"); @@ -668,16 +668,16 @@ static void fts_ts_trusted_touch_abort_tvm(struct fts_ts_data *fts_data) case TVM_IOMEM_ACCEPTED: case TVM_IRQ_RELEASED: fts_release_all_finger(); + pm_runtime_put_sync(fts_data->client->adapter->dev.parent); + case TVM_I2C_SESSION_RELEASED: rc = fts_ts_vm_mem_release(fts_data); if (rc) pr_err("Failed to release mem rc:%d\n", rc); case TVM_IOMEM_RELEASED: - pm_runtime_put_sync(fts_data->client->adapter->dev.parent); - case TVM_I2C_SESSION_RELEASED: - case TVM_IOMEM_LENT_NOTIFIED: - case TVM_IRQ_LENT_NOTIFIED: case TVM_ALL_RESOURCES_LENT_NOTIFIED: case TRUSTED_TOUCH_TVM_INIT: + case TVM_IRQ_LENT_NOTIFIED: + case TVM_IOMEM_LENT_NOTIFIED: atomic_set(&fts_data->trusted_touch_enabled, 0); } diff --git a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h index 93ba0802aa10..370735397b0e 100644 --- a/drivers/input/touchscreen/focaltech_touch/focaltech_core.h +++ b/drivers/input/touchscreen/focaltech_touch/focaltech_core.h @@ -184,8 +184,8 @@ enum trusted_touch_tvm_states { TVM_INTERRUPT_ENABLED, TVM_INTERRUPT_DISABLED, TVM_IRQ_RELEASED, - TVM_IOMEM_RELEASED, TVM_I2C_SESSION_RELEASED, + TVM_IOMEM_RELEASED, TRUSTED_TOUCH_TVM_STATE_MAX }; diff --git a/drivers/input/touchscreen/st/fts.c b/drivers/input/touchscreen/st/fts.c index 480c0adfb21d..57f186450c7a 100644 --- a/drivers/input/touchscreen/st/fts.c +++ b/drivers/input/touchscreen/st/fts.c @@ -605,6 +605,9 @@ static void fts_trusted_touch_tvm_vm_mode_disable(struct fts_ts_info *info) flushFIFO(); release_all_touches(info); + pm_runtime_put_sync(info->client->adapter->dev.parent); + fts_trusted_touch_set_tvm_driver_state(info, + TVM_I2C_SESSION_RELEASED); rc = fts_vm_mem_release(info); if (rc) { pr_err("Failed to release mem rc:%d\n", rc); @@ -613,9 +616,6 @@ static void fts_trusted_touch_tvm_vm_mode_disable(struct fts_ts_info *info) fts_trusted_touch_set_tvm_driver_state(info, TVM_IOMEM_RELEASED); } - pm_runtime_put_sync(info->client->adapter->dev.parent); - fts_trusted_touch_set_tvm_driver_state(info, - TVM_I2C_SESSION_RELEASED); fts_trusted_touch_set_tvm_driver_state(info, TRUSTED_TOUCH_TVM_INIT); atomic_set(&info->trusted_touch_enabled, 0); pr_info("trusted touch disabled\n"); @@ -693,16 +693,16 @@ static void fts_trusted_touch_abort_tvm(struct fts_ts_info *info) case TVM_IRQ_RELEASED: flushFIFO(); release_all_touches(info); + pm_runtime_put_sync(info->client->adapter->dev.parent); + case TVM_I2C_SESSION_RELEASED: rc = fts_vm_mem_release(info); if (rc) pr_err("Failed to release mem rc:%d\n", rc); case TVM_IOMEM_RELEASED: - pm_runtime_put_sync(info->client->adapter->dev.parent); - case TVM_I2C_SESSION_RELEASED: - case TVM_IOMEM_LENT_NOTIFIED: - case TVM_IRQ_LENT_NOTIFIED: case TVM_ALL_RESOURCES_LENT_NOTIFIED: case TRUSTED_TOUCH_TVM_INIT: + case TVM_IRQ_LENT_NOTIFIED: + case TVM_IOMEM_LENT_NOTIFIED: atomic_set(&info->trusted_touch_enabled, 0); } diff --git a/drivers/input/touchscreen/st/fts.h b/drivers/input/touchscreen/st/fts.h index 2745a18d4238..06830dfb35f5 100644 --- a/drivers/input/touchscreen/st/fts.h +++ b/drivers/input/touchscreen/st/fts.h @@ -246,8 +246,8 @@ enum trusted_touch_tvm_states { TVM_INTERRUPT_ENABLED, TVM_INTERRUPT_DISABLED, TVM_IRQ_RELEASED, - TVM_IOMEM_RELEASED, TVM_I2C_SESSION_RELEASED, + TVM_IOMEM_RELEASED, TRUSTED_TOUCH_TVM_STATE_MAX };