From cbda83d0be01589ac8a8403a93943e77cfa89d16 Mon Sep 17 00:00:00 2001 From: Hui Liu Date: Wed, 17 Aug 2022 17:27:29 +0800 Subject: [PATCH] input: qcom-hv-haptics: move predefined effect preload logging Move the logging after calculating Vmax so that the right Vmax value can be printed out. Change-Id: I8d916a13685c8d85f1363e7a8bc766aeb4d5e2ba Signed-off-by: Hui Liu --- 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 402e318bf51d..b9db7e428b49 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -2410,9 +2410,6 @@ static int haptics_load_periodic_effect(struct haptics_chip *chip, return -EINVAL; } - dev_dbg(chip->dev, "upload %s effect %d, vmax=%d\n", primitive ? "primitive" : "predefined", - effects[i].id, play->vmax_mv); - mutex_lock(&chip->play.lock); if (chip->play.in_calibration) { dev_err(chip->dev, "calibration in progress, ignore playing predefined effect\n"); @@ -2421,6 +2418,9 @@ static int haptics_load_periodic_effect(struct haptics_chip *chip, } play->vmax_mv = (magnitude * effects[i].vmax_mv) / 0x7fff; + dev_dbg(chip->dev, "upload %s effect %d, vmax=%d\n", primitive ? "primitive" : "predefined", + effects[i].id, play->vmax_mv); + rc = haptics_load_predefined_effect(chip, &effects[i]); if (rc < 0) { dev_err(chip->dev, "Play predefined effect%d failed, rc=%d\n",