aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-04-27 14:38:44 -0400
committerMark Brown <broonie@kernel.org>2016-04-29 06:43:50 -0400
commitf40d4896bf3284573f1e70e8840c1bcfe1c6bf2d (patch)
treef42c1ef40645920f02a8fc7270c019a27b9317ed
parenta2262e5a12e05389ab4c7fc5cf60016b041dd8dc (diff)
regulator: axp20x: Fix axp22x ldo_io registration error on cold boot
The maximum supported voltage for ldo_io# is 3.3V, but on cold boot the selector comes up at 0x1f, which maps to 3.8V. This causes _regulator_get_voltage() to fail with -EINVAL which causes regulator registration to fail when constrains are used: [ 1.467788] vcc-touchscreen: failed to get the current voltage(-22) [ 1.474209] axp20x-regulator axp20x-regulator: Failed to register ldo_io1 [ 1.483363] axp20x-regulator: probe of axp20x-regulator failed with error -22 This commits makes the axp20x regulator driver accept the 0x1f register value, fixing this. The datasheet does not guarantee reliable operation above 3.3V, so on boards where this regulator is used the regulator-max-microvolt setting must be 3.3V or less. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/regulator/axp20x-regulator.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c
index 89f684295657..514a5e8fdbab 100644
--- a/drivers/regulator/axp20x-regulator.c
+++ b/drivers/regulator/axp20x-regulator.c
@@ -217,10 +217,14 @@ static const struct regulator_desc axp22x_regulators[] = {
217 AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)), 217 AXP22X_ELDO2_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(1)),
218 AXP_DESC(AXP22X, ELDO3, "eldo3", "eldoin", 700, 3300, 100, 218 AXP_DESC(AXP22X, ELDO3, "eldo3", "eldoin", 700, 3300, 100,
219 AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)), 219 AXP22X_ELDO3_V_OUT, 0x1f, AXP22X_PWR_OUT_CTRL2, BIT(2)),
220 AXP_DESC_IO(AXP22X, LDO_IO0, "ldo_io0", "ips", 700, 3300, 100, 220 /* Note the datasheet only guarantees reliable operation up to
221 * 3.3V, this needs to be enforced via dts provided constraints */
222 AXP_DESC_IO(AXP22X, LDO_IO0, "ldo_io0", "ips", 700, 3800, 100,
221 AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07, 223 AXP22X_LDO_IO0_V_OUT, 0x1f, AXP20X_GPIO0_CTRL, 0x07,
222 AXP22X_IO_ENABLED, AXP22X_IO_DISABLED), 224 AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
223 AXP_DESC_IO(AXP22X, LDO_IO1, "ldo_io1", "ips", 700, 3300, 100, 225 /* Note the datasheet only guarantees reliable operation up to
226 * 3.3V, this needs to be enforced via dts provided constraints */
227 AXP_DESC_IO(AXP22X, LDO_IO1, "ldo_io1", "ips", 700, 3800, 100,
224 AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07, 228 AXP22X_LDO_IO1_V_OUT, 0x1f, AXP20X_GPIO1_CTRL, 0x07,
225 AXP22X_IO_ENABLED, AXP22X_IO_DISABLED), 229 AXP22X_IO_ENABLED, AXP22X_IO_DISABLED),
226 AXP_DESC_FIXED(AXP22X, RTC_LDO, "rtc_ldo", "ips", 3000), 230 AXP_DESC_FIXED(AXP22X, RTC_LDO, "rtc_ldo", "ips", 3000),