From patchwork Thu Apr 21 09:00:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12821350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3EC1C433FE for ; Thu, 21 Apr 2022 09:00:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387215AbiDUJD3 (ORCPT ); Thu, 21 Apr 2022 05:03:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1387185AbiDUJDZ (ORCPT ); Thu, 21 Apr 2022 05:03:25 -0400 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F25AB1D0C2; Thu, 21 Apr 2022 02:00:20 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C835560011; Thu, 21 Apr 2022 09:00:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1650531619; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qXWNtp/Z3Mw+KK/AtkZmzuXfaNAB/G/qAlAtA92kuRU=; b=jQ4aCqfquTxU9jUbq8mtpcWlCe5fHe2dBc+aUo/eshTwnsX7dXNtGMMX3OkKMfYdDKSy4W Qq7i9QhSpymgkBc0gBh3e/AfCZvIY2Bvk8EvfbaYCkmFDNgMteyZXedCWBBwtX+36os2h3 NQK+yoFHcBbTxz9WpM1ywbcJ9DXBUkN44rad+2YhDiMs4BnaaY+i3OgZwiGaSonaKQomDU hJCtzbjkICQZ0QLVT1WuLpT1P0c5JlN4K8N+T5kMY7c+o1qd2Hgv41+KG1oo7/YeArS/24 1ATsejCX6YzqbXB/WfDLFyQqskXqVwDIe3/MzAuhIZrjlJbieMg07/1+7o07NA== From: Miquel Raynal To: Alessandro Zummo , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd Cc: Miquel Raynal , linux-rtc@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org, Gareth Williams , Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Thomas Petazzoni , Herve Codina , Clement Leger Subject: [PATCH v2 0/7] RZN1 RTC support Date: Thu, 21 Apr 2022 11:00:09 +0200 Message-Id: <20220421090016.79517-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hello, This small series adds support for the RZN1 RTC. Despite its limitations, I found useful to at least have alarm and offset support. As the RTC clock issue was addressed by filling the RTC clock description in the clock driver, we no longer depend on other series. Cheers, Miquèl Changes in v2: * Fixed the error path in the clk driver, where I missed to release a spin_lock. * Collected tags. * Moved the rtc subnode in the dt to keep the nodes ordered by unit address. * Dropped the useless "oneOf" statement in the bindings (compatible property). * Dropped the start-year property in the bindings (already defined). * Avoided rollover calculations that could be more easily handled (and reviewed) with a time64_t conversion. * Returned ERANGE instead of EOPNOTSUPP when the alarm date is not valid. * Cleared RTC_FEATURE_UPDATE_INTERRUPT to avoid warning from the tools. * Dropped the sysctl patch adding the reset helper, instead fulfilled the description of the RTC clock so that when requesting this clock to be enabled, the idle bit is released. * Avoided rollover calculations that could be more easily handled (and reviewed) with a time64_t conversion. * Fixed the max_range value, after a rtc-range test and looking at other implementations. Michel Pollet (1): rtc: rzn1: Add new RTC driver Miquel Raynal (6): dt-bindings: rtc: rzn1: Describe the RZN1 RTC soc: renesas: rzn1-sysc: Fix the RTC hclock description rtc: rzn1: Add alarm support rtc: rzn1: Add oscillator offset support MAINTAINERS: Add myself as maintainer of the RZN1 RTC driver ARM: dts: r9a06g032: Describe the RTC .../bindings/rtc/renesas,rzn1-rtc.yaml | 65 +++ MAINTAINERS | 8 + arch/arm/boot/dts/r9a06g032.dtsi | 12 + drivers/clk/renesas/r9a06g032-clocks.c | 2 +- drivers/rtc/Kconfig | 7 + drivers/rtc/Makefile | 1 + drivers/rtc/rtc-rzn1.c | 427 ++++++++++++++++++ 7 files changed, 521 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml create mode 100644 drivers/rtc/rtc-rzn1.c