All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Marco Felsch <m.felsch@pengutronix.de>
Cc: Support Opensource <support.opensource@diasemi.com>,
	Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	stwiss.opensource@diasemi.com,
	Sascha Hauer <kernel@pengutronix.de>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/5] regulator: da9062: add voltage selection gpio support
Date: Fri, 4 Oct 2019 21:41:12 +0200	[thread overview]
Message-ID: <CACRpkdYAjj+EuF+iu4fKjt2Cviu8V+U66HnQThawwU58UGRUzQ@mail.gmail.com> (raw)
In-Reply-To: <20190917124246.11732-4-m.felsch@pengutronix.de>

On Tue, Sep 17, 2019 at 2:43 PM Marco Felsch <m.felsch@pengutronix.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.

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

Yours,
Linus Walleij

  parent reply	other threads:[~2019-10-04 19:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 12:42 [PATCH 0/5] DA9062 PMIC fixes and features Marco Felsch
2019-09-17 12:42 ` [PATCH 1/5] regulator: da9062: fix suspend_enable/disable preparation Marco Felsch
2019-09-18 12:41   ` Adam Thomson
2019-09-18 15:05     ` Marco Felsch
2019-09-23 16:03   ` Adam Thomson
2019-09-23 22:02     ` Marco Felsch
2019-09-24  8:58       ` Adam Thomson
2019-09-23 21:23   ` Applied "regulator: da9062: fix suspend_enable/disable preparation" to the regulator tree Mark Brown
2019-09-23 21:23     ` Mark Brown
2019-09-17 12:42 ` [PATCH 2/5] dt-bindings: mfd: da9062: add regulator voltage selection documentation Marco Felsch
2019-09-24  9:23   ` Adam Thomson
2019-09-25 15:51     ` Marco Felsch
2019-09-25 16:18       ` Adam Thomson
2019-09-26  8:09         ` Marco Felsch
2019-09-26 10:17           ` Adam Thomson
2019-09-26 11:43             ` Marco Felsch
2019-09-26 14:04               ` Adam Thomson
2019-09-26 14:38                 ` Marco Felsch
2019-09-30  9:53                   ` Adam Thomson
2019-10-02 13:45                     ` Marco Felsch
2019-10-02 13:45                       ` Marco Felsch
2019-10-22 10:22                       ` Marco Felsch
2019-09-17 12:42 ` [PATCH 3/5] regulator: da9062: add voltage selection gpio support Marco Felsch
2019-09-17 14:22   ` kbuild test robot
2019-09-17 14:34     ` Marco Felsch
2019-09-17 14:34       ` Marco Felsch
2019-09-24  9:48   ` Adam Thomson
2019-09-25 15:59     ` Marco Felsch
2019-10-04 19:41   ` Linus Walleij [this message]
2019-10-04 19:41     ` Linus Walleij
2019-10-07  8:59     ` Marco Felsch
2019-10-07  8:59       ` Marco Felsch
2019-09-17 12:42 ` [PATCH 4/5] dt-bindings: mfd: da9062: add regulator gpio enable/disable documentation Marco Felsch
2019-09-17 12:42 ` [PATCH 5/5] regulator: da9062: add gpio based regulator dis-/enable support Marco Felsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACRpkdYAjj+EuF+iu4fKjt2Cviu8V+U66HnQThawwU58UGRUzQ@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=stwiss.opensource@diasemi.com \
    --cc=support.opensource@diasemi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.