UPSTREAM: regulator: helpers: Ensure bypass register field matches ON value
authorJon Hunter <jonathanh@nvidia.com>
Thu, 21 Apr 2016 16:12:01 +0000 (17:12 +0100)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 6 Mar 2017 10:28:40 +0000 (18:28 +0800)
commit14b8d1e030574b603d3b5e2919aa84ea6eb62d0a
tree9dd5a5b198f0dd1c27bd8f7c08a474131ff7098a
parente322305bbaed27c398d13340f3e3bc6ecfe6744f
UPSTREAM: regulator: helpers: Ensure bypass register field matches ON value

When checking bypass state for a regulator, we check to see if any bits
in the bypass mask are set. For most cases this is fine because there is
typically, only a single bit used to determine if the regulator is in
bypass. However, for some regulators, such as LDO6 on AS3722, the bypass
state is indicate by a value rather than a single bit. Therefore, when
checking the bypass state, check that the bypass field matches the ON
value.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
(cherry picked from commit dd1a571daee7cdd6504a5771721e34f9b118f17a)

Change-Id: Ic9f9ee919969cc744be7e7c94729ee7ab9e0e7a1
Signed-off-by: David Wu <david.wu@rock-chips.com>
drivers/regulator/helpers.c