Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1599033ybh; Thu, 23 Jul 2020 13:01:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4gf32ayEv8Ihez8EVOz0GLKo3mbdHLr1Hw1cnh1E97c/1u2Bj6x2BDgS+QdL4wv9hlkMe X-Received: by 2002:a17:906:b354:: with SMTP id cd20mr5756870ejb.296.1595534489408; Thu, 23 Jul 2020 13:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595534489; cv=none; d=google.com; s=arc-20160816; b=qYQNElmqooVKWCpKii6aspcsin5b4lY8uwdJ200Wh6ICr+rLcB2RKPuOZOZEUbVB6J XCLkQa2MlnvewpXgfY1nt9JE3H5e7CY2FoZWWE+mFkGtGakaX9j2GGB7f48VDxKiEsrj BQ/am7v9aBbJ689X/R4ubUKiJTChMlyP+UknJzPAFuXVtt2VfqddjY4aaNtDShlQw99q 5joz9Xk60npExpfGjWDW1T/niAhVIf8cJhzscUhgNeIkn5gvw7IKCQrd6LsctE7NSct1 OzShqJyy1jcLJFeRAelXkLqzpzg7cmA/b/zyVCubKBi0atjL0x9yFgnaClDRdngY6OaP 9nkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UvGXI1JczC6L4uM3l3JMsXfOFH0ve8Kb+x650Lwosus=; b=U6+KaVyipL+sHMvdJsJFPyPHA/1vVD7fGXoUjUnc8dNmJ9nFGlYy8gUWVMb/bvRO+a nXOCaGs1cQRzIOwiMeev1NdnNOIdkx9xBVUYf9CUE8fxxUHrsqpzCTWku2MK9hhPPgOa zXPzWgvxfuGqKpDIV1RCfu9VMg0iC4m/Fx4sfYlcxqGi5vDwYuoobhsgneiRMWe64+/5 TKREKtEdX42qdpqghLRsoAYVvMpZq0UzxlsUcsX7ZswK17J0njsm5CnGHHYpzryW8z6q TSYc2cTRSvGYrwrCNOmSIeEtTEhw8/gXh8kRK9wEltTDJcfmVpqyFcu9s13LjvDJlXZf goiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id md1si2375358ejb.749.2020.07.23.13.01.06; Thu, 23 Jul 2020 13:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726812AbgGWT6B (ORCPT + 99 others); Thu, 23 Jul 2020 15:58:01 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:51549 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgGWT6B (ORCPT ); Thu, 23 Jul 2020 15:58:01 -0400 X-Originating-IP: 90.65.108.121 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id EE163E0005; Thu, 23 Jul 2020 19:57:55 +0000 (UTC) Date: Thu, 23 Jul 2020 21:57:55 +0200 From: Alexandre Belloni To: Rob Herring Cc: miguelborgesdefreitas@gmail.com, a.zummo@towertech.it, baruch@tkos.co.il, linux@armlinux.org.uk, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over Message-ID: <20200723195755.GV3428@piout.net> References: <20200719145028.3370-3-miguelborgesdefreitas@gmail.com> <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> <20200720112401.4620-2-miguelborgesdefreitas@gmail.com> <20200723174905.GA596242@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200723174905.GA596242@bogus> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/07/2020 11:49:05-0600, Rob Herring wrote: > On Mon, Jul 20, 2020 at 12:23:59PM +0100, miguelborgesdefreitas@gmail.com wrote: > > From: Miguel Borges de Freitas > > > > This adds direct-switching mode as a configurable DT flag for > > RTC modules supporting it (e.g. nxp pcf8523). > > DSM switches the power source to the battery supply whenever the > > VDD drops below VBAT. The option is recommended for hw designs > > where VDD is always expected to be higher than VBAT. > > > > Signed-off-by: Miguel Borges de Freitas > > --- > > Changes in v2: > > - Added extended commit message for git history > > - Separate dt bindings documentation into a single patch > > > > Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt | 7 ++++++- > > Documentation/devicetree/bindings/rtc/rtc.yaml | 7 +++++++ > > 2 files changed, 13 insertions(+), 1 deletion(-) > > > > diff --git a/Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt b/Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt > > index 0b1080c..f715a8f 100644 > > --- a/Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt > > +++ b/Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt > > @@ -4,10 +4,14 @@ Required properties: > > - compatible: Should contain "nxp,pcf8523". > > - reg: I2C address for chip. > > > > -Optional property: > > +Optional properties: > > - quartz-load-femtofarads: The capacitive load of the quartz(x-tal), > > expressed in femto Farad (fF). Valid values are 7000 and 12500. > > Default value (if no value is specified) is 12500fF. > > +- pm-enable-dsm: battery switch-over function is enabled in direct > > + switching mode. The power failure condition happens when VDD < VBAT, > > + without requiring VDD to drop below Vth(sw)bat. > > + Default value (if not provided) is the standard mode. > > > > Example: > > > > @@ -15,4 +19,5 @@ pcf8523: rtc@68 { > > compatible = "nxp,pcf8523"; > > reg = <0x68>; > > quartz-load-femtofarads = <7000>; > > + pm-enable-dsm; > > }; > > diff --git a/Documentation/devicetree/bindings/rtc/rtc.yaml b/Documentation/devicetree/bindings/rtc/rtc.yaml > > index ee237b2..a0048f4 100644 > > --- a/Documentation/devicetree/bindings/rtc/rtc.yaml > > +++ b/Documentation/devicetree/bindings/rtc/rtc.yaml > > @@ -47,4 +47,11 @@ properties: > > description: > > Enables wake up of host system on alarm. > > > > + pm-enable-dsm: > > + $ref: /schemas/types.yaml#/definitions/flag > > + description: > > + Enables the battery switch-over function in direct switching > > + mode. Should be set in systems where VDD is higher than VBAT > > + at all times. > > I'm all for common properties, but is this common across vendors? > This is but this shouldn't be a DT property as it has to be changed dynamically. I'm working on an ioctl interface to change this configuration. -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com