From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBA8CC433F7 for ; Mon, 20 Jul 2020 11:24:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA5E722CAF for ; Mon, 20 Jul 2020 11:24:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uoxcNeLN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728595AbgGTLYn (ORCPT ); Mon, 20 Jul 2020 07:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728587AbgGTLYl (ORCPT ); Mon, 20 Jul 2020 07:24:41 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99C64C061794; Mon, 20 Jul 2020 04:24:41 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id f2so17427559wrp.7; Mon, 20 Jul 2020 04:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EqLyPhmrOwod1tcRJ7mEQ+gXPXSq7Nk5K0GWxKk/b8A=; b=uoxcNeLNN++s3CWu6vvva5p4VzC/EcNdioQeI0zDkgICA/xJUyqa1RglF40tuPFMud 7UkpBFggaOkg6bJCuJEmGPECUHcrGFjkH+7lAqn+NV+SonmNIQu9tcMg5lR0KQdiv+cF z0KkTb/1ZJfSuXdCh9PxvPAUV1Jau/PAbT1vTq/891AYUJvtbDrmTT3CXeZlo4E5G5KD SjtWuxanIhkd3htWcV1qZiLqLQ2v3ZfeieFuNMfEHc5OgulagVInEvola8/pQLMlIb9Z ZqV66wYqHsmjWmmXJFMj+9YVSyk5Nfcx4xUN5N0ea3+1WQs5nIuRCyR3ScNnuq9Pkppe oQUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EqLyPhmrOwod1tcRJ7mEQ+gXPXSq7Nk5K0GWxKk/b8A=; b=prFREc1VF6LFcasRyPutOirNnP/5hdZyVsWrLGQYR2p/X4V5rM90uhLdXHLmLR6qLB y+odysTDT3/QUAiIbf2b1a8dDhcuVDtFgvR0puwD0Cdzfo5YZxIqGi0u2gbbiSRpaKqY rBR/hlM54/UfP65I3JEwDb6M0frgVeGv74brnT0WTPbOhgzzLIW1dIReL0Gf5IIqA90z EH4cnFcB5zS7w1c9ExAoluGN/NzH97KjeKs4tITVCoC66NEn2qHhrFbljTBgQzhpkrCT bydJAmnAIs8k7J9Y9eCz+VrF/BmC3/lkzlKkilFXW0cT3g9nhwcbUyQgjIqSCfIEoqDn Nf5w== X-Gm-Message-State: AOAM531Nv7fuXoz1fM1I1GDYsdGzr/NLsBWzF+ldg7kn3h740qvjp+JR 1mY6QqCmXh7MYWrSfTRfc3w= X-Google-Smtp-Source: ABdhPJw1rTMDjy6l3Gfu8wVrvKT/8l7SQoqnujkgsJS6aGgqWPGIh2pnXQEQuM0XyP1EqWZ85jSt6g== X-Received: by 2002:adf:edc6:: with SMTP id v6mr21929317wro.413.1595244280304; Mon, 20 Jul 2020 04:24:40 -0700 (PDT) Received: from localhost.localdomain ([148.63.172.143]) by smtp.gmail.com with ESMTPSA id t4sm33452942wmf.4.2020.07.20.04.24.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2020 04:24:39 -0700 (PDT) From: miguelborgesdefreitas@gmail.com To: a.zummo@towertech.it Cc: baruch@tkos.co.il, linux@armlinux.org.uk, alexandre.belloni@bootlin.com, robh+dt@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, miguelborgesdefreitas@gmail.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over Date: Mon, 20 Jul 2020 12:23:59 +0100 Message-Id: <20200720112401.4620-2-miguelborgesdefreitas@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> References: <20200719145028.3370-3-miguelborgesdefreitas@gmail.com> <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. + ... -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C924C433E1 for ; Mon, 20 Jul 2020 11:26:06 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 673A722B4D for ; Mon, 20 Jul 2020 11:26:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Sj/slJVn"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uoxcNeLN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 673A722B4D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=R1h2/pNvg0uv4y6aSZsJPlolrBH/za3+GWOs8zSuH+c=; b=Sj/slJVnT5pUFaLcDtH6lLXIU jPA5/YJiCbWIAJElxA99ljzeoqMQLe4sz+tXSlHiZN5ogQ7USAeBvtpGgGHcKV2KCujg0EPQyt98s TWKXNrQNS5k3F3G+PYudl3htMmO49TB4FiL6R/5lVZtRWwOHkIRq5rVCbj2g+ZAcpdak/dJzK7/sv REZRMpvEiAJgsAQ1y41evPTWEy3nBz+V+LssXUMMM0H0H7XONn2QVXDY+iK9/hI9gwkMDUN1XvIF5 5oEBovEzJqbTCSlRypuCw0nrpGjxk/Q57pa8s0KhealjUaLoj/fjmSjuFxj0x1imUicuFhG2BLfXZ PkMlz+mjg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxTuW-0001Lj-Dy; Mon, 20 Jul 2020 11:24:44 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxTuU-0001LA-9B for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 11:24:43 +0000 Received: by mail-wr1-x443.google.com with SMTP id y3so108558wrl.4 for ; Mon, 20 Jul 2020 04:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EqLyPhmrOwod1tcRJ7mEQ+gXPXSq7Nk5K0GWxKk/b8A=; b=uoxcNeLNN++s3CWu6vvva5p4VzC/EcNdioQeI0zDkgICA/xJUyqa1RglF40tuPFMud 7UkpBFggaOkg6bJCuJEmGPECUHcrGFjkH+7lAqn+NV+SonmNIQu9tcMg5lR0KQdiv+cF z0KkTb/1ZJfSuXdCh9PxvPAUV1Jau/PAbT1vTq/891AYUJvtbDrmTT3CXeZlo4E5G5KD SjtWuxanIhkd3htWcV1qZiLqLQ2v3ZfeieFuNMfEHc5OgulagVInEvola8/pQLMlIb9Z ZqV66wYqHsmjWmmXJFMj+9YVSyk5Nfcx4xUN5N0ea3+1WQs5nIuRCyR3ScNnuq9Pkppe oQUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EqLyPhmrOwod1tcRJ7mEQ+gXPXSq7Nk5K0GWxKk/b8A=; b=CR3phUnFcKa0oiw192OkZfVfHEcxXNy00Z5kf4vfhGf2oSixAlWDFu/pG6GuzrVtzg eBcKwJTw0gdF+6151tf50l4IB9VvKzcn1DY8Vj36NQbmVG5NQwiFIisbZYVdttmUtYJ4 FQzoBleEdUAMyQ2gc7MsQYZM2VHJW7HNXWuOQeBk7fswrFBWPXNwHZT8P20Tz/ubfDWd fPtLTB1f8WiRqRtsRsotxRmCB7ERcO2Xf47gaVmM9LfuqqAm/WBDS1pyn2Nz2iTuaddM vckLegXzpKtTOAjg5mVPlQkJCi4xErfJs0A9qKIVi6HstnnCBT46c5Uum6Cl3mQ5YHcP Dksg== X-Gm-Message-State: AOAM5303YGYFKNz0jHKHl1a6moXzC2Tkj9Owi4IZuECz27ZmDVqb3UIa WsKOHo+4QvPNob5hmxl1AJQ= X-Google-Smtp-Source: ABdhPJw1rTMDjy6l3Gfu8wVrvKT/8l7SQoqnujkgsJS6aGgqWPGIh2pnXQEQuM0XyP1EqWZ85jSt6g== X-Received: by 2002:adf:edc6:: with SMTP id v6mr21929317wro.413.1595244280304; Mon, 20 Jul 2020 04:24:40 -0700 (PDT) Received: from localhost.localdomain ([148.63.172.143]) by smtp.gmail.com with ESMTPSA id t4sm33452942wmf.4.2020.07.20.04.24.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2020 04:24:39 -0700 (PDT) From: miguelborgesdefreitas@gmail.com To: a.zummo@towertech.it Subject: [PATCH v2 1/3] dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over Date: Mon, 20 Jul 2020 12:23:59 +0100 Message-Id: <20200720112401.4620-2-miguelborgesdefreitas@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> References: <20200719145028.3370-3-miguelborgesdefreitas@gmail.com> <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_072442_377188_452D1FE7 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, baruch@tkos.co.il, miguelborgesdefreitas@gmail.com, alexandre.belloni@bootlin.com, festevam@gmail.com, s.hauer@pengutronix.de, linux@armlinux.org.uk, linux-kernel@vger.kernel.org, robh+dt@kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. + ... -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel