regulator: core: Support passing an initialized GPIO enable descriptor
authorLinus Walleij <linus.walleij@linaro.org>
Mon, 12 Feb 2018 13:16:57 +0000 (14:16 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 16 Feb 2018 17:04:02 +0000 (17:04 +0000)
commite45e290a882e2c0dc8ebb7dd21c66a8209d8e3a5
tree1f279f3b56efdb865cd1992fd23eb25b8a0db11f
parent7928b2cbe55b2a410a0f5c1f154610059c57b1b2
regulator: core: Support passing an initialized GPIO enable descriptor

We are currently passing a GPIO number from the global GPIO numberspace
into the regulator core for handling enable GPIOs. This is not good
since it ties into the global GPIO numberspace and uses gpio_to_desc()
to overcome this.

Start supporting passing an already initialized GPIO descriptor to the
core instead: leaf drivers pick their descriptors, associated directly
with the device node (or from ACPI or from a board descriptor table)
and use that directly without any roundtrip over the global GPIO
numberspace.

This looks messy since it adds a bunch of extra code in the core, but
at the end of the patch series we will delete the handling of the GPIO
number and only deal with descriptors so things end up neat.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c
include/linux/regulator/driver.h