regulator: max8952: Convert to use GPIO descriptors
authorLinus Walleij <linus.walleij@linaro.org>
Sun, 9 Jun 2019 11:48:12 +0000 (13:48 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 13 Jun 2019 15:47:29 +0000 (16:47 +0100)
commitfd742eaab827b47c5f2de6c1811a17075608da60
tree2242d69daeabdf4bf85a2927d8fd426a9cc40b7a
parent6f10419187d0d5fe395e2a2f2a64370961bf02a3
regulator: max8952: Convert to use GPIO descriptors

This finalizes the descriptor conversion of the MAX8952 driver
by letting the VID0 and VID1 GPIOs be fetched from descriptors.

Both VID0 and VID1 must be supplied for the VID selection to work,
I add some code to preserve the semantics that if only one of
the two VID gpios is supplied, it will be initialized to low.
This might be a bit overzealous, but I want to preserve any
implicit semantics.

This is currently only used by device tree in-kernel but it is
still also possible to supply the same GPIOs using a machine
descriptor table if a board file is used.

Ideally this should be phased over to using gpio-regulator.c
that does the same thing, but it might require some refactoring
and needs testing on real hardware.

Cc: Tomasz Figa <tfiga@chromium.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/max8952.c
include/linux/regulator/max8952.h