Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation
authorFenglin Wu <quic_fenglinw@quicinc.com>
Mon, 15 Apr 2024 23:03:40 +0000 (16:03 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 15 Apr 2024 23:21:45 +0000 (16:21 -0700)
commit48c0687a322d54ac7e7a685c0b6db78d78f593af
treef23a3380b802bac0324ae193a59102a04a733b7d
parentba2ec9c4f0c8ab59befc7f62e1606a840347f020
Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation

The output voltage is inclusive hence the max level calculation is
off-by-one-step. Correct it.

iWhile we are at it also add a define for the step size instead of
using the magic value.

Fixes: 11205bb63e5c ("Input: add support for pm8xxx based vibrator driver")
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240412-pm8xxx-vibrator-new-design-v10-1-0ec0ad133866@quicinc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/misc/pm8xxx-vibrator.c