From patchwork Thu Jan 26 14:20:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 48724 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp298077wrn; Thu, 26 Jan 2023 06:27:06 -0800 (PST) X-Google-Smtp-Source: AMrXdXs95FeA2m3lvrUqlCYaJlYDES6hVDo2N5ZykwidzgAculItzq6kDksxQA18UIqgtsukcJt2 X-Received: by 2002:a17:906:dc44:b0:86d:abca:3f55 with SMTP id yz4-20020a170906dc4400b0086dabca3f55mr41818804ejb.15.1674743226402; Thu, 26 Jan 2023 06:27:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674743226; cv=none; d=google.com; s=arc-20160816; b=jo9HWxkJogtr1o5ulvgxWOyyQaXJ9qFBqyUEW1NuXuoB4vkreyNhgyynt+5NrdRUq1 Nf1pYXgEvEp00Aa4z0049Nc1ODaB6KSat08GKPq/PTa8IpbNKAJ/OtbLCig6uZV5RcKZ UtoBczRMHwXfNKdvVocjKTC2UEpAGyKF/LffwV8rpKAGTUjPxK8KyKKEFXzeJOzwuJJi tXQ2PuYJODsdeD306MxoiDN1Fl3onDmVQrvjULq9qaHiustlDzqj1sYN9An1jXVLIy0X yL098IXWS8+nqYz6Hh6Iwilxh9U+nyXhAO+L/Q+bHAhfaoYUF+xiNv6qNf8DOqAV7KIW osJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fcDxyFeNWZW/USdTfm2r6LDZK+y9VZ0AaHx/6d7pXFA=; b=z2bvKVhaRI9B1frL9YaXZrH7OSviux1nZSoV/DmaC2500uXwWWTixQXWMIugT6SSdE sTClYZPLH6AlgmPbP/53BHRawXtRsmxwWFPS8nC/ZmDQEZ9dUnfJr5u+j54DG8Ksp+rq yJJ99npwVQAl3ig2BG3z0QsG6ysnhJMT0RLJ+tFnsfVVpvCAAMHEs8gAi7gAH4C1osfC FF1/C/c0EjU4RceFTiy7r3f/bKVqhKdyAQ9ZsP9zHmgUmdub/Ia9E90KLejzl3U4VZvh mVoInokAsRfu3Zjb+k0pePC16WPotCnaszd/6Gc5VlXAKTw/3FEf37LJtcJD0EpnkCWv G2CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OMnTIpqG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ms32-20020a170907622000b007d82520def9si1395367ejc.503.2023.01.26.06.26.42; Thu, 26 Jan 2023 06:27:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OMnTIpqG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232245AbjAZOX7 (ORCPT + 99 others); Thu, 26 Jan 2023 09:23:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231991AbjAZOXF (ORCPT ); Thu, 26 Jan 2023 09:23:05 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 470283757B; Thu, 26 Jan 2023 06:23:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 08C04B81DF8; Thu, 26 Jan 2023 14:23:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63D5FC4322F; Thu, 26 Jan 2023 14:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674742978; bh=2SM/Ui25AWvYpcR7rG/b1iY3k51zQ41f392BYri9b24=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OMnTIpqGk9MS51mIXmtKCNcxlJaK26xH4GGnA1GIWjxMtOuQmnhywFbzqMZA7V5r9 4IjElCUzoqhXP5eWBpGihE7DyWawK7G+AOVoExtB/D4fYAkaFUEkkt7MzEUKzWGM6E HjOA/tTLJiVdLjKU19LhpP9xFHccNde8LdfyfCEdGmzpk4VuUGuBt+xwENFPlvdg8A 6lqZXgl6l6kYj8kXHVCnufDDHOV26iC6UhK+1uPwy0k2FpBAytyV9SJex8l23BJZlb zw1kf7ODFdKWUVg2/g2pu2cqzLEZdTNixRzQMY86Z7Elkd0oJzGfepOdbgDknO5mK9 b1ls8j3EplOww== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pL39d-0006ir-9H; Thu, 26 Jan 2023 15:23:05 +0100 From: Johan Hovold To: Alexandre Belloni , Bjorn Andersson Cc: Andy Gross , Konrad Dybcio , Alessandro Zummo , Rob Herring , Krzysztof Kozlowski , Maximilian Luz , linux-arm-msm@vger.kernel.org, linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 15/24] dt-bindings: rtc: qcom-pm8xxx: add nvmem-cell offset Date: Thu, 26 Jan 2023 15:20:48 +0100 Message-Id: <20230126142057.25715-16-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230126142057.25715-1-johan+linaro@kernel.org> References: <20230126142057.25715-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756095553621183215?= X-GMAIL-MSGID: =?utf-8?q?1756095553621183215?= On many Qualcomm platforms the PMIC RTC control and time registers are read-only so that the RTC time can not be updated. Instead an offset needs be stored in some machine-specific non-volatile memory, which a driver can take into account. Add an 'offset' nvmem cell which can be used to store a 32-bit offset from the Unix epoch so that the RTC time can be updated on such platforms. Signed-off-by: Johan Hovold Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml index 21c8ea08ff0a..b95a69cc9ae0 100644 --- a/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/qcom-pm8xxx-rtc.yaml @@ -40,6 +40,16 @@ properties: description: Indicates that the setting of RTC time is allowed by the host CPU. + nvmem-cells: + items: + - description: + four-byte nvmem cell holding a little-endian offset from the Unix + epoch representing the time when the RTC timer was last reset + + nvmem-cell-names: + items: + - const: offset + wakeup-source: true required: @@ -69,6 +79,8 @@ examples: compatible = "qcom,pm8921-rtc"; reg = <0x11d>; interrupts = <0x27 0>; + nvmem-cells = <&rtc_offset>; + nvmem-cell-names = "offset"; }; }; };