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, URIBL_BLOCKED,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 3FE6DC433DF for ; Mon, 20 Jul 2020 11:26:07 +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 11A2422B4D for ; Mon, 20 Jul 2020 11:26:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PAfXdHU6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k4X2OaYS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11A2422B4D 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=xC24nN8lS6H3YS18kuu6r9IeXT7fG0Sh6Y0o8XLCdKo=; b=PAfXdHU65i5Gx+2w4Hf2o9Wmc 3UUNwT3TRWl55Xf9Pa+3EDtrJGJIVVxavsX/xGrANUHu/sH80Macj3djWNUeIPnw/ssvjsk8WDiVO Pw1H6rqK5b/ezizLXySCISJVRo0B6xZtM4pKR+h5THDqPyWjsyObnKJVmXnknWlbzFnn/nqbaTAaS x2trCwN2OLD97mSSMfDpb+03KmuGn7AHy/f0nyITocNKeXv6mxscKZPi9wQiAsde6diIe4JyBOzlM GuFA/ht5iNO01UeS5mhCyCJLG9JmbWg1PRjET58To8TPWdHrdNyhUE0RhBmFJYpjwnF7cQFzEXYjr zg07D+eaw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxTuQ-0001Kx-N7; Mon, 20 Jul 2020 11:24:38 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxTuO-0001KJ-M5 for linux-arm-kernel@lists.infradead.org; Mon, 20 Jul 2020 11:24:37 +0000 Received: by mail-wm1-x344.google.com with SMTP id 22so21902845wmg.1 for ; Mon, 20 Jul 2020 04:24:36 -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=we7ZOPNX5bncne4MzulbXaLTxuq90c6Q451uL4ylMtY=; b=k4X2OaYS8OXBJM7sCwS70Ri/5W0j21FIYJyuyl3wjKX5ADod3E+yiXaddKeSNZ6JDd mWks0S0fu4YLkFLFYk3AxL+MPqQmCMFbJ4v0jQDL32+/9MWV9qvTRhjAsy16TJ71FSsT Tvo+OnzrRvsLBPj3rOaHtZlzsuzBu/R0Zkawwh+fA2Dr2wneVsbH+R+NE2qgfci2jeZd QofW3jw0h4jkgW3CtKUdNTAfHWcAKMtny/ORnXcq06EaSDcBdq9oZV23XpPOQmRv1x6c iU/pIthPS52zHHiNGCDLGSvghjIzemwms81ljfXfvyNnJ6nYeLoLngTTUNn0XCTdgCXp cjmg== 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=we7ZOPNX5bncne4MzulbXaLTxuq90c6Q451uL4ylMtY=; b=EiG9pqyvn2RPk/X0HZ8sU8r6bWD/q2c65Ifm0UzTl/i3Q1Un3OviVcxBnCVy8/r3cm 9VaSoYSJgjcchVx/d2Q+/DTlnXoYWlPnK9kyLZnQ5Df4nZ4bJSJHj6ngc5zPXxqzzLrM y+acQKRAfHhJQhikFOEMvB/0zDotSafvShvxb/fBks1KKC8Qw8Ksgg13reOO8+lfBDWX wIKyBWCBNYIoPzPMzIIZmXDRUxnltA/XZ37FNTTQoTITSmC/2F+jxupqIkuAGvKUMxz0 4IzxmAn3qrQXCmoa06HF2wKSvNDpKKhIQsotESrLSS/GGpBCkgJQpRS5S8TF6pvLjuQO JbIQ== X-Gm-Message-State: AOAM532rS9VxgbB+Bl3hzvbz9/2XdlQe8mFx2YoQb3UJ56gwulUWbdZx hFIkcxu5GOJGA6KqC7kyPnG9MRsm50w5Ng== X-Google-Smtp-Source: ABdhPJwCtUYUYWCIdai0FsptVERDa5OY4vy/4d1ENbWgHYiQcvBtZxGqbXPp+Om57vNI+m3fUPmUjQ== X-Received: by 2002:a1c:de07:: with SMTP id v7mr21400592wmg.56.1595244275589; Mon, 20 Jul 2020 04:24:35 -0700 (PDT) Received: from localhost.localdomain ([148.63.172.143]) by smtp.gmail.com with ESMTPSA id t4sm33452942wmf.4.2020.07.20.04.24.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jul 2020 04:24:35 -0700 (PDT) From: miguelborgesdefreitas@gmail.com To: a.zummo@towertech.it Subject: [PATCH v2 0/3] rtc: pcf8523: imx6qdl-cubox-i: Make DSM for battery switch-over configurable from DT and enable it for the cubox-i Date: Mon, 20 Jul 2020 12:23:58 +0100 Message-Id: <20200720112401.4620-1-miguelborgesdefreitas@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200719145028.3370-3-miguelborgesdefreitas@gmail.com> References: <20200719145028.3370-3-miguelborgesdefreitas@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200720_072436_828766_CB7B3671 X-CRM114-Status: GOOD ( 13.76 ) 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 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. Changes in v2: - Added extended commit message for git history - Separate dt bindings documentation into a single patch Miguel Borges de Freitas (3): dt-bindings: rtc: pcf8523: add DSM pm option for battery switch-over 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