]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:42 +0000 (13:39 +0200)
commita992b28aa2652cf812cf019f286c788c19e9b597
tree0b9db3f003f01be7e84b06447ad9dd8bd3e6c874
parentccdc1b2baa361a43a9e4a472e1d996fba7ca8a9b
Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation

[ Upstream commit 48c0687a322d54ac7e7a685c0b6db78d78f593af ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/input/misc/pm8xxx-vibrator.c