From 1af05bc261581274fac0d1027533bc86d6cc9335 Mon Sep 17 00:00:00 2001 From: Fenglin Wu Date: Wed, 29 Apr 2020 14:05:59 +0800 Subject: [PATCH] input: qcom-hv-haptics: set auto resonance when loading effects Set auto resonance when loading effect according to the effect settings. Change-Id: I8dc9ac99a57e396d67da28ae7b1eb31813ab3362 Signed-off-by: Fenglin Wu --- drivers/input/misc/qcom-hv-haptics.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index f2bd026db697..522608034ada 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -1232,6 +1232,10 @@ static int haptics_load_predefined_effect(struct haptics_chip *chip, if (rc < 0) return rc; + rc = haptics_enable_autores(chip, !play->effect->auto_res_disable); + if (rc < 0) + return rc; + play->pattern_src = play->effect->src; if (play->pattern_src != PATTERN1 && play->pattern_src != PATTERN2 && @@ -1396,6 +1400,10 @@ static int haptics_load_custom_effect(struct haptics_chip *chip, if (rc < 0) goto cleanup; + rc = haptics_enable_autores(chip, !play->effect->auto_res_disable); + if (rc < 0) + goto cleanup; + play->pattern_src = FIFO; rc = haptics_set_fifo(chip, play->effect->fifo); if (rc < 0)