Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4673511pxb; Tue, 28 Sep 2021 01:05:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrSu5ad7O4rxvaaVZuJN0dxB3FcZOLCKEOad4nzX+nVGPTO1h1K48DVWCVZWsJFmshtErP X-Received: by 2002:a63:3d4a:: with SMTP id k71mr3486006pga.276.1632816345457; Tue, 28 Sep 2021 01:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632816345; cv=none; d=google.com; s=arc-20160816; b=k4KNo9IlM+eh+cjaBkP+vkAUlYyVXqE8xU5jjcEuer/F1qFnHQWalO8tMgMfCfV17y DPuvmf3NC0utuDWdFPc+zeJ4lOS3Z703gbKuWNPZ8rK/yZ6Cfc0MiriG0lqX/8CXyopi n9ouBYm8KqNYBjDS4AxfQfvJYV4ZYgdZiMYqfa8506xHeJbjOqh10gFHdfyrfR3nifNL V0VJg6eYV+WHQ5xecIxFdLCyqR2fvLhMv3XzVj6Tm/TVqoQWxfdh520Qd+DLr8zH/E44 lmeRcTEuB1Znb6/rIxv468gRHbnKJH38ll1Eey25um5VTQjVcL5GllfphX31/aQMmMJQ ivCg== 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 :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=0ug29t+efHhaBUw2Dp50mQebuUOvAPftYFzNvqEV2qY=; b=EDPKjt1SO0lc8De7ZTECcvyQkRn0198dfLG5JQOB53+u/FmgtvAQipsMSOcfVWHRM3 DGvVSdT0A2hLSBXaJaojlpSpZRpgtn7OLbl+28aQ3MpIb6gGY6YJkYABLPYpcufq5iaE uKS5dgEGOYB/OcroY+dYlKB3EN7MSWPAAnfKqknN2hUS+LUvyvgMKZAf2WwND+PrjYqy SYxJdkJaKvYd29PBeOfBfGGHkUuwK3p8X4v1Zx+NCdKbtAIo8PyqdyPoCDdG5PY1UmGj LoW8USIXjOzVEdJKI57kgRK83Vx4xu0OsunGYeJC1HKkL6HE/pT0Z+zMMry1RCM6ELN5 ClvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=QVNNBVh9; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=JX4ZcJtp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si10572486pgb.287.2021.09.28.01.05.31; Tue, 28 Sep 2021 01:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=QVNNBVh9; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=JX4ZcJtp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239513AbhI1IGJ (ORCPT + 99 others); Tue, 28 Sep 2021 04:06:09 -0400 Received: from wnew3-smtp.messagingengine.com ([64.147.123.17]:57467 "EHLO wnew3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239321AbhI1IF3 (ORCPT ); Tue, 28 Sep 2021 04:05:29 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 356ED2B01458; Tue, 28 Sep 2021 04:03:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 28 Sep 2021 04:03:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=0ug29t+efHhaBUw2Dp50mQebuU OvAPftYFzNvqEV2qY=; b=QVNNBVh9PXfkYoaPdq9UUH7QOZikJTT0VB7bfUzlVN 5kcwLcrWCHGHWmxvu3e9it/qR3/pSzem2vNQeVVD0P9glN/50Lxt6SIZpAlt4DtF Mruxk+kZlcpWlEnFM+G1E+iY0+8ZvD+H8l9reXpYbco0nKnG/WVn7j2V+ungOGVS Ei3DduyUQ5pWdm9fxrL5ifmMH4kB5pVRvA2QxVceQ/FSNW6X6R0rFD7gruy6sK5o XkENSberJhGMlDczdaGmjuYYTdmEUKhx45gmvfbPnFfKVpotRvZHkgVTs4sK3YtY OBu0x5VBCMVzuuhPJJkOjHIT2rho/Iyy9G46t/Dcdj+A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=0ug29t+efHhaBUw2D p50mQebuUOvAPftYFzNvqEV2qY=; b=JX4ZcJtpfl6gTkwFqylB5d2NbjKwNa2It jJ9LgcUH8reebwd3/pllIGuRI7GTwz3ojhvnjOUWBZm3bLbX4xgbPsyHl+TDeIWr wSjymAzhwnXKf3TTj/cvTqSkWVBrRCJfEzNbxQP1nF/+T/aSsZZrBOHQFm34aSsv Hs+ts+4kdkH8VpegsfyooIsl5KuCFKVp+jGjIrLbuaBgpG35R3KNTjskAWgx1/k6 GgqgJ2rKhZ73MPRUD1gTqGUXt642SvLiClrtTsF1k3gdboARhgTOeT7OPxSSt0gQ n8JddxFhJzGoKJgDmuuZuLQQ/gqsaf3xuhOv/qDJY2ItVnGX6t+2A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudejledguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghl ucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrf grthhtvghrnhepieetkefhheduudfgledtudefjeejfeegveehkeeufffhhfejkeehieff tdevtdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epshgrmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 28 Sep 2021 04:03:36 -0400 (EDT) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Rob Herring Cc: Michael Turquette , Stephen Boyd , Alessandro Zummo , Alexandre Belloni , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Samuel Holland Subject: [PATCH v2 0/9] clk: sunxi-ng: Add a RTC CCU driver Date: Tue, 28 Sep 2021 03:03:26 -0500 Message-Id: <20210928080335.36706-1-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series adds a CCU driver for the RTC in the H616, R329 and D1. The extra patches at the end of this series show how it would be explanded to additional hardware variants. The driver is intended to support the existing binding used for the H6, but also an updated binding which includes all RTC input clocks. A future patch series could add functionality to the driver to manage IOSC calibration at boot and during suspend/resume. It may be possible to support all of these hardware variants in the existing RTC clock driver and avoid some duplicate code, but I'm concerned about the complexity there, without any of the CCU abstraction. This series is currently based on top of the other series I just sent ("[PATCH v2 0/4] clk: sunxi-ng: Module support"), but I can rebase it elsewhere. Changes since v1: - Rebase on v2 of the module support series. - Combine "const"s to "enum" in the DT binding compatible property. - Properly update the DT binding clocks and clock-names properties. - Load the CCU driver from the RTC driver, not as an OF provider. Samuel Holland (9): dt-bindings: rtc: sun6i: Clean up repetition dt-bindings: rtc: sun6i: Add H616, R329, and D1 support clk: sunxi-ng: div: Add macro using CLK_HW_INIT_FW_NAME clk: sunxi-ng: mux: Add macro using CLK_HW_INIT_PARENTS_DATA clk: sunxi-ng: mux: Allow muxes to have keys rtc: sun6i: Allow probing without an early clock provider clk: sunxi-ng: Add support for the sun6i RTC clocks [DO NOT MERGE] clk: sunxi-ng: sun6i-rtc: Add support for H6 [DO NOT MERGE] clk: sunxi-ng: sun6i-rtc: Add support for T5 .../bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 84 +++- drivers/clk/sunxi-ng/Kconfig | 5 + drivers/clk/sunxi-ng/Makefile | 2 + drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 467 ++++++++++++++++++ drivers/clk/sunxi-ng/ccu-sun6i-rtc.h | 16 + drivers/clk/sunxi-ng/ccu_common.h | 1 + drivers/clk/sunxi-ng/ccu_div.h | 14 + drivers/clk/sunxi-ng/ccu_gate.c | 3 + drivers/clk/sunxi-ng/ccu_mux.c | 7 + drivers/clk/sunxi-ng/ccu_mux.h | 28 ++ drivers/rtc/rtc-sun6i.c | 35 +- include/dt-bindings/clock/sun6i-rtc.h | 10 + include/linux/clk/sunxi-ng.h | 9 + 13 files changed, 648 insertions(+), 33 deletions(-) create mode 100644 drivers/clk/sunxi-ng/ccu-sun6i-rtc.c create mode 100644 drivers/clk/sunxi-ng/ccu-sun6i-rtc.h create mode 100644 include/dt-bindings/clock/sun6i-rtc.h -- 2.31.1