regulator: mt6358: Add output voltage fine tuning to variable LDOs
authorChen-Yu Tsai <wenst@chromium.org>
Wed, 13 Sep 2023 08:29:18 +0000 (16:29 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 25 Sep 2023 12:19:50 +0000 (14:19 +0200)
commit017c6658fd59740f9845ca0d3369ddd778e3e0c0
tree7e2c7693a9c2f989a78c06e303bd4a0d61cd0061
parentcf08fa74c716cf20e5038d1e7dbbd7dba1b76062
regulator: mt6358: Add output voltage fine tuning to variable LDOs

Some of the LDO regulators in the MT6358/MT6366 have sparsely populated
voltage tables, supported by custom get/set operators. While it works,
it requires more code and an extra field to store the lookup table.
These LDOs also have fine voltage calibration settings that can slightly
boost the output voltage from 0 mV to 100 mV, in 10 mV increments.

These combined could be modeled as a pickable set of linear ranges. The
coarse voltage setting is modeled as the range selector, while each
range has 11 selectors, starting from the range's base voltage, up to
+100 mV, in 10mV increments.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230913082919.1631287-4-wenst@chromium.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/mt6358-regulator.c