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 <quic_huliu@quicinc.com>
This commit is contained in:
Hui Liu 2022-08-17 17:27:29 +08:00 committed by Fenglin Wu
parent 468928c595
commit cbda83d0be

View File

@ -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",