Re: [PATCH] gpio/regulator: Allow nonexclusive GPIO access

From: Mark Brown
Date: Thu Oct 11 2018 - 13:54:14 EST


On Thu, Oct 11, 2018 at 07:01:13PM +0200, Linus Walleij wrote:
> On Thu, Oct 11, 2018 at 4:43 PM Mark Brown <broonie@xxxxxxxxxx> wrote:
> > On Thu, Oct 11, 2018 at 04:35:31PM +0200, Linus Walleij wrote:

> > enable line so you don't need to use the bus to do the enables. That
> > should just be a case of adding this flag to all the drivers that have
> > already been converted to gpiod (including the core code that's in
> > regulator_ena_gpio_request() which I thought was coping with this
> > already) unless I'm missing something?

> Sorry if I don't get it... we already have code in the core to
> check if the same gpiod is used by two regulators.
> regulator_ena_gpio_request() does this:

> if (config->ena_gpiod)
> gpiod = config->ena_gpiod;
> else
> gpiod = gpio_to_desc(config->ena_gpio);

> So after the change I made to fixed.c this comes in through
> config->ena_gpiod.

Other regulators that have GPIO control for their enables do their own
requests (as does the core) so don't they all need to set the flag
GPIOD_FLAGS_BIT_NONEXCLUSIVE when they request otherwise it'll only work
in systems where the regulators after the first that request the GPIO
are fixed regulators?

Attachment: signature.asc
Description: PGP signature