regulator: rk808: fix buck range on RK806
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>
Fri, 23 Feb 2024 13:11:22 +0000 (14:11 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 4 Mar 2024 14:54:31 +0000 (14:54 +0000)
commit5803b54068435be3a3254f9ecdc1ebd5c18718a8
tree822f25cc8debd62af995f7b22e6eaa83d8a17053
parente5d40e9afd84cec01cdbbbfe62d52f89959ab3ee
regulator: rk808: fix buck range on RK806

The linear ranges aren't really matching what they should be. Indeed,
the range is inclusive of the min value, so it makes sense the previous
range does NOT include the max step value representing the min value of
the range in question.

Since 1.5V is represented by the decimal value 160, the previous range
max step value should be 159 and not 160. Similarly, 3.4V is represented
by the decimal value 236, so the previous range max value should be 235
and not 237.

The only change in behavior this makes is that this actually modeled
the ranges to map step with decimal value 237 with 3.65V instead of
3.4V (the max supported by the HW).

Fixes: f991a220a447 ("regulator: rk808: add rk806 support")
Cc: Quentin Schulz <foss+kernel@0leil.net>
Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://msgid.link/r/20240223-rk806-regulator-ranges-v1-1-3904ab70d250@theobroma-systems.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/rk808-regulator.c