]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: rk808: Fix BUCK1/2 voltages on rk805
authorOtavio Salvador <otavio@ossystems.com.br>
Thu, 31 Jan 2019 12:46:01 +0000 (10:46 -0200)
committerMark Brown <broonie@kernel.org>
Sat, 2 Feb 2019 16:16:06 +0000 (17:16 +0100)
commit70465b1b5e8ceb7cf3819ae645022bb571de1db3
treed3fe8bb26cda9e660f21b5b57694ac667043f381
parent26fb10607a1b73a7fe12100df40c4ee45f1f1ee3
regulator: rk808: Fix BUCK1/2 voltages on rk805

RK805 has the following voltage range for the BUCK1 and BUCK2 regulators:

From 0.7125V to 1.45V in 12.5mV steps, 1.8V, 2V, 2.2V and 2.3V

, which corresponds to the following values as per the RK805
datasheet:

000 000: 0.7125V
000 001: 0.725V
……
111 011: 1.45V
111 100: 1.8V
111 101: 2.0V
111 110: 2.2V
111 111: 2.3V

This means that the voltage range is not linear and so RK805 can not
reuse the same regulator_ops structure from RK808.

Fix it by creating a list with the correct supported voltage values
for RK805 BUCK1 and BUCK2 regulators.

Tested on a rv1108-elgin-r1 board that now correctly reports a BUCK2
voltage of 2.2V instead of the unsupported value of 1.4875V.

Fixes: 469c4fbcdfbe ("regulator: rk808: Add regulator driver for RK805")
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/rk808-regulator.c