]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: palmas: Fix SMPS list for 0V
authorNishanth Menon <nm@ti.com>
Wed, 4 Jun 2014 19:34:31 +0000 (14:34 -0500)
committerMark Brown <broonie@linaro.org>
Thu, 5 Jun 2014 11:40:51 +0000 (12:40 +0100)
commitbd3dfa165eacdbe5e93cd78687e1dff0ea32f9e4
tree5344d7072f00445f46dc441f1a06474616670d3b
parentf58e1d2951edd86c781ca9a654cf908a91e08856
regulator: palmas: Fix SMPS list for 0V

get_voltage_sel reads from SMPS register - if the read selector value
is 0, the SMPS is actually disabled - So, this is in addition to the
ctrl_register that may also be used to enable/disable the SMPS.

The original logic(prior to commit 710dd7cc67f0fb687) used to be:
static int palmas_map_voltage_smps(struct regulator_dev *rdev,
               int min_uV, int max_uV)
<snip>
       if (min_uV == 0)
               return 0;

To handle this scenario, with the transition to regulator_list
implementation, we seem to have missed the data necessary to mark as
one of the valid entries as "0" 'disabled regulator' which results in
0 volts - So, stick with pre-existing logic.

Without this added to the list, palmas regulator driver,
on probe, attempts to setup constraints and in the case of
OMAP5uEVM, SMPS9 (which is mapped for 2v1 audio supply) fails in
regulator_list_voltage_linear_range mapping of '0', and as a fall back
of constraints not being applied, the entire regulator list is not
enumerated due to assumption that something system wide has gone bad
on with the PMIC.

Fixes: 710dd7cc67f0fb687 ("regulator: palmas: Reemove open coded functions with helper functions")
Reported-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/palmas-regulator.c