devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: Support Opensource <Support.Opensource@diasemi.com>,
	"lee.jones@linaro.org" <lee.jones@linaro.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	Steve Twiss <stwiss.opensource@diasemi.com>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/5] dt-bindings: mfd: da9062: add regulator voltage selection documentation
Date: Thu, 26 Sep 2019 13:43:54 +0200	[thread overview]
Message-ID: <20190926114354.qvv2rs7mc4xh6lkp@pengutronix.de> (raw)
In-Reply-To: <AM5PR1001MB09944C0F9A4F547BF9E175CF80860@AM5PR1001MB0994.EURPRD10.PROD.OUTLOOK.COM>

On 19-09-26 10:17, Adam Thomson wrote:
> On 26 September 2019 09:10, Marco Felsch wrote:
> 
> > On 19-09-25 16:18, Adam Thomson wrote:
> > > On 25 September 2019 16:52, Marco Felsch wrote:
> > >
> > > > Hi Adam,
> > > >
> > > > On 19-09-24 09:23, Adam Thomson wrote:
> > > > > On 17 September 2019 13:43, Marco Felsch wrote:
> > > > >
> > > > > > Add the documentation which describe the voltage selection gpio
> > support.
> > > > > > This property can be applied to each subnode within the 'regulators'
> > > > > > node so each regulator can be configured differently.
> > > > > >
> > > > > > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > > > > > ---
> > > > > >  Documentation/devicetree/bindings/mfd/da9062.txt | 9 +++++++++
> > > > > >  1 file changed, 9 insertions(+)
> > > > > >
> > > > > > diff --git a/Documentation/devicetree/bindings/mfd/da9062.txt
> > > > > > b/Documentation/devicetree/bindings/mfd/da9062.txt
> > > > > > index edca653a5777..9d9820d8177d 100644
> > > > > > --- a/Documentation/devicetree/bindings/mfd/da9062.txt
> > > > > > +++ b/Documentation/devicetree/bindings/mfd/da9062.txt
> > > > > > @@ -66,6 +66,15 @@ Sub-nodes:
> > > > > >    details of individual regulator device can be found in:
> > > > > >    Documentation/devicetree/bindings/regulator/regulator.txt
> > > > > >
> > > > > > +  Optional regulator device-specific properties:
> > > > > > +  - dlg,vsel-sense-gpios : The GPIO reference which should be used by
> > the
> > > > > > +    regulator to switch the voltage between active/suspend voltage
> > settings.
> > > > If
> > > > > > +    the signal is active the active-settings are applied else the suspend
> > > > > > +    settings are applied. Attention: Sharing the same gpio for other
> > purposes
> > > > > > +    or across multiple regulators is possible but the gpio settings must be
> > the
> > > > > > +    same. Also the gpio phandle must refer to to the dlg,da9062-gpio
> > device
> > > > > > +    other gpios are not allowed and make no sense.
> > > > > > +
> > > > >
> > > > > Should we not use the binding names that are defined in 'gpio-
> > regulator.yaml'
> > > > as
> > > > > these seem to be generic and would probably serve the purpose here?
> > > >
> > > > Hm.. as the description says:
> > > >
> > > > 8<--------------------------------------------------
> > > > gpios:
> > > >    description: Array of one or more GPIO pins used to select the
> > > >    regulator voltage/current listed in "states".
> > > > 8<--------------------------------------------------
> > > >
> > > > But we don't have a "states" property and we can't select between
> > > > voltage or current.
> > >
> > > Yes I think I was at cross purposes when I made this remark. The bindings there
> > > describe the GPOs that are used to enable/disable and set voltage/current for
> > > regulators and the supported voltage/current levels that can be configured in
> > > this manner. What you're describing is the GPI for DA9061/2. If you look at
> > > GPIO handling in existing regulator drivers I believe they all deal with external
> > > GPOs that are configured to enable/disable and set voltage/current limits
> > rather
> > > than the GPI on the PMIC itself. That's why I'm thinking that the configurations
> > > you're doing here should actually be in a pinctrl or GPIO driver.
> > 
> > That's true, the common gpio bindings are from the view of the
> > processor, e.g. which gpio must the processor drive to enable/switch the
> > regualtor. So one reasone more to use a non-common binding.
> > 
> > Please take a look on my other comment I made :) I don't use the
> > gpio-alternative function. I use it as an input.
> 
> I know in the datasheet this isn't marked as an alternate function specifically
> but to me having regulator control by the chip's own GPI is an alternative
> function for that GPIO pin, in the same way a specific pin can be used for
> SYS_EN or Watchdog control. It's a dedicated purpose rather than being a normal
> GPI.

Nope, SYS_EN or Watchdog is a special/alternate function and not a
normal input.

> See the following as an example of what I'm suggesting:
> 
> https://elixir.bootlin.com/linux/latest/source/Documentation/devicetree/bindings/pinctrl/pinctrl-palmas.txt
> 
> You could then pass the pinctrl information to the regulator driver and use
> that rather than having device specific bindings for this. That's at least my
> current interpretation of this anyway.

For me pinctrl decides which function should be assigned to a pin. So in
our case this would be:
  - alternate
  - gpo
  - gpi

In our use-case it is a gpi..

An other reason why pinctrl seems not be the right solution is that the
regulator must be configured to use this gpi. This decision can't be
made globally because each regulator can be configured differently.. For
me its just a local gpio.

Regards,
  Marco

> > 
> > Regards,
> >   Marco
> > 
> > 
> > > I'd be interested in hearing Mark's view on this though as he has far more
> > > experience in this area than I do.
> > >
> > > >
> > > > Regards,
> > > >   Marco
> > > >
> > > > > >  - rtc : This node defines settings required for the Real-Time Clock
> > associated
> > > > > >    with the DA9062. There are currently no entries in this binding, however
> > > > > >    compatible = "dlg,da9062-rtc" should be added if a node is created.
> > > > > > --
> > > > > > 2.20.1
> > > > >
> > > > >
> > > >
> > > > --
> > > > 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 |
> > >
> > 
> > --
> > 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 |
> 

-- 
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 |

  reply	other threads:[~2019-09-26 11:43 UTC|newest]

Thread overview: 29+ 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-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 [this message]
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-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-24  9:48   ` Adam Thomson
2019-09-25 15:59     ` Marco Felsch
2019-10-04 19:41   ` Linus Walleij
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=20190926114354.qvv2rs7mc4xh6lkp@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --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=robh+dt@kernel.org \
    --cc=stwiss.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).