regulator: s2mps11: Adjust supported buck voltages to real values
authorKrzysztof Kozlowski <krzk@kernel.org>
Sat, 29 Jun 2019 11:44:46 +0000 (13:44 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 2 Jul 2019 11:43:25 +0000 (12:43 +0100)
commit9d83dcb3e4553f34ee1c4f09d65173159f9eb7a7
tree0f01396f3599aeed3c2b304637d09bcb298c6dcc
parent16da0eb5ab6ef2dd1d33431199126e63db9997cc
regulator: s2mps11: Adjust supported buck voltages to real values

The driver was registering buck regulators with unsupported range of
voltages for S2MPS11 devices.  Basically it assumed that all 256 values
are possible for a single 8-bit I2C register controlling buck's voltage.
This is not true, as datasheet describes subset of these which can be
used.

For example for buck[12346] the minimum voltage is 650 mV which
corresponds to register value of 0x8.  The driver was however
registering regulator starting at 600 mV, so for a step of 6.25 mV this
gave the same result.  However this allowed to try to configure
regulators to unsupported values.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/s2mps11.c
include/linux/mfd/samsung/core.h
include/linux/mfd/samsung/s2mps11.h