]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: axp20x: Fix axp22x ldo_io registration error on cold boot
authorHans de Goede <hdegoede@redhat.com>
Wed, 27 Apr 2016 18:38:44 +0000 (20:38 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 29 Apr 2016 10:43:50 +0000 (11:43 +0100)
commit14a4eab754692f1b0f0ce249e7e55ba997b7a7d2
treef42c1ef40645920f02a8fc7270c019a27b9317ed
parentf045ea931652cf9658337ce2be58e6de1b108640
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>
drivers/regulator/axp20x-regulator.c