Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4853503pjb; Mon, 27 Jul 2020 06:53:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxROLSoIgm7KLs/bfeFSAAm7SZi0k57EF7Gs7AMzgTRT0k9xhu7GB4fVFUMAkxlTWC91wDO X-Received: by 2002:a05:6402:1687:: with SMTP id a7mr21037782edv.358.1595858035131; Mon, 27 Jul 2020 06:53:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595858035; cv=none; d=google.com; s=arc-20160816; b=VnIPqg9qqRE2lfOJOYQQjUAZeauwmAKRTwqJBDbrUFdkrnmn8amyXcq0Fa9DckwgkK UYau78Jbd2J8Uq1kUQ9SruzzedvkeT+Zk3OC0126H+sPDU8Hvf8+n5rGGxskQFe9Ac+e 2GMVQpsoFRC4pM/LICndebX5+ZMtIIUVAjYuI6R572gBjPSIIQnFH1MMMcYmIXXSgT0v QYP6xHMLmAARCggiRm9IepONL1u8H2/1lP/QNt0dEgrxs9x9zqGvvktQ1sFlKU4MC6Dm wp/kUaM0yz/WRLG2COiX7DOu68Ebifh+5NE1nLdIth/c/2l/I2Ac3bOagwAyMhGw21tE oIHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=wP4Kt6O/vFKZf7I8OioZ5wu30mbV3QIkDu9uPSa2GcI=; b=vlUJx2owWoRx/pMxYTFXLvFaB8bCFJJOF31Q3cY1/ttIwUjofqoifeCIEPTkZo/tem eRmZSLQqN6MQhXWNWHt4cWcqVlz4/zNswozE2HtbV7RYGy2psj4fUpwYsCRnMIcpFa+n my2vZ8Fd942gsed2Ya2h666T179+S9p72GYY3Jy5HUVYh1rxGGOTonvIKqpkhrzFIBE0 Rep9b0zjp4NVU1kS5xNQHGgIlesVnSaSocsUjfA26mmJTy6aGknfzEqbI/Fpaam6eM0L lp0ha06gri6SkShpNPqSTlTVLXgJt6wwHTp8Q1ImlZRrQL6Qd3Fy5s7yodzUnVIaZu9s iPtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@solid-run-com.20150623.gappssmtp.com header.s=20150623 header.b="rtFeL/3b"; 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 ay22si5794609edb.569.2020.07.27.06.53.33; Mon, 27 Jul 2020 06:53:55 -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; dkim=pass header.i=@solid-run-com.20150623.gappssmtp.com header.s=20150623 header.b="rtFeL/3b"; 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 S1728974AbgG0Nd5 (ORCPT + 99 others); Mon, 27 Jul 2020 09:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726817AbgG0Nd4 (ORCPT ); Mon, 27 Jul 2020 09:33:56 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F5D2C061794 for ; Mon, 27 Jul 2020 06:33:55 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id d6so3258904ejr.5 for ; Mon, 27 Jul 2020 06:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solid-run-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wP4Kt6O/vFKZf7I8OioZ5wu30mbV3QIkDu9uPSa2GcI=; b=rtFeL/3bkvsvdTZCa/KswNcWitGjGI+n5qCO6lZ7yIQ+yJ7VoEsrbaumluptUIpXIR gglMmLoYeTYvw7qniGc8izu5WjyIu3Hy5A5B8LHwnTbHdH7dbIsKgE/DALB2OSSCtiQl k2izB4ykZudJid3QApa7/xi5gU5+naaadOidfWiiJ2HPLtLrLIWWwXOFs0I0qa4q5dwa 9Ik2ECh2HoCE6GFbAkVHLMC+1wbHFJmmBCMqqBmxkb+4XcnpqUZoJuMGOScfeVpiuzri hoF+SL6zVOKwskJDGPLPCZzuv82uXzEB1uvqCDoSV+wMA/zeQ7TyqFGPMXqXHb4E06yK xsDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wP4Kt6O/vFKZf7I8OioZ5wu30mbV3QIkDu9uPSa2GcI=; b=JqttsWl8aZxWlKobT8DvXM/TbfCu59gcnNx5j9KcVjwaiKMqx0rsN6WBF59UdzBbUD vJGD2uNF9mV8gyindAJxp/1YPnp+F2DUxnznA8r19W5PYf/AR+q//lB4hj73+nLKl6TP rCwcGpHpSeY1dU60/T1LQNKU0czjb01GmXL2lYIaMmonENzkNtXnfct0loIpZ5Yh+bRk RL8BmgoHgzy4uyc4QwE2I4xXIbogeiZsOkqM7yt1W/1ReupMxld7XHh2ujf0fPZVajJD e20C6LSyDj3Drb7yHuARqJGuFoywOobduGSe45kaxnewC2x5RsNUXwiEJUyjpCMlgn6E gGCA== X-Gm-Message-State: AOAM532Gfg0JqdPPY+uQ+gKbbqb9Y18dqF+8ipyQvDik2j9hfFrnsONR EI6d7F/fAauxdVEa0u4cScnP2EFiSqDsvUfAp907Ig== X-Received: by 2002:a17:906:a204:: with SMTP id r4mr13603758ejy.552.1595856834293; Mon, 27 Jul 2020 06:33:54 -0700 (PDT) MIME-Version: 1.0 References: <20200719145028.3370-3-miguelborgesdefreitas@gmail.com> <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> <20200720112401.4620-2-miguelborgesdefreitas@gmail.com> <20200723174905.GA596242@bogus> <20200723195755.GV3428@piout.net> <20200727094553.GH1551@shell.armlinux.org.uk> In-Reply-To: <20200727094553.GH1551@shell.armlinux.org.uk> From: Jon Nettleton Date: Mon, 27 Jul 2020 15:33:17 +0200 Message-ID: Subject: Re: [PATCH v2 1/3] dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over To: Russell King - ARM Linux admin Cc: Alexandre Belloni , Rob Herring , Miguel Borges de Freitas , a.zummo@towertech.it, Baruch Siach , Shawn Guo , Sascha Hauer , Sascha Hauer , Fabio Estevam , NXP Linux Team , devicetree , linux-arm-kernel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 11:46 AM Russell King - ARM Linux admin wrote: > > On Thu, Jul 23, 2020 at 09:57:55PM +0200, Alexandre Belloni wrote: > > 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. > > Why does it need to be changed dynamically? If the hardware components > are not fitted to allow the RTC to be safely used without DSM, then > why should userspace be able to disable DSM? > My presumption would be if you had a system that ran at different system voltages depending if it is plugged in to mains or running on a battery.