]> www.infradead.org Git - users/dwmw2/linux.git/commit
regulator: Fix 'do-nothing' value for regulators without suspend state
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 3 Sep 2018 14:49:37 +0000 (16:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:19 +0000 (16:59 -0700)
commit2c2860d0e8764e07c3016742eed8cb059c78d224
treef5d89f535a00351e20a9abfbadf7904eb7ae6a83
parentad023c0c3613e517d21ad95b6f8572503db6e3bd
regulator: Fix 'do-nothing' value for regulators without suspend state

commit 3edd79cf5a44b12dbb13bc320f5788aed6562b36 upstream.

Some regulators don't have all states defined and in such cases regulator
core should not assume anything. However in current implementation
of of_get_regulation_constraints() DO_NOTHING_IN_SUSPEND enable value was
set only for regulators which had suspend node defined, otherwise the
default 0 value was used, what means DISABLE_IN_SUSPEND. This lead to
broken system suspend/resume on boards, which had simple regulator
constraints definition (without suspend state nodes).

To avoid further mismatches between the default and uninitialized values
of the suspend enabled/disabled states, change the values of the them,
so default '0' means DO_NOTHING_IN_SUSPEND.

Fixes: 72069f9957a1: regulator: leave one item to record whether regulator is enabled
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/regulator/core.c
drivers/regulator/of_regulator.c
include/linux/regulator/machine.h