lkml.org 
[lkml]   [2018]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpio/regulator: Allow nonexclusive GPIO access
On Thu, Oct 11, 2018 at 04:35:31PM +0200, Linus Walleij wrote:

> + /*
> + * Some fixed regulators share the enable line between two
> + * regulators which makes it necessary to get a handle on the
> + * same descriptor for two different consumers. This will get
> + * the GPIO descriptor, but only the first call will initialize
> + * it so any flags such as inversion or open drain will only
> + * be set up by the first caller and assumed identical on the
> + * next caller.
> + *
> + * FIXME: find a better way to deal with this.
> + */
> + gflags |= GPIOD_FLAGS_BIT_NONEXCLUSIVE;
> +

It's not just fixed regulators that do this, often regulators with
register control can do this as well. Since power up is often a
performance critical path but regulators tend to be controlled via slow
buses like I2C it's common to have register control combined with a GPIO
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?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2018-10-11 16:45    [W:0.057 / U:28.952 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site