From 3cb186f0324a00c5da7d2d01f70a00a422709897 Mon Sep 17 00:00:00 2001 From: Kiran Gunda Date: Wed, 15 Sep 2021 11:53:39 +0530 Subject: [PATCH] input: qcom-hv-haptics: Update "get_fifo_length_us" with T_LRA_X Update "get_fifo_length_us" function to support the T_LRA_X_2/4/8 periods. So that the FIFO mode can work for all T_LRA periods. Change-Id: I5d6b2c95eff66cddcec9388082c4d540493f2c86 Signed-off-by: Kiran Gunda --- drivers/input/misc/qcom-hv-haptics.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index 6efb2322b0ad..f7ee575f6a73 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -825,6 +825,15 @@ static int get_fifo_play_length_us(struct fifo_cfg *fifo, u32 t_lra_us) case T_LRA_DIV_8: length_us /= 8; break; + case T_LRA_X_2: + length_us *= 2; + break; + case T_LRA_X_4: + length_us *= 4; + break; + case T_LRA_X_8: + length_us *= 8; + break; case F_8KHZ: length_us = 1000 * fifo->num_s / 8; break;