Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2157031pxb; Thu, 3 Feb 2022 00:00:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/iLaxamKkxS6w3lGuWV2r36S7Uh+WgG4E4QuOeOIeDHzCwyPHqQ7hLvnYxx0PR8eCQA24 X-Received: by 2002:aa7:9566:: with SMTP id x6mr33169446pfq.21.1643875252390; Thu, 03 Feb 2022 00:00:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643875252; cv=none; d=google.com; s=arc-20160816; b=swC0hL+pxPMDCHBsiUVC/mWb7TVVj6wyTFYjyCYbHnkS2dpjIg5+yfqjEB5C5ZvoGv 1uRZtgPz7bWTebxKJRP8suJCh3uhDw/TLytjmm5tP6HxJT3UrgGfBqdnBk7XaCHhORZJ idEFSAX8VjvPLrSXCRU5wCv3Dc9/ZKX/5T7QcsWsLs1Mw16nIJn7J6ilvQayyZbGCGer qfHentnzRRkB6B09SvZYJB69uJqS+sLA5X2Ya7jVGXFgA4Kcp6//kvMjLZdRnoV3TbNm 4vC4t3zav5NOiSOCPxnBovKFzRnzBmZOIYHnUHaq6np5osofAO+avfSysR/DXslm5UYK DxYA== 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=RytlSUaDRmapV5YwWfkzWD1+yC9W9mp9nHm/VpHru/A=; b=T7t+ALZpX9iIdSMiKME3cWueyFcyePiGYTwtgNniEfO2lGIn7FE0Lp7Q/W2pl+GO4h 1Lo3zlQncBdh9F7YqnoMMMRKNkgcN2ILtIsG64tRaR+WRQvyWCfVxu91rM4cJWQv4Ztb s1t8gfAk0o5YcmGvTyB+JHee4+5kIfW8WYGHZYlM1hqFv9iogFVpxipAJkO00DPCvfx/ irUC7Xc809tpQC19Ixy16vy7l7CpMRrC8O6poit5YHaa9G1+elKVD1IDqlex5R+Q3Pbt ZB61SJEuAaWHAG3HAUGplMLPTAvpNw4cV7LGHweVZiVdTOaMQJtwoETICUDa8A2vI4IX CAzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm1 header.b=bE4CUdLZ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=hmnkszU4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8si23698858pgb.674.2022.02.03.00.00.40; Thu, 03 Feb 2022 00:00:52 -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=@sholland.org header.s=fm1 header.b=bE4CUdLZ; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=hmnkszU4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348901AbiBCCRm (ORCPT + 99 others); Wed, 2 Feb 2022 21:17:42 -0500 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:58871 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239177AbiBCCRl (ORCPT ); Wed, 2 Feb 2022 21:17:41 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailnew.west.internal (Postfix) with ESMTP id 8CF9E2B0019A; Wed, 2 Feb 2022 21:17:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 02 Feb 2022 21:17:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm1; bh=RytlSUaDRmapV5YwWfkzWD1+yC9W9mp9nHm/VpHru/A=; b=bE4CU dLZC5ycYQ29W6w7WmkiyDhRYKTMXe3ExKn1iFR4QopansEIHFClcQWxukboGv6VF 5Nn7F6J7ZRN624YP/IRJtbrZ+xjL4tBYLsDbx5sxvZXTKbQcpv9xqNAzQOfvA0Fk UwkTqEVQLxqZ/QkFpy1YdzsZ+IjHUYvNkbHf+ne0EXHAzPRAZM+GG252HJX3VBKS T+H0OuqawOwYT17AOx1C+jvPvFb7G9M9ixDWaOgGyT0ExM21EPyCnsm7KjlhyEig CzH6qmk4fkKMh+tMjWRrXqsh+XeWeqq4qs9MrYBNOQNN9AOk86nsjed6SRpmegEr TIolgIvcM5z7/BI2w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=RytlSUaDRmapV5YwWfkzWD1+yC9W9 mp9nHm/VpHru/A=; b=hmnkszU4kAAenV+yP1A3wbLJxeLZ6oKIftjRrKcHNMg6P H7woqqxXDgwNbMWGqEaEB9YX78Trk6QLzfq/JdiTYvednxiV1OvCQD1SFoD88TM3 JVHk7ZarPiQWX3tN2lPo75KYPqPf7SLmJA0mP9uBPxN6hZM8KEOrG/PCYp2cqh+f Emltupdy0+4ifCeUqPuZ+6NgmVSRTHiVBAPedO5VcOiHouoB9aPVnToxqXjawLgD SVhrFriMEw5MrIuTyYImV9uKfB4quXEtgBhrTa9BWSsOJrAts2ErfYC/oKzCf7+t 8gTTlyb2jbXwA0KRWQPRImY6V7BIRuIqIyP3drMJw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrgeeigdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepufgrmhhuvghlucfj ohhllhgrnhguuceoshgrmhhuvghlsehshhholhhlrghnugdrohhrgheqnecuggftrfgrth htvghrnhepieetkefhheduudfgledtudefjeejfeegveehkeeufffhhfejkeehiefftdev tdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsh grmhhuvghlsehshhholhhlrghnugdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Feb 2022 21:17:37 -0500 (EST) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , linux-sunxi@lists.linux.dev Cc: Alessandro Zummo , Michael Turquette , Alexandre Belloni , linux-arm-kernel@lists.infradead.org, Rob Herring , devicetree@vger.kernel.org, linux-clk@vger.kernel.org, linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Boyd , Samuel Holland Subject: [PATCH v3 0/6] clk: sunxi-ng: Add a RTC CCU driver Date: Wed, 2 Feb 2022 20:17:30 -0600 Message-Id: <20220203021736.13434-1-samuel@sholland.org> X-Mailer: git-send-email 2.33.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 patch at the end of this series shows 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 without adding this new driver, by adding them to the existing RTC clock provider, but I'm concerned about the complexity there, without any of the CCU abstraction. Changes in v3: - Add/fix several maxItems attributes for clocks and clock-items - Drop the SUNXI_CCU_MUX_HW_WITH_KEY macro, since it is no longer used. - Also drop the patch adding the SUNXI_CCU_MUX_DATA_WITH_GATE macro. - Rebase on v5.17-rc2 (CCU module support series was merged). - Move IOSC calibration control to prepare/unprepare operations. - Declare several `struct clk_init_data`s as static variables (instead of as anonymous) so they can be modified from the probe function without casting away const. - Instead of creating two copies of clocks which may or may not have muxes, change the number of parents to 1 in the non-mux case. - Use a single CCU description for all variants. - Use IS_REACHABLE to guard the call to sun6i_rtc_ccu_probe. - Allow the driver to be built on !ARM64 (i.e. RISCV). - Rebase example on top of driver changes, and drop the second example. Changes in v2: - Combine "const"s to "enum" in the DT binding compatible property. - Properly update the DT binding clocks and clock-names properties. - Rebase on v2 of the CCU module support series. - Load the CCU driver from the RTC driver, not as an OF provider. Samuel Holland (6): dt-bindings: rtc: sun6i: Clean up repetition dt-bindings: rtc: sun6i: Add H616, R329, and D1 support rtc: sun6i: Enable the bus clock when provided clk: sunxi-ng: mux: Allow muxes to have keys clk: sunxi-ng: Add support for the sun6i RTC clocks [DO NOT MERGE] clk: sunxi-ng: sun6i-rtc: Add support for H6 .../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 | 393 ++++++++++++++++++ drivers/clk/sunxi-ng/ccu-sun6i-rtc.h | 15 + drivers/clk/sunxi-ng/ccu_common.h | 1 + drivers/clk/sunxi-ng/ccu_mux.c | 7 + drivers/rtc/rtc-sun6i.c | 48 ++- include/dt-bindings/clock/sun6i-rtc.h | 10 + include/linux/clk/sunxi-ng.h | 2 + 10 files changed, 538 insertions(+), 29 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.33.1