devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Hugo Villeneuve <hugo@hugovil.com>
Cc: Conor Dooley <conor@kernel.org>,
	a.zummo@towertech.it, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, bruno.thomsen@gmail.com,
	Hugo Villeneuve <hvilleneuve@dimonoff.com>
Subject: Re: [PATCH 1/2] dt-bindings: rtc: add properties to set battery-related functions
Date: Tue, 8 Aug 2023 14:32:26 +0200	[thread overview]
Message-ID: <202308081232266ec8a9b7@mail.local> (raw)
In-Reply-To: <20230808082533.b608c9a2a4bd922920643c4b@hugovil.com>

On 08/08/2023 08:25:33-0400, Hugo Villeneuve wrote:
> On Tue, 8 Aug 2023 12:21:24 +0100
> Conor Dooley <conor@kernel.org> wrote:
> 
> > Hey Hugo,
> > 
> > On Wed, Aug 02, 2023 at 03:11:52PM -0400, Hugo Villeneuve wrote:
> > > From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > > 
> > > These properties can be defined in the board's device tree to set the
> > > default power-on values for battery-related functions.
> > > 
> > > Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> > > ---
> > >  .../devicetree/bindings/rtc/rtc.yaml          | 19 +++++++++++++++++++
> > >  1 file changed, 19 insertions(+)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/rtc/rtc.yaml b/Documentation/devicetree/bindings/rtc/rtc.yaml
> > > index efb66df82782..0217d229e3fa 100644
> > > --- a/Documentation/devicetree/bindings/rtc/rtc.yaml
> > > +++ b/Documentation/devicetree/bindings/rtc/rtc.yaml
> > > @@ -26,6 +26,25 @@ properties:
> > >        0: not chargeable
> > >        1: chargeable
> > >  
> > > +  battery-low-detect:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    enum: [0, 1]
> > > +    description: |
> > > +      For RTC devices supporting a backup battery/supercap, this flag can be
> > > +      used to configure the battery low detection reporting function:
> > > +      0: disabled
> > > +      1: enabled
> > > +
> > > +  battery-switch-over:
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    enum: [0, 1]
> > > +    description: |
> > > +      For RTC devices supporting a backup battery/supercap, this flag can be
> > > +      used to configure the battery switch over when the main voltage source is
> > > +      turned off:
> > > +      0: disabled
> > > +      1: enabled
> > 
> > Why are these implemented as enums? This seems to fall into the category
> > of using DT to determine software policy - why's it not sufficient to
> > have boolean properties that indicate hardware support and let the software
> > decide what to do with them?
> 
> Hi Conor,
> the reason is that I based the new properties on the existing property
> "aux-voltage-chargeable":
> 
> -------------------
>  aux-voltage-chargeable:
>     $ref: /schemas/types.yaml#/definitions/uint32
>     enum: [0, 1]
>     description: |
>       Tells whether the battery/supercap of the RTC (if any) is
>       chargeable or not:
>       0: not chargeable
>       1: chargeable
> -------------------
> 
> I agree with you that a boolean would be more appropriate. Should I
> also submit a (separate) patch to fix the "aux-voltage-chargeable"
> property to a boolean?
> 

No, this is an enum on purpose.
I will not take battery switch over related properties, this is not
hardware description but software configuration. There is an ioctl for
this.

> Hugo.
> 
> 
> > Thanks,
> > Conor.
> > 
> > > +
> > >    quartz-load-femtofarads:
> > >      description:
> > >        The capacitive load of the quartz(x-tal), expressed in femto
> > > -- 
> > > 2.30.2
> > > 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2023-08-08 18:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-02 19:11 [PATCH 0/2] rtc: pcf2127: add default battery-related power-on values Hugo Villeneuve
2023-08-02 19:11 ` [PATCH 1/2] dt-bindings: rtc: add properties to set battery-related functions Hugo Villeneuve
2023-08-08 11:21   ` Conor Dooley
2023-08-08 12:25     ` Hugo Villeneuve
2023-08-08 12:32       ` Alexandre Belloni [this message]
2023-08-08 12:44         ` Hugo Villeneuve
2023-09-05 15:30           ` Hugo Villeneuve
2023-09-19 15:32             ` Hugo Villeneuve
2023-09-19 15:34             ` Hugo Villeneuve
2023-10-11 13:49               ` Hugo Villeneuve
2023-10-11 22:23               ` Hugo Villeneuve
2023-11-01 14:19                 ` Hugo Villeneuve
2023-11-01 14:21                 ` Hugo Villeneuve
2023-08-02 19:11 ` [PATCH 2/2] rtc: pcf2127: add support for battery-related DT properties Hugo Villeneuve

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=202308081232266ec8a9b7@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=a.zummo@towertech.it \
    --cc=bruno.thomsen@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hugo@hugovil.com \
    --cc=hvilleneuve@dimonoff.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --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).