]> git.karo-electronics.de Git - linux-beck.git/commit
regulators: helpers: Fix handling of bypass_val_on in get_bypass_regmap
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Thu, 10 Nov 2016 10:45:18 +0000 (10:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 19:18:06 +0000 (20:18 +0100)
commit26991b28b47c4a730f08337de557fe4883c44cc2
tree201364deaf18f19670884faec4eb223ae7260b4e
parent89c728ed9237748b24456dc8502a6e1577b23105
regulators: helpers: Fix handling of bypass_val_on in get_bypass_regmap

commit 85b037442e3f0e84296ab1010fd6b057eee18496 upstream.

The handling of bypass_val_on that was added in
regulator_get_bypass_regmap is done unconditionally however
several drivers don't define a value for bypass_val_on. This
results in those drivers reporting bypass being enabled when
it is not. In regulator_set_bypass_regmap we use bypass_mask
if bypass_val_on is zero. This patch adds similar handling in
regulator_get_bypass_regmap.

Fixes: commit dd1a571daee7 ("regulator: helpers: Ensure bypass register field matches ON value")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/helpers.c