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=-7.0 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no 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 6C8FCC433E2 for ; Sun, 19 Jul 2020 14:52:43 +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 3CD6721775 for ; Sun, 19 Jul 2020 14:52:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Gch1PWp6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G7Eq1PJQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CD6721775 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: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:In-Reply-To:References:List-Owner; bh=QWWSc/f8fIIzrhzSvapu/qwxXc04dKb54BVTJMlXgAY=; b=Gch1PWp6j/QfmTYVGfZWWM1O34 uu6Cz781fjsp/4pOdbB1+1Xe/snZXiMIr2yuAxXphln9p99AfxDDLsJiACQNo18T+Ctp8lxiO3AXp IWwvryMXTnc0SE5glOXpK1GdC7IoaOPOQ5u+maXaJZ622mS23WGCDobHa2EPOocwiazot8Z5+VdgB HqSg9rmJoGOZs2gUJI12LXO1Sr8XAMARaVwaZrvL7KKYAvhTkm5t7g5Ljc72qGmt79dDjHMyyriab Y3Utt4Pro32lmVst2/fuYsrDfuFspWBRBLdM5UuwyIF3RSr9x3MKX4xLpY/8MCchpwQEJBrijGn8M nMz0t62A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxAeI-0004QJ-U4; Sun, 19 Jul 2020 14:50:42 +0000 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxAeF-0004Ph-Nw for linux-arm-kernel@lists.infradead.org; Sun, 19 Jul 2020 14:50:40 +0000 Received: by mail-wr1-x441.google.com with SMTP id a14so581131wra.5 for ; Sun, 19 Jul 2020 07:50:38 -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:mime-version :content-transfer-encoding; bh=UUqLFtjizIDo67kZSDAuxTvDZ8v5hpCknWjlNVsJDEE=; b=G7Eq1PJQEyo8Takx/kaoykf4sk2/Xa1qsLGrafGiL8XQGE29sZLmx1ECnQuj/OBfHl dB3FB7qhSLBZ8EEjKI1t7h2fioIKfHRGdRFHB2Hun7yq2nkIcFaoNOAnLs0mncD2jZuZ Z+aEEPMPtmj7tPH+uyy/9jj7avxhM5DVK4WrmG/Z2+0aZM8XXBW8P7uTJlsRO/MsYO3L auqYIb/2kG0WJWuWZ5rfJ+3cYUcS9zErm28ppynDT62SlbtLzXoYIW9awCdktV+pijym /gIVw/oMoOFgp1yuIZtjWn6LWJ3A2rrQ/0Mw6wSQovG415EgsY4EsRLLNo/7GpnQH3mJ Virg== 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:mime-version :content-transfer-encoding; bh=UUqLFtjizIDo67kZSDAuxTvDZ8v5hpCknWjlNVsJDEE=; b=alFP9890+JPjpQRdUzqZFee+eo2YmHuweFPj9YTsfiaQh63NefVueYal3sgQhaJbaQ +Hgj6d5+RM6gPkmVb6tq1JL2p/uaONLIlEeFnqxU/txmngOrX0t7M5PHzmy9ApE/Kx/h s/bRA5zYvMc/G0u+d3iCAoAQTtVamNJGmRHx4G1U8M1ZLaHev7SsIU3iv/Av9eYj++hx eQ8vhR+oyCDwssprxaYSebUyyukAVJW6ZivtLDDBsxZizfyL5dQ2RRPgxqu3iMbohbhB +r6sZEgSuf1KToYmBg64s9dTt8QcK/uQup40ItWhJnK5lXqbBP+QYh1k0bf6YN5NHyDh on6g== X-Gm-Message-State: AOAM531k/zOeMVTHzlFaaGqtT7QFGw6gA+itldVIKowxNT97jijUHpDD gV/hmzTOHdwN9Qw+sh7uaGJ1zVxtk0O2rQ== X-Google-Smtp-Source: ABdhPJyNOMc9VuTGG3PC6b6FayRsZXsh0Mt8lFi6GRDpdpnSz9+N2I9pPXKA4OpE4DzP1iscXAosOg== X-Received: by 2002:a5d:6107:: with SMTP id v7mr18012777wrt.174.1595170237975; Sun, 19 Jul 2020 07:50:37 -0700 (PDT) Received: from localhost.localdomain (arl-84-90-179-3.netvisao.pt. [84.90.179.3]) by smtp.gmail.com with ESMTPSA id d13sm26422755wrq.89.2020.07.19.07.50.36 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jul 2020 07:50:37 -0700 (PDT) From: miguelborgesdefreitas@gmail.com To: a.zummo@towertech.it Subject: [PATCH 0/2] rtc: pcf8523: Make DSM for battery switch-over configurable from DT and enable it for the cubox-i Date: Sun, 19 Jul 2020 15:50:26 +0100 Message-Id: <20200719145028.3370-1-miguelborgesdefreitas@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_105039_825723_F8255D4D X-CRM114-Status: GOOD ( 11.70 ) 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, alexandre.belloni@bootlin.com, miguelborgesdefreitas@gmail.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 The pcf8523 has two configurable modes for the battery switch-over functionality: (i) the default mode and (ii) the direct switching mode. For the default mode to work (at the moment the only driver option), a filtering circuit consisting of a series resistor of 1 kOhm and a capacitor of 3.3 microF must be added to the VDD pin input to guarantee a voltage drop of less 0.7V/ms for the oscillator operation reliability (see pp.54 of the datasheet). Some boards (e.g. the cubox-i) do not include such circuitry and are designed to work only in direct switching mode. In fact, this is the recommended mode in the datasheet for hw designs where VDD is always expected to be higher than VBAT. If DSM is not enabled, after a power cycle, the voltage drop may be too high causing the oscillator to stop working momentarily and the REG_SECONDS_OS bit to be set. This causes userspace applications such as timedatectl and hwclock to fail when obtaining the RTC time (RTC_RD_TIME: Invalid argument). Hence, this patch set makes DSM configurable for the pcf8523 RTC in the device-tree and enables it for the board where this issue was detected - the cubox-i. Note that if the RTC comes from an inconsistent state, the software reset will override any power management options set during the probe phase. Thus, pm is also enforced in pcf8523_start_rtc. Miguel Borges de Freitas (2): rtc: pcf8523: Make DSM for battery switch-over configurable from DT ARM: dts: imx6qdl-cubox-i: enable DSM for the RTC Documentation/devicetree/bindings/rtc/nxp,pcf8523.txt | 7 ++++++- Documentation/devicetree/bindings/rtc/rtc.yaml | 7 +++++++ arch/arm/boot/dts/imx6qdl-cubox-i.dtsi | 1 + drivers/rtc/rtc-pcf8523.c | 13 ++++++++++--- 4 files changed, 24 insertions(+), 4 deletions(-) -- 1.8.3.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel