devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: Alexandre Courbot <acourbot@nvidia.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 1/6] regulator: core: Allow simultaneous use of enable op and GPIO
Date: Thu, 23 Jun 2016 14:29:39 +0900	[thread overview]
Message-ID: <CAAVeFu+9cgt+teWpA3KYwnBU+NAr+RusVd_XavgW1CuPfY2egA@mail.gmail.com> (raw)
In-Reply-To: <CAAVeFuK9AV+g0EwTAhr9mFz=ZK5nRR6jnWFhEEsz8+HU7rMKrw@mail.gmail.com>

On Thu, Jun 23, 2016 at 10:10 AM, Alexandre Courbot <gnurou@gmail.com> wrote:
> On Wed, Jun 22, 2016 at 7:34 PM, Mark Brown <broonie@kernel.org> wrote:
>> On Wed, Jun 22, 2016 at 05:25:53PM +0900, Alexandre Courbot wrote:
>>> The current regulator enable/disable mechanism does not call the driver
>>> enable/disable op if an enable GPIO is set. It may be desirable to use
>>> both mechanisms though, e.g. in the case of a PWM regulator that also
>>> has an enable GPIO.
>>>
>>> _regulator_is_enabled() is also updated in order to take both enable
>>> conditions into account.
>>
>> This is going to break or at least reduce the performance of a lot of
>> users - it is very common for regulators to have configurable support
>> for a GPIO enable in addition to a register enable with the GPIO enable
>> replacing a register enable for improved performance.
>
> Ah, I wasn't aware of this.
>
>> If you have some
>> strange device that requires GPIO and other operations the driver should
>> handle that, if nothing else it's likely that there are sequencing
>> requirements between the two which we are probably not going to get
>> right for everyone in the core.
>
> Having dedicated enable GPIO code in the PWM driver sounded redundant
> since we already have the same in the core, which is why I went for
> this approach. But with your above point it seems like I have no
> choice.

There is also another potential problem with not using the enable GPIO
in the regulator core: said GPIO can not be shared anymore between
several regulators, as this was handled by the core.

That's not a big issue for our use-case but I just wanted to point it
out. Maybe we need a more global solution for shared GPIOs, but I can
see a few challenges on the way (e.g. which policy to adopt and how to
handle conflicts).

  reply	other threads:[~2016-06-23  5:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22  8:25 [PATCH 0/6] regulator: add enable GPIO property to pwm-regulator Alexandre Courbot
2016-06-22  8:25 ` [PATCH 1/6] regulator: core: Allow simultaneous use of enable op and GPIO Alexandre Courbot
2016-06-22 10:34   ` Mark Brown
2016-06-23  1:10     ` Alexandre Courbot
2016-06-23  5:29       ` Alexandre Courbot [this message]
     [not found]         ` <CAAVeFu+9cgt+teWpA3KYwnBU+NAr+RusVd_XavgW1CuPfY2egA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-23 10:01           ` Mark Brown
2016-06-22  8:25 ` [PATCH 2/6] regulator: of: Add enable GPIO configuration function Alexandre Courbot
2016-06-22 10:35   ` Mark Brown
     [not found] ` <20160622082558.20935-1-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-22  8:25   ` [PATCH 3/6] regulator: fixed: Use of_get_regulator_gpio_config Alexandre Courbot
2016-06-22  8:25 ` [PATCH 4/6] regulator: gpio: " Alexandre Courbot
2016-06-22  8:25 ` [PATCH 5/6] pwm-regulator: Support for enable GPIO Alexandre Courbot
2016-06-22  8:25 ` [PATCH 6/6] dt-bindings: pwm-regulator: Document enable-gpio property Alexandre Courbot
     [not found]   ` <20160622082558.20935-7-acourbot-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-06-22 10:36     ` Mark Brown

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=CAAVeFu+9cgt+teWpA3KYwnBU+NAr+RusVd_XavgW1CuPfY2egA@mail.gmail.com \
    --to=gnurou@gmail.com \
    --cc=acourbot@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    /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).