All of lore.kernel.org
 help / color / mirror / Atom feed
* Removal of regulator-boot-on/always-on when a consumer exists
@ 2016-09-26 14:26 Fabio Estevam
  2016-09-26 16:34 ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2016-09-26 14:26 UTC (permalink / raw)
  To: Mark Brown; +Cc: Michael Trimarchi, linux-kernel

Hi Mark,

On the linux-arm-kernel list we are reviewing a patch from Michael (on
Cc), where he does:


       reg_3p3v: regulator-3p3v {
               compatible = "regulator-fixed";
               regulator-name = "3P3V";
               regulator-min-microvolt = <3300000>;
               regulator-max-microvolt = <3300000>;
               regulator-boot-on;
               regulator-always-on;
       };
};

&can1 {
       pinctrl-names = "default";
       pinctrl-0 = <&pinctrl_flexcan1>;
       xceiver-supply = <&reg_3p3v>;
};

My suggestion is to remove regulator-boot-on/regulator-always-on:

       reg_3p3v: regulator-3p3v {
               compatible = "regulator-fixed";
               regulator-name = "3P3V";
               regulator-min-microvolt = <3300000>;
               regulator-max-microvolt = <3300000>;
       };

,since reg_3p3v has can1 as its consumer.

Is my understanding correct?

Thanks,

Fabio Estevam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 14:26 Removal of regulator-boot-on/always-on when a consumer exists Fabio Estevam
@ 2016-09-26 16:34 ` Mark Brown
  2016-09-26 16:43   ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2016-09-26 16:34 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Michael Trimarchi, linux-kernel

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

On Mon, Sep 26, 2016 at 11:26:24AM -0300, Fabio Estevam wrote:

> My suggestion is to remove regulator-boot-on/regulator-always-on:

>        reg_3p3v: regulator-3p3v {
>                compatible = "regulator-fixed";
>                regulator-name = "3P3V";
>                regulator-min-microvolt = <3300000>;
>                regulator-max-microvolt = <3300000>;
>        };

> ,since reg_3p3v has can1 as its consumer.

> Is my understanding correct?

It really depends on what the actual board constraints are - are there
other consumers that aren't visible to software, is it electrically safe
to power down the rail?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 16:34 ` Mark Brown
@ 2016-09-26 16:43   ` Fabio Estevam
  2016-09-26 16:49     ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Fabio Estevam @ 2016-09-26 16:43 UTC (permalink / raw)
  To: Mark Brown; +Cc: Michael Trimarchi, linux-kernel

Hi Mark,

On Mon, Sep 26, 2016 at 1:34 PM, Mark Brown <broonie@kernel.org> wrote:

> It really depends on what the actual board constraints are - are there
> other consumers that aren't visible to software, is it electrically safe
> to power down the rail?

The can1 node is the only consumer of this regulator.

The reg_3p3v regulator models a discrete 3.3V power supply with no
software intervention.

Thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 16:43   ` Fabio Estevam
@ 2016-09-26 16:49     ` Mark Brown
  2016-09-26 16:50       ` Fabio Estevam
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Brown @ 2016-09-26 16:49 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Michael Trimarchi, linux-kernel

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

On Mon, Sep 26, 2016 at 01:43:28PM -0300, Fabio Estevam wrote:
> On Mon, Sep 26, 2016 at 1:34 PM, Mark Brown <broonie@kernel.org> wrote:

> > It really depends on what the actual board constraints are - are there
> > other consumers that aren't visible to software, is it electrically safe
> > to power down the rail?

> The can1 node is the only consumer of this regulator.

> The reg_3p3v regulator models a discrete 3.3V power supply with no
> software intervention.

So if it's electrically safe it's electrically safe...

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 16:49     ` Mark Brown
@ 2016-09-26 16:50       ` Fabio Estevam
  2016-09-26 16:52         ` Michael Trimarchi
  2016-09-26 16:57         ` Mark Brown
  0 siblings, 2 replies; 8+ messages in thread
From: Fabio Estevam @ 2016-09-26 16:50 UTC (permalink / raw)
  To: Mark Brown; +Cc: Michael Trimarchi, linux-kernel

On Mon, Sep 26, 2016 at 1:49 PM, Mark Brown <broonie@kernel.org> wrote:

>> The can1 node is the only consumer of this regulator.
>
>> The reg_3p3v regulator models a discrete 3.3V power supply with no
>> software intervention.
>
> So if it's electrically safe it's electrically safe...

