lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 7 Oct 2019 10:59:14 +0200
From:   Marco Felsch <m.felsch@...gutronix.de>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Support Opensource <support.opensource@...semi.com>,
        Lee Jones <lee.jones@...aro.org>,
        Rob Herring <robh+dt@...nel.org>,
        Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>, stwiss.opensource@...semi.com,
        Sascha Hauer <kernel@...gutronix.de>,
        "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
        <devicetree@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/5] regulator: da9062: add voltage selection gpio support

On 19-10-04 21:41, Linus Walleij wrote:
> On Tue, Sep 17, 2019 at 2:43 PM Marco Felsch <m.felsch@...gutronix.de> 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 |
> > +                                         GPIOD_FLAGS_BIT_NONEXCLUSIVE, label);
> 
> 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.

This pin can be assigned to all regulators so it is shared across them
also it can be used as voltage-selection gpio by regulator and as
enable signal by an other regulator. I mentioned that within the
dt-bindings and also mentioned that the config has to be the same.

> > +       /* 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.

Okay, I will add it.

Thanks for the review.

Regards,
  Marco

> Yours,
> Linus Walleij
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