From 8afead556c6515df23efc43399ec0fdbdb9b0f19 Mon Sep 17 00:00:00 2001 From: Fenglin Wu Date: Mon, 18 Jul 2022 10:56:28 +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. CRs-Fixed: 3227145 Change-Id: I17b64f9e3a230058b7e30ca4c30de4d3000d1f87 Signed-off-by: Fenglin Wu --- drivers/input/misc/qcom-hv-haptics.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/misc/qcom-hv-haptics.c b/drivers/input/misc/qcom-hv-haptics.c index 8fc4bda5e2c4..f1ca4a207eef 100644 --- a/drivers/input/misc/qcom-hv-haptics.c +++ b/drivers/input/misc/qcom-hv-haptics.c @@ -2381,9 +2381,6 @@ static int haptics_load_periodic_effect(struct haptics_chip *chip, } mutex_lock(&chip->play.lock); - dev_dbg(chip->dev, "upload effect %d, vmax_mv=%d\n", - chip->effects[i].id, play->vmax_mv); - if (chip->play.in_calibration) { dev_err(chip->dev, "calibration in progress, ignore playing predefined effect\n"); rc = -EBUSY; @@ -2391,6 +2388,7 @@ static int haptics_load_periodic_effect(struct haptics_chip *chip, } play->vmax_mv = (magnitude * chip->effects[i].vmax_mv) / 0x7fff; + dev_dbg(chip->dev, "upload effect %d, vmax_mv=%d\n", chip->effects[i].id, play->vmax_mv); rc = haptics_load_predefined_effect(chip, &chip->effects[i]); if (rc < 0) { dev_err(chip->dev, "Play predefined effect%d failed, rc=%d\n",