So regulator-boot-on and  regulator-always-on can go away then?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 16:50       ` Fabio Estevam
@ 2016-09-26 16:52         ` Michael Trimarchi
  2016-09-26 16:57         ` Mark Brown
  1 sibling, 0 replies; 8+ messages in thread
From: Michael Trimarchi @ 2016-09-26 16:52 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Mark Brown, linux-kernel

Hi

On Mon, Sep 26, 2016 at 6:50 PM, Fabio Estevam <festevam@gmail.com> wrote:
> On Mon, Sep 26, 2016 at 1:49 PM, Mark Brown <broonie@kernel.org> wrote:
>
>>> The can1 node is the only consumer of this regulator.
>>
>>> The reg_3p3v regulator models a discrete 3.3V power supply with no
>>> software intervention.
>>
>> So if it's electrically safe it's electrically safe...
>
> So regulator-boot-on and  regulator-always-on can go away then?

regulator-always-on and regulator-boot-on just describe them and I don't see
any advantage to remove them

Michael

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 16:50       ` Fabio Estevam
  2016-09-26 16:52         ` Michael Trimarchi
@ 2016-09-26 16:57         ` Mark Brown
  2016-09-26 17:26           ` Fabio Estevam
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Brown @ 2016-09-26 16:57 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: Michael Trimarchi, linux-kernel

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

On Mon, Sep 26, 2016 at 01:50:37PM -0300, Fabio Estevam wrote:

> So regulator-boot-on and  regulator-always-on can go away then?

Like I say I can't give you a definitive answer on this without looking
at the actual hardware and what it needs.  Based on what you're saying
it sounds like it won't be an issue from the point of view of disrupting
other users but without knowing the hardware I can't tell if the
connected device can safely have power removed, sometimes devices don't
like having only one of many supplies removed.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Removal of regulator-boot-on/always-on when a consumer exists
  2016-09-26 16:57         ` Mark Brown
@ 2016-09-26 17:26           ` Fabio Estevam
  0 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2016-09-26 17:26 UTC (permalink / raw)
  To: Mark Brown; +Cc: Michael Trimarchi, linux-kernel

On Mon, Sep 26, 2016 at 1:57 PM, Mark Brown <broonie@kernel.org> wrote:

> Like I say I can't give you a definitive answer on this without looking
> at the actual hardware and what it needs.  Based on what you're saying
> it sounds like it won't be an issue from the point of view of disrupting
> other users but without knowing the hardware I can't tell if the
> connected device can safely have power removed, sometimes devices don't
> like having only one of many supplies removed.

Ok, let me give you more details: we power the board with an external
5V power supply, then a discrete regulator generates 3.3V to the CAN
transceiver chip.

Software has no influence on this 3.3V rail, which stays powered as
long as the board is powered.

According to Documentation/devicetree/bindings/regulator/regulator.txt:

- regulator-always-on: boolean, regulator should never be disabled
- regulator-boot-on: bootloader/firmware enabled regulator

and the dts looks like:

       reg_3p3v: regulator-3p3v {
               compatible = "regulator-fixed";
               regulator-name = "3P3V";
               regulator-min-microvolt = <3300000>;
               regulator-max-microvolt = <3300000>;
               regulator-boot-on;
               regulator-always-on;
       };
};

&can1 {
       pinctrl-names = "default";
       pinctrl-0 = <&pinctrl_flexcan1>;
       xceiver-supply = <&reg_3p3v>;
};

The flexcan driver (which is the consumer of reg_3p3v) will call
regulator_disable() when can1 is not used. Calling regulator_disable
on reg_3p3v will not physically remove power from the 3.3V, so should
we use "regulator-always-on" or not in this case?

About "regulator-boot-on": since it was not the bootloader/firmware
that was responsible for enabling such regulator, I think this could
be removed from the dts.

Thanks for the clarification.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-26 17:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 14:26 Removal of regulator-boot-on/always-on when a consumer exists Fabio Estevam
2016-09-26 16:34 ` Mark Brown
2016-09-26 16:43   ` Fabio Estevam
2016-09-26 16:49     ` Mark Brown
2016-09-26 16:50       ` Fabio Estevam
2016-09-26 16:52         ` Michael Trimarchi
2016-09-26 16:57         ` Mark Brown
2016-09-26 17:26           ` Fabio Estevam

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.