From 9794c4dbeb7d9acfc5050ee5f6fca6f819fabbdf Mon Sep 17 00:00:00 2001 From: Fenglin Wu Date: Tue, 9 Jun 2020 08:54:31 +0800 Subject: [PATCH] input: qcom-hv-haptics: adjust frequency calibration sequence Adjust following settings in frequency calibration sequence according to HW recommendation: 1) Use 50% auto resonance detection error window. 2) Play for 150 ms before reading the calibration result. Change-Id: Id43376f6878daedaf98b1d9065a3b0b363314add Signed-off-by: Fenglin Wu --- drivers/input/misc/qcom-hv-haptics.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index c30669fe12bb..bd73ac348607 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -3279,7 +3279,7 @@ static int haptics_start_lra_calibration(struct haptics_chip *chip) HAP_CFG_AUTORES_CFG_REG, AUTORES_EN_BIT | AUTORES_EN_DLY_MASK | AUTORES_ERR_WINDOW_MASK, AUTORES_EN_DLY_1_CYCLE << AUTORES_EN_DLY_SHIFT - | AUTORES_ERR_WINDOW_25_PERCENT | AUTORES_EN_BIT); + | AUTORES_ERR_WINDOW_50_PERCENT | AUTORES_EN_BIT); if (rc < 0) goto unlock; @@ -3306,8 +3306,8 @@ static int haptics_start_lra_calibration(struct haptics_chip *chip) goto restore; } - /* wait for ~60ms to get the LRA calibration result */ - usleep_range(60000, 65000); + /* wait for ~150ms to get the LRA calibration result */ + usleep_range(150000, 155000); rc = haptics_get_closeloop_lra_period(chip); if (rc < 0)