regulator: bd9571mwv: Fix AVS and DVFS voltage range
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 12 Mar 2021 13:02:40 +0000 (14:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:05 +0000 (08:42 +0200)
commit1f51cb88e788b271d43f8460782cd4646182a242
treeb36083def4f94029040d2ccf7630d2bd41e96cfd
parentb267688ce0074109d49db14975731eb8c6690fec
regulator: bd9571mwv: Fix AVS and DVFS voltage range

[ Upstream commit 3b6e7088afc919f5b52e4d2de8501ad34d35b09b ]

According to Table 30 ("DVFS_MoniVDAC [6:0] Setting Table") in the
BD9571MWV-M Datasheet Rev. 002, the valid voltage range is 600..1100 mV
(settings 0x3c..0x6e).  While the lower limit is taken into account (by
setting regulator_desc.linear_min_sel to 0x3c), the upper limit is not.

Fix this by reducing regulator_desc.n_voltages from 0x80 to 0x6f.

Fixes: e85c5a153fe237f2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210312130242.3390038-2-geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/regulator/bd9571mwv-regulator.c