Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4726942rwb; Tue, 8 Aug 2023 12:51:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7h484BSHBzYoQLT5qv3FYw2UcNZpdoBVqIJFrzVRRbB4rZ1tSK6HtMQT/PyHOeLbehdAn X-Received: by 2002:a05:6870:332a:b0:1bb:83e9:6277 with SMTP id x42-20020a056870332a00b001bb83e96277mr667741oae.33.1691524263920; Tue, 08 Aug 2023 12:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691524263; cv=none; d=google.com; s=arc-20160816; b=N1sXdYcz7YxQV/V+9+ktmYexkoqMqR6nOclkm75Pml8ldKgBeY8Omppq2G/ZPLPcIe uS9yVYmoAUCjuBQaIJoeZtEwvxTZ4UlchnlTsB07VxcdtiI/w/DkMd9LFRg0LZaLORbN H68TmLLLkOHUbJTrj94YCzPnT7rZxSPf+RmPVYuMjgidHoKd5+M+U9axud07i2VLbU0X nAl6aC1Pj2+O7RZ+ErcF2k+hzhGbYOim9LV8b9wTAL9eYkioIMkTnK/dspyCK+ICb49R RDdBCacI9jOooEgyMgxDIabwvS/95YvziwBr10YWo/uniitd5Ggyauwb/UJw5vuPFB14 DH/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Uz4PDleM9cm+NzvA+51SH9T9J1LoZFkV7vQFvjxHPvc=; fh=W5k45KleAzLAJBNPoY9mXRwtpXzb91C0AeaCjmceo8k=; b=qX9KMKmIdloKAo0EpZdFw0X3/wYPYbnQrv17kf0cbWkk8s/PHcNcDdMeIKmQ4i0PUp ahvoLFl4/V3FKF4SI/7w+Eq+32ct846rTXLlNrM8pdR/nfQgg2o+P509ZqlpJzcD8WKL A5u6Go49/wmZmQDjbpn2lFwszQFxcN4HY4nYX6HSeGN9r/2S6/fe7DGLEeMN/YDaqVPN LhF+me3GyhaZIc989YFGPdlvL/kztAwz84quyLztsoYu0szdHzrg/KaqkUmGFYtPV4e1 r+eD2kACMg0AQ8vUAQH9T0aPyArGfkFNWfqx0pt6fmCYhG7sx1VRMyfV2VqXtr9SJDVe OAyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=U2zxC6kU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g129-20020a636b87000000b00553a99dd783si7283396pgc.778.2023.08.08.12.50.52; Tue, 08 Aug 2023 12:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=U2zxC6kU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233299AbjHHSyO (ORCPT + 99 others); Tue, 8 Aug 2023 14:54:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbjHHSxt (ORCPT ); Tue, 8 Aug 2023 14:53:49 -0400 Received: from mslow1.mail.gandi.net (mslow1.mail.gandi.net [217.70.178.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F25A790; Tue, 8 Aug 2023 10:08:34 -0700 (PDT) Received: from relay1-d.mail.gandi.net (unknown [IPv6:2001:4b98:dc4:8::221]) by mslow1.mail.gandi.net (Postfix) with ESMTP id B5DB4C6DC9; Tue, 8 Aug 2023 12:32:31 +0000 (UTC) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8F88D24000C; Tue, 8 Aug 2023 12:32:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1691497948; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Uz4PDleM9cm+NzvA+51SH9T9J1LoZFkV7vQFvjxHPvc=; b=U2zxC6kUkqR+q7UizYXdWgf/r3Vv4/Jg+KWT7f32GCj/bzuGXUXHVrjF9juLgxAk59QO55 nBT+btfgySUbEbIp+OxLwsbqA0KcDR/SzFuClmKp0Vli07c53KQOh3Dpn9pB+g5EEoP0Lz 9cHdE24aGeI1LNaPdDm5VJureEoSymKLPQBSf3GLIxRF4FukB8m8Fmcw50wnSCwHSdRXPt JO8wWPyfSqvxR+cmD6JcqKO0e9PFc5FnlKNt5KYh6bygJ5nzzdT81Z2vCXGQkR+sfRVybJ AfwpFM8BoGFkaaZmTrbKbBvv8/fkPI/WgtqnNfPyKeWI/Kjaga1F/qnFSzClyg== Date: Tue, 8 Aug 2023 14:32:26 +0200 From: Alexandre Belloni To: Hugo Villeneuve Cc: Conor Dooley , 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 Subject: Re: [PATCH 1/2] dt-bindings: rtc: add properties to set battery-related functions Message-ID: <202308081232266ec8a9b7@mail.local> References: <20230802191153.952667-1-hugo@hugovil.com> <20230802191153.952667-2-hugo@hugovil.com> <20230808-capsize-deodorize-5776d3dbb192@spud> <20230808082533.b608c9a2a4bd922920643c4b@hugovil.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230808082533.b608c9a2a4bd922920643c4b@hugovil.com> X-GND-Sasl: alexandre.belloni@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/08/2023 08:25:33-0400, Hugo Villeneuve wrote: > On Tue, 8 Aug 2023 12:21:24 +0100 > Conor Dooley wrote: > > > Hey Hugo, > > > > On Wed, Aug 02, 2023 at 03:11:52PM -0400, Hugo Villeneuve wrote: > > > From: Hugo Villeneuve > > > > > > 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 > > > --- > > > .../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