mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Philippe Schenker <philippe.schenker@toradex.com>
Cc: "lgirdwood@gmail.com" <lgirdwood@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH 1/2] Regulator: Core: Add clock-enable to fixed-regulator
Date: Wed, 31 Jul 2019 22:23:35 +0100	[thread overview]
Message-ID: <20190731212335.GL4369@sirena.org.uk> (raw)
In-Reply-To: <b5e1cc3fb5838d9ea4160078402bff95903ba0da.camel@toradex.com>

[-- Attachment #1: Type: text/plain, Size: 2312 bytes --]

On Tue, Jul 30, 2019 at 09:00:01PM +0000, Philippe Schenker wrote:
> On Tue, 2019-07-30 at 19:10 +0100, Mark Brown wrote:
> > On Tue, Jul 30, 2019 at 07:30:04PM +0200, Philippe Schenker wrote:

> > > This adds the possibility to enable a fixed-regulator with a clock.

> > Why?  What does the hardware which makes this make sense look like?

> Tomorrow I can provide some schematics if needed. But its just a simple
> switch that is switched by a clock (on when clock is on and off when
> clock is off). This clock is the RGMII 50MHz clock for the ethernet
> PHY.

So it's not switching with the clock, the circuit somehow keeps the
switch latched?

> Why is a regulator even needed?
> - On power up of the PHY there is a huge time I have to wait for
> voltage rail to settle. In the range of 100ms.
> - Because there is a switch in the circuit I abstract it with a
> regulator-fixed in devicetree to make use of the startup-delay.
> - This regulator/switch is enabled with a clock. So to be able to use
> the startup delay I need an enable-by-clock on regulator-fixed.

It does feel like it might be simpler to just handle this as a quirk in
the PHY or ethernet driver, this feels like an awful lot of work to
add a sleep on what's probably only going to ever be one system.

> Why do I think this should be in core?
> - Normally this task is done with gpio that is already in regulator-
> core.
> - Because that is already there I added the functionality for enabled-
> by-clock-functionality.
> - I thought of creating a new regulator-clock driver but that would
> hold a lot of code duplication from regulator-fixed.

Hopefully not a *lot* of duplication.  The GPIOs are handled in the core
because they're really common and used by many regulator devices, the
same will I hope not be true for clocks.

> Why is this a good Idea at all?
> - Well I'm here for the software part and should just support our
> hardware. If that is a good Idea at all I don't know, for sure it is
> not a solution that is from some school-book. But I tried it and
> measured it out and it seems to work pretty fine.
> - The reason behind all of that is limited GPIO availability from the
> iMX6ULL.

I guess my question here is what the trip through the regulator API buys
us - it's a bit of a sledgehammer to crack a nut thing.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-07-31 21:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 17:30 [RFC PATCH 0/2] Hello Philippe Schenker
2019-07-30 17:30 ` [RFC PATCH 1/2] Regulator: Core: Add clock-enable to fixed-regulator Philippe Schenker
2019-07-30 18:10   ` Mark Brown
2019-07-30 21:00     ` Philippe Schenker
2019-07-31 21:23       ` Mark Brown [this message]
2019-08-05 11:07         ` Philippe Schenker
2019-08-05 16:37           ` Mark Brown
2019-08-06 12:57             ` Philippe Schenker
2019-08-06 18:26               ` Mark Brown
2019-08-07  6:46                 ` Philippe Schenker
2019-07-30 17:30 ` [RFC PATCH 2/2] ARM: dts: imx6ull: Add phy-supply to fec Philippe Schenker

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=20190731212335.GL4369@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=philippe.schenker@toradex.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

Powered by JetHome