[lkml]   [2019]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 3/5] regulator: da9062: add voltage selection gpio support
On Tue, Sep 17, 2019 at 2:43 PM Marco Felsch <> wrote:

> + /*
> + * We only must ensure that the gpio device is probed before the
> + * regulator driver so no need to store the reference global. Luckily
> + * devm_* releases the gpio upon a unbound action.
> + */
> + gpi = devm_gpiod_get_from_of_node(cfg->dev, np, prop, 0, GPIOD_IN |

Do you really need the GPIOD_FLAGS_BIT_NONEXCLUSIVE flag here?
I don't think so, but describe what usecase you have that warrants this
being claimed twice. Normally that is just needed when you let the
regulator core handle enablement of a regulator over GPIO, i.e.
ena_gpiod in struct regulator_config.

> + /* We need the local number */
> + nr = da9062_gpio_get_hwgpio(gpi);

If you really need this we should add a public API to gpiolib and not
create custom APIs.

Just make a patch adding

int gpiod_to_offset(struct gpio_desc *d);

to the public gpiolib API in include/linux/gpio/consumer.h

and add the code in gpiolib.c to do this trick.

Linus Walleij

 \ /
  Last update: 2019-10-04 21:42    [W:0.200 / U:5.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site