From patchwork Thu Jul 2 08:10:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2509 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 6BE931C0929 for ; Thu, 2 Jul 2026 10:17:07 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24060-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24060-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 7E0EA302DB3E for ; Thu, 2 Jul 2026 08:11:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FADC1F0991; Thu, 2 Jul 2026 08:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="GXOf0bIs" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 694F1416D01 for ; Thu, 2 Jul 2026 08:10:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979849; cv=none; b=ZiNlhnPReZLYnRktZGIfuUkan2+e2g/qsDdv+IcBGav2BQHea7RPkk9IFy8FtX5NEeh1XRvrcA6Ivfujgq5RmDOduhbPLX2IttifRotOw+WUXQ+pX3XHuO44BUt5Vryl2Y7ucHtaULKAl1XpTVn7bGBt2b4RSQXckEiy1BgtTeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979849; c=relaxed/simple; bh=0RrokHtYa2cUv4xV/HjfdQdge3X2ED1AmM/T8cwvnI4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aKP8Mwvyo3W6Ki5Z5kP3pIM3GyboiE2dEhcCQQ285ab+df8Pv7Le2SH/IpTc2yvCptkrmn+qtGiZeuY/JlwMPmPqC62fn2pW5TFQZD+9MYtsCHHBzq62jHYnD+XsAQMr0E+3F4hk2YATgBCaofkE0Bl1xz0nTcdlIkkMETtXWO8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=GXOf0bIs; arc=none smtp.client-ip=209.85.221.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-46ed4f66256so1283307f8f.3 for ; Thu, 02 Jul 2026 01:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979846; x=1783584646; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TYGMlfq+GfXXzZc3hVZ9rsCaJpaLl9f+A3Em9EwRMIA=; b=GXOf0bIsl8GvgWHNNfsIlnk8JFNy3Xvy8fTYzo/OwoPesaebuShcylGDM548T4t0R7 TKUok4S+Zazv7sEAxQGCYlLZzbtXBuZUO2QzzRlLdh/OAoSkEjjSA91CWy7/2j68tCyW m6ZfUJMTYN6F1KYkvz5QFmsgpdReY4874k8LeeF7ghzxxc9He5uY0nU157bPCevWsSxq t14TaXkMexUcAWmNmbA3dZietJaOLfKV7qh4WIp6rOfnJ4ymPwXhtflsgMJrdEv5NJA6 WwUlMTrFNHuLExUHFC+47e2aG2HVkUmOy5ofLmfrAP4qdWHvRLksdKglARrCoktlip3w 5wJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979846; x=1783584646; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=TYGMlfq+GfXXzZc3hVZ9rsCaJpaLl9f+A3Em9EwRMIA=; b=Zaruz2LHgdHyE5/CGPu94YbD74U1DCshaUXRAwA2nKtJXOHjWpgtiL3yhmjaI+qKXN Ju5fW1ZbJG0wYBWZd0c8G8Aah1YLaxbuTzf74c6yuAL9s0xS/S8XICrR+WyJudDDSBfy iZGrFA7I75krIg2szVA8yFbv0E9LbzGQQcDCuEs7iNu3cAfy02GNEsnWfBOc5pr0aoUA 6v95ZUffHPMhtTad6NeEoA+QVVzaGCIvFjoom+FiO1MIso8J0CLTtWKrA1luhKGGNqBE qJYkHWzLyNsQu8sBG7seXvo8DghDPJVbXcadRbMAXnv9wpeeuOIKwjvOKYvRDi/Dx4DO cf/g== X-Forwarded-Encrypted: i=1; AHgh+RpiJCaFSFCyxLjTYaqGI1Z/2WI7Y2Szj3qcZWZlrYPHmxIeDXR+qNBLBZ7B3jiJFcCsw0ucfXRikOsoCA==@lists.linux.dev X-Gm-Message-State: AOJu0Yz0Lyeo1p6HObnkZ/nYZu54BBEvDAq7y8Uhp8ogbGA+Kgw9w0Mf tNmW1IM4evExXTeyT81qrW2+LVpWDDI7Hhi58txpumx7I0SGNJBi+ROXWOq2Y/ueb7E= X-Gm-Gg: AfdE7cnd+X4ZwBQ76ZhZrfftFPgLW7aEUZLm5D2gBxjcyvWbf5TkLAHccaKmRPShJNX 6jTT5KCWVV6ImNHO89/fxnNTuWuXt37+/fwmg53LPXV4Ey9PpnKl3zhUpZbZhdY0et6sBrruSMZ s3pfJ2uJtjOFX6TFPX92+MR5UjGcMmne9Oxhln2TKH1LrMl/ptfL/BT9++9sPSrEq5N/Unl1/cM k673xvzMq6gILD/Uu+2bGrAJBbAoJfmSTjm3asQevGj5twZGs2n6F4uFZo+PWxTY18gPBMfy4Lg tqyO83igBGagflOh2jwfhh5IBPEyTKzNwxhgNImJ3pgZ6vnxPdwChTZKIX7X8osCnlf2wpaqmWB SB/pT6Ayo0GkSMov5UWyf5RjAgQLfvytjiTfMBWVvVZE5eXCR+GUJ9uTTHcRgtxhjKMZkmvzAWO rsnfRjvFk6LrweJUtLy3yIxA== X-Received: by 2002:a05:6000:601:b0:475:c578:b619 with SMTP id ffacd0b85a97d-4775bd0ecf9mr6698699f8f.30.1782979845774; Thu, 02 Jul 2026 01:10:45 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-477de3dd46asm6536252f8f.36.2026.07.02.01.10.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:45 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:00 +0200 Subject: [PATCH v3 1/8] dt-bindings: rtc: sun6i: no clock-output-names on h616/r329 Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-1-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Sashiko , Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1184; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=0RrokHtYa2cUv4xV/HjfdQdge3X2ED1AmM/T8cwvnI4=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz2fMF2sbd/orrOrcVKsxCiTA6ndgnw6zaG9 gF/0t0uH8eJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc9gAKCRDm/A8cN/La hZHKD/9Ta2ZnK32lHMVoKaep+EmFCig9bncFhk9h9fFDao10aAE8gADLH1+PGGugqeUWMjQqMEm AC+KCbuiAbunDWvJy7SFsEIg24VljmT1jCYsb1Pb2zIcNCvmIevcWSEG1mHYPZFLVvtNC0FGaE4 U8dfpLU8EVw4V9CYpYOHJL5h+m7OQuj3XmhOCrt9m9h5AQ3bJ0CjHhZ9G7vnXcmI075jZl9PctP nhj1RCC+Fn9VPOEGBdBuM/ck8l6KKzu64UCJ67YTWch2/STBZMvdhjhLpr7JQgOih9K7ZQbX3QC b0Re9Wxuy6HqmKb+cCBASAuFEnOUEXW8ErKD9/GDdH7KIKcZy8PNlgrtcbicP31Rx8EDCme0ndR TzuPFzT6iuVJ4+WyIJHLwypT4Q/VKl/3iOrB6EJ07PC81E4GSHAvUQ1xhAYs7HuTUMjviDnu4lG iHRlgi9rKfnXjQRwH4ZMI7cd4oF4w24b0bZW4gdb023lqmtml5TVHGw51QgShFWaNYsIaNV33Rf b4h7ldNt1wZrf2lynVLBMs4iVD+Z8k8902KQ5sNQpgwpxFxWqmBYsHjN71NSY4OCh9gTk/GKT2+ WFefYnLwMEdOO6L4A3LXeoY/1UCryjYoOPm7YzQz/2FB9t+z8CHv015xBiQZkqVtedcPcujP+a2 xRBrmiLz4T9INZw== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[104.64.211.4:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; RCPT_COUNT_TWELVE(0.00)[19]; RWL_MAILSPIKE_POSSIBLE(0.00)[104.64.211.4:from]; DBL_BLOCKED_OPENRESOLVER(0.00)[sin.lore.kernel.org:rdns,sin.lore.kernel.org:helo,baylibre.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; PRECEDENCE_BULK(0.00)[]; DMARC_NA(0.00)[baylibre.com]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_TO(0.00)[pigmoral.tech,bootlin.com,kernel.org,gmail.com,sholland.org,baylibre.com]; R_SPF_ALLOW(0.00)[+ip4:104.64.211.4]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[bounces-24060-noreply=patchwork.local]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jbrunet@baylibre.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:104.64.192.0/19, country:SG]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 6BE931C0929 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= On h616 and r329 chips, clock output names are never defined through DT and are not meant to be. Just disallow the property for those chips. Reported-by: Sashiko Closes: http://lore.kernel.org/r/20260629125305.0DF981F000E9@smtp.kernel.org Signed-off-by: Jerome Brunet Reviewed-by: Chen-Yu Tsai Acked-by: Conor Dooley Acked-by: Alexandre Belloni --- .../devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml b/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml index 9df5cdb6f63f..959a012c626f 100644 --- a/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml @@ -175,6 +175,18 @@ allOf: interrupts: minItems: 2 + - if: + properties: + compatible: + contains: + enum: + - allwinner,sun50i-h616-rtc + - allwinner,sun50i-r329-rtc + + then: + properties: + clock-output-names: false + required: - "#clock-cells" - compatible From patchwork Thu Jul 2 08:10:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2504 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id BE9B01C0929 for ; Thu, 2 Jul 2026 10:13:47 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24061-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24061-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 643A230651BA for ; Thu, 2 Jul 2026 08:11:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D1C5420E8E; Thu, 2 Jul 2026 08:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="HBCS/bOc" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60EF541C312 for ; Thu, 2 Jul 2026 08:10:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979851; cv=none; b=eomWt9EtxTkI9zujmpj3fVYyrDJCg+61kv0B8ehWDsKpS3M9sQfqKp9NUpPiaBrOfueBuqBP9QX/TlLrSEz3c/QVJ59iEesUoUiAkwQIKeV13v8mhsjj58LFdYURTPgEa9fOSE8aAhW+/f2vEt0fuI8Nq7UYoCEeB4YjL9usixE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979851; c=relaxed/simple; bh=CzBUXV7sOVhx3D4ZGCj9tufXm0ii5Jrd89A5CtNYTv4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dSztvqWc3aHaPLdCP5jkyVhlAavWPtFe4Jic5Fw+kKRrwbmorXSJ4UhKYKXsWWTTvwAF1oTjjIbS2+HlvgmzlqTumCbxhz/ICEYGB9Fh1zGHrqwr2nwGYZbCwqVHjjYmW8G3Sm81EuDdMqdeOJtAQYZtls9ruxtnc5BhRgvP6m0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=HBCS/bOc; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-472326ca506so1101489f8f.2 for ; Thu, 02 Jul 2026 01:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979848; x=1783584648; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XOiiEpGpIC5lxOzEa7sAsZH1/Y83nzXYTBPvtikqmXw=; b=HBCS/bOcxv+AgSV8SfBQxE405n2Hip3mqG1N/0hyUNA558HOP+7UV8sNgP6+3Rq5Ki XnRuFZ/6osj+Ru4BwFyI3FCQQlhxTbw4YztLXKu7VRJ0l4k8krJWzO0GzPogbVRpRoHJ YKGrwuVh+Q4TBeekePkRgIeaRRohfPWrznWjO+5/ZA0/xHD+6jvnFp8QOUAv2pFUpz/p 0u8uqVFIPb59yfUbQGVvDy47z6H0+iwbs+Ukyj0GNDTIU1TdDcwXi3ZjbbqpI4bMWDKM 9sWJddZTvbOmBRZhmsj4i+/k/J2CpZTn4YulLACVEGbw1ADxiUAx0c3JIrQbN3rwA7Wg zNkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979848; x=1783584648; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=XOiiEpGpIC5lxOzEa7sAsZH1/Y83nzXYTBPvtikqmXw=; b=PT3gNR/ULxpI0rnckuYdNwzeIm9DqRqYETQAcpppOgtKlXtORtA5CB1Z9ieiue6D2M t8gMBBN0Rm5nHUxJnUh9mQrQfEkZ8OtYn0XfhmHgmCOxkK73rCYGmOltxgLKc2glqSPY tISHAPLbgGXRqTlEfg/KL9OWA1+6jg+IVm/VtOujqXSTgPSoWoKCUpxsz2mlXBHOajVZ zfoMHk5ho8U5RswaEvOGUB7ZNrCMaDQQh1Kvi1rN5Xctniu1JgV6N8jnO2RKH1d070qI q/hw8jEyoUuylvF1tEWabIz18L4WtNXFFa0/j3vapX235wZZ1EF3hirLWloBJKGMVXyG 51bg== X-Forwarded-Encrypted: i=1; AHgh+RpaEvcrnfuEA1uoOymcLkuDE4/VZvsSjIi/QVyNK7TGibI/+dHPnjN0TPDzVGe19U1GuFF7GOf1xic4jw==@lists.linux.dev X-Gm-Message-State: AOJu0YyG7BpVHibgLNPgKs24QYRE9IoBDKhIwDCTaQp2+jd7TNxrFkHM QvbU038gvYsBjow5uaBFpxlQ+1KrxlthTB0dYCqpJmYdjeI+sVOXbOkrHaORvSmaZ5A= X-Gm-Gg: AfdE7ckSbhe+T1EcqNuzceMLSRh5bXG06FCIQrphmlzMnYhHeIn1H60WY/4kRKwkE+R Jcpdy/Gjm++AKrqDd/Bae0UwTNtG5P9pgKTVkrpKM2huDiROy9PXQpgvdg5p2V2PpNRG1DDKdvc /yF9gSF8LSLkReG6HRDwni8ho3dVpEhaSa1JuIbmb9PJJOaB+ObwOsSHgYBPenEnHRUhK36pn27 AnAiIfFSVibKU1F93hF34E6qovFTYKe3cMCTUzNcfIrxK2tGLrcRmiunsO27Lw8I4qmEmpkqB6W Yq2enVXp/ByY9cUEix10Z/MlOzY93BiI2Afb9LNERvTfuQrFRE9V31LIjZuGO8le3O0SprPz8C5 R7Xlr1n6P0ro4JjooqIm5MtAXX4zyxPLlfZP+H14cqCVRdzAFfjrI1xyKv7sYBQqZzC5pngEYRZ 1Cbt8g5SnDM50= X-Received: by 2002:a05:6000:18a4:b0:465:ba53:a006 with SMTP id ffacd0b85a97d-477588e7d03mr7472094f8f.23.1782979847883; Thu, 02 Jul 2026 01:10:47 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-477dd94c829sm6374826f8f.24.2026.07.02.01.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:47 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:01 +0200 Subject: [PATCH v3 2/8] dt-bindings: rtc: sun6i: add sun60i-a733 support Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-2-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=1439; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=CzBUXV7sOVhx3D4ZGCj9tufXm0ii5Jrd89A5CtNYTv4=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz3c3Z+CDWtJbpQmgihyGCywyiqoUE3JkQyt 6xSTIHXDA6JAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc9wAKCRDm/A8cN/La hev+D/9qqaYp4+SX4EN+QRwhZL9SKx/Rjuxo5TLCmPxSfNWP/r82A0hPjW8lkiXBaHr0JFpStVl jzHLZcQ93NroFjk9JyixfEnW2GKdPE/DADdhVBQBRnB8rwQxJHJWFuWFL6JrbU1MW9Wj48laRaa 6cmou7Koc4vN+e9OClHXcB+Nw8NQ1okWbDUzwmbsZfMypkIyQnIPsvc/HX4u5tsUDCfVbU3x8+n iyPB2URXAHkgLi2muc2ZWr2FTnuSYE7rFOjsax5ymg7+CQzHWLED0nz8JFxqd2BaraF+Qeg95T/ +fCm1g8Rjb4/vkW63foqIcmbd4PdtFdq5SPpcG5jWN8PXRcU+PrZ3gng3z2/Yl9+lSZtxJHplnG rM7K78UOnSYxqV0XZb75pVHjQSkgFC1JNOk+XtV3dTi1Oc7o21Twp4ct6qLAeJ5vV+WWYivLCPR t9TGq2qozq7pQPVtqppeCAXrgwi3U4O2bWOu3CYOv3ZJrVvXScRmFujVs8Gr5p1N5y4w2Rf9p/a 3PKVMaOyiM1tf8rUsiCGqyl8HffUlRS/Ih34/QYfrutYr/EJfx7lTzxu6Guntcq93hoEVXn7vsy I69t0vQV7mb0t2d+pLhEXvDPk+OaCQ2lD2nOrPz0aMGgCg8r/ez2P+dYIfEpxKh5fqfbk1zpoqw 3YvXKzSzMXDUKZQ== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add a new rtc compatible for the sun60i-a733 SoC and new IDs for the peripheral oscillator clock gates of this SoC. Signed-off-by: Jerome Brunet Acked-by: Conor Dooley Acked-by: Alexandre Belloni --- Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml | 1 + include/dt-bindings/clock/sun6i-rtc.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml b/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml index 959a012c626f..f2b91186ed37 100644 --- a/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml +++ b/Documentation/devicetree/bindings/rtc/allwinner,sun6i-a31-rtc.yaml @@ -33,6 +33,7 @@ properties: - enum: - allwinner,sun20i-d1-rtc - allwinner,sun55i-a523-rtc + - allwinner,sun60i-a733-rtc - const: allwinner,sun50i-r329-rtc reg: diff --git a/include/dt-bindings/clock/sun6i-rtc.h b/include/dt-bindings/clock/sun6i-rtc.h index 3bd3aa3d57ce..5132a393ca4b 100644 --- a/include/dt-bindings/clock/sun6i-rtc.h +++ b/include/dt-bindings/clock/sun6i-rtc.h @@ -6,5 +6,9 @@ #define CLK_OSC32K 0 #define CLK_OSC32K_FANOUT 1 #define CLK_IOSC 2 +#define CLK_HOSC_UFS 8 +#define CLK_HOSC_HDMI 9 +#define CLK_HOSC_SERDES0 10 +#define CLK_HOSC_SERDES1 11 #endif /* _DT_BINDINGS_CLK_SUN6I_RTC_H_ */ From patchwork Thu Jul 2 08:10:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2505 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id C8B5B1C3FF9 for ; Thu, 2 Jul 2026 10:14:17 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24062-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24062-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id C41553038138 for ; Thu, 2 Jul 2026 08:11:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 312B44218AE; Thu, 2 Jul 2026 08:10:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="exv5dv3j" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6FE53420E93 for ; Thu, 2 Jul 2026 08:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979853; cv=none; b=ABNuytGqSID7CHOjmayKwtUQ1+rfDxiL+aj6sJmXYHahv4OLTZnAGL/AE6q0wXYEnTVkVGCFp3JHLZNeRZ5Vp7EA8boPc7xvwiW5D006YDh8pvz9M45Y9rwtWSA4w6TfbyBBWtYkMeq8D/Q7eInlZ29GRCK4xIn4XEYBQcppGjA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979853; c=relaxed/simple; bh=xEow9YFv9tWxKuTGRmYBanqZYgnlQCz+XPTruWbAxlY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SZz4qh7bV4/bDeNravyVx4n2d2TfJn9HN1/++DzyI8KpKzKGl2flcNyqwjbCAkTblgZIfNOPiST22p70Uh8KE8jd8xlh/2fQY1x5pFJRVST/sp4LpS3KPRXf96R+eV1cVLBW7Icob0gANJ7aj1iDPT0npf3dpS/WJrNIR2trX9c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=exv5dv3j; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-493c2b3dc8bso8991815e9.2 for ; Thu, 02 Jul 2026 01:10:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979850; x=1783584650; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=n4DUzlDYde7+nlA7K6gg98zrSYXmo4pVwxHlPtRIQOc=; b=exv5dv3jYNcpALyZS750XR6WAdBdy7+X9Ihzl6QjNJB3ub9je78fA2emuQuw0lJd1g hqjiYVYgVqoAhjYBzm2lnm1oygcA5MZh4BtMBwRhn2AVhCr7s7ML7deSm8PPNG6EGrJf tw3NRRGUYmXOKUOMLKDig53SpcFUWMH0BorXSlMphriRxrjH3/owmy/FPCj9vei1ORyK N3vqHZKBLCHy8nvTFtVpu6VS7MpIopnyRkQYqAhyywDvBJKMlGu4/Fe5P7QVdFAL+HIQ sJ2vwGjm9mL/5bLFX9x3krPe1gmku7Tu5/d3mqEvNSqfI4lQQ3Jw5jGqYGCr5Sbl8cxI cirw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979850; x=1783584650; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=n4DUzlDYde7+nlA7K6gg98zrSYXmo4pVwxHlPtRIQOc=; b=l1sdqQj4Pp+RNYh2mEIscXkVC2mULF6/MwLiuIcLV1BNURGqsytYCQOmBfJcvGul8e tx5BfmcEvFbIl0kqZ+dml2fl5B8wpmDz6esg1wMaWIwiAh8Ergb4vP43DRts74wAzTmX Iy3n4N47dEP8KIfUtcRuloVkNE6kGXI3l77D6Kafg9A6T5CfzHfd6RwZ/WlWQ88otSyA jNy948+9IQVu5NkRVZJuNEZH7rDYg+n32c84MQsMljgGtvbZ/gXR6Wa346mpGjDccWEC 83RCaQtm08O9ibLODrpC2SehvjXWXB0v5XRdu5JEFvHd7xNNsObiBbS9CgodQ2B6cGAr B5Tw== X-Forwarded-Encrypted: i=1; AFNElJ/p7NeA3rSuFpwDBSPdHmzn4usq96cw9gjEFSO9pbcaoO66yojq7S8zdwVrbcX4AmL9WLQ+eIlEgzTsLw==@lists.linux.dev X-Gm-Message-State: AOJu0Yw3CvNzAiJKV7GirHYDujNfnJdoglH9PA9FKOhrFn0zTO3WTy9n pnsR+ZV+mAlhbyFOP7r3SWDKPIlZ7Fap15kmYn/Acy0mJ9kFRoIBUPXE47U3xrAb4UY= X-Gm-Gg: AfdE7clQyHjoGxMjKNI3GdbKsKErdr6qwCbMxW2jfzytlVoFwweYgTxnOislai3eIfC wrah/T0u2MgisaDPhuKVjEJ1Q/PPEAfb4fyRwtv+nBbG7WHwyTIQtJof1iCd5Z/EpyNUzFrc/hL Lfy0jMWSyXMOVKgtSev04QJ1D5IjDqIm/eRE68b3qQNNwxkjFLYc40AMBLeni2CLsOuLUDMlqe+ XyyEfIG/nTz/1cviIgvPV6WOOu0max0u7tGgfOEJYhGOw/ZMghXbdmEw9XpxLnJ9hYQMRKTsW2I 3rG0fSgq+/fYZLZkEqpi+R9qjepN8cPwBqNfwGek9CC+PLxsK0MBpjoVA/VFqY36bDkvExK/Lxb cYC8/oD4AEOtniL4zjyzuww/VhZ8sOze7fNXhydtm3oZ/RSAz8zvh9E3Cnhb/PudRA8QhSyXeDZ tSeb8Pp8SYgY0= X-Received: by 2002:a05:600c:4ba1:b0:493:af56:8e64 with SMTP id 5b1f17b1804b1-493c2b9e74fmr46177105e9.32.1782979849885; Thu, 02 Jul 2026 01:10:49 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493c636ea60sm26008745e9.3.2026.07.02.01.10.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:49 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:02 +0200 Subject: [PATCH v3 3/8] clk: sunxi-ng: fix ccu probe clock unregister on error Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-3-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Sashiko , Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2127; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=xEow9YFv9tWxKuTGRmYBanqZYgnlQCz+XPTruWbAxlY=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz4y0UzWpG2vq9pNsBeXNaVPQAXpCwoH/CqF 5UKSr9tabGJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc+AAKCRDm/A8cN/La heBcEACG7fRdAKaggYdYW+Kmy5AukfFGo0WDxvZitKeqqERRluPiowtv+fiW72Eh+xmI6rB88xT A9NgJkcYyLsMKEa30ZOg6paZS/e1Wyfg3apNWs04HXG/SCHZ1TO5FUrXxjDAynwHEvOprtof54n ZLep4U6cVL48VOhgvX+nqF5WLDhVSQbK1jnIVR2kaMNj7a/240tzf/mAmrrUKOJMVH5qzNP1+qZ /PR38HOQLqe+7u8mM3QBRDraZ2jCio4OxQy1IgVN5hXCEXCiCf2FmN+bmfZ/jcJNZlBJ9GPgz4W G8PAZ3AvDVIcT8KAtgqJ2tCqZ3yeKPrXB28FAJc+40ocBqjJBa+LUWI+KqyRQe014Xyl/FMvbSf gQ3jd+LBj+Rzu0p6SMgkS1qdOhtsYBT3FX4LMuKFGeU66/pWtS8JorozPyetUsdhu1jVEafMysx EAdBUqHexlFlrIaiRITCK2q72pAO87AEBno0EjyJp50T3JM+X3TuZ3Q5DxPQeiLA6go+cc8p3yn w5SNHC+GNWQK3GXnqjK5KaUQkw0IJu/QZIk+UadfkrPS8A6qY8+MmDPytdCqXoXBn5SzIHQ6uGI lr7rCwIHXbb0Zb9O2YfDG2T/vooP48C9zFfsO9fx6pXw5qjqEWU64yAokgm1wxnnYPZJjKY4a5s LgBFgUmnX/HASMQ== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= When registering clocks with sunxi_ccu_probe(), the number of ccu_clocks and the number of hw clocks might be different, eventhough they usually are the same. If they are different, it could lead to out-of-bound access or registered clock left behind on error. Use a different variable when iterating on hw clocks so every registered clock, and only those, gets unregistered on error. Reported-by: Sashiko Closes: https://lore.kernel.org/r/20260629131254.7E34C1F00A3A@smtp.kernel.org Signed-off-by: Jerome Brunet Reviewed-by: Chen-Yu Tsai --- drivers/clk/sunxi-ng/ccu_common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu_common.c b/drivers/clk/sunxi-ng/ccu_common.c index 1c083b4d0b7e..43d8eca6abee 100644 --- a/drivers/clk/sunxi-ng/ccu_common.c +++ b/drivers/clk/sunxi-ng/ccu_common.c @@ -114,7 +114,7 @@ static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev, const struct sunxi_ccu_desc *desc) { struct ccu_reset *reset; - int i, ret; + int i, j, ret; ccu->desc = desc; @@ -130,8 +130,8 @@ static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev, cclk->lock = &ccu->lock; } - for (i = 0; i < desc->hw_clks->num ; i++) { - struct clk_hw *hw = desc->hw_clks->hws[i]; + for (j = 0; j < desc->hw_clks->num ; j++) { + struct clk_hw *hw = desc->hw_clks->hws[j]; const char *name; if (!hw) @@ -143,7 +143,7 @@ static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev, else ret = of_clk_hw_register(node, hw); if (ret) { - pr_err("Couldn't register clock %d - %s\n", i, name); + pr_err("Couldn't register clock %d - %s\n", j, name); goto err_clk_unreg; } } @@ -186,8 +186,8 @@ static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev, err_del_provider: of_clk_del_provider(node); err_clk_unreg: - while (--i >= 0) { - struct clk_hw *hw = desc->hw_clks->hws[i]; + while (--j >= 0) { + struct clk_hw *hw = desc->hw_clks->hws[j]; if (!hw) continue; From patchwork Thu Jul 2 08:10:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2507 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 74EE91C0929 for ; Thu, 2 Jul 2026 10:16:45 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24063-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24063-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id 0EDC1303D831 for ; Thu, 2 Jul 2026 08:11:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5DA39421EF4; Thu, 2 Jul 2026 08:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="XUIXw+lI" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 954874219F7 for ; Thu, 2 Jul 2026 08:10:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979856; cv=none; b=lM50+UrZpZsWTVrop8q6Kx8k488+yubBi/DIqjICo3CYnsXijQVVbxpeRxf1hsAiiDkHoS1XM22qo/9ZufF815G1QeiN26a23OFIk0Cide4Ivbo3ErpdP0XOW2qtpudrQsyriQJ55KPyZFivYzJAHkzQWzdy6CCJHzNyTGatW8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979856; c=relaxed/simple; bh=0uBL/FtS3qxYddEpWPm85zwv8RTdX1Kl9yqgj170ams=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HwACRKdEI3nh0iY15aNlJu6SUjtj1KFTlqPZwp1350cHZvqML/bXdhtZMYnHcipTMRlXWujwrZUiIVtNFRl+kduMPnEx0DL2zgpFdMmhDmKmG1+5smOueX07w4Vsb/r4S0D1UHTozrzf//a20P/RHXIF4e2SIbQ/mk2RoKG/kw0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=XUIXw+lI; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-493c2c0b9a8so9730565e9.1 for ; Thu, 02 Jul 2026 01:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979853; x=1783584653; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=1QZ/tzJaIkMNpKGsZtD20B+8zLkYYTOKlJtJuY0qjaA=; b=XUIXw+lIbD4nzV6ylqz9xvWEoh4cJZ3P8VuwBjK0GLptShvTZkYZd7C2EqtNCxc6LY 3SD2EGY0lEZcwu5rQak/A7XOYXAez2e+Ct4uJ/jLSWKO1YQtp8CW1as6hoWdyvQ697Lv gk9HkffHut+lWO8VkqdvcfvitTk83QEZvC4fI9dK3TbOTpH1Z9ngEw89oqSgkjqG74Lr 0NoykHPxtui5eOeaobcGbOcG1u2QaEpYXJEoKE5ReMJ5AvyNQP3/RwOz20hpfvDh3loR StiQRI4zfqkM13YOz16t3ecPkbtYJwRk98nJ8h8fZuApez2aMC9esO/Afa4p+iwBUHsN uA8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979853; x=1783584653; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=1QZ/tzJaIkMNpKGsZtD20B+8zLkYYTOKlJtJuY0qjaA=; b=bs3KNxun7HwWq+WE1mqT9afIe5ou8nYCflTZlCI6PftnCiQJyFoW2g0b1HkhBfHVCa l8+AdhvImOKaimV9j/7BtUxVC/Z0PsrWpNFvuk0Yf1T17q2Ik74N/YwnDLfZSMFABN1c VGR0OdFtMfu1twfE9piGlBV6XByxXofIJctOSqSR4PMsnm5UzNy8t0c4qC+vtGJzbBuS gZamYKdENiutiHIZJNUmAE4kWTB/qgr0GLFIDnKGc/gas49KpeULs/K/Xc23z9lwM9Pc DdStdoda9aUiUv/4liwMqJ0bMDO3dbvLgF7fMieW3mUqBqcBKSFSmbJg2PHooaoIMHho 3BHA== X-Forwarded-Encrypted: i=1; AFNElJ9FdCrXYvAacF2WK5fwePwAdSRTlJTZxJ3pCQb9EMTeKX5vT5bDsG6fevgr5nNe4d+Oq71fH4DGQxFP0w==@lists.linux.dev X-Gm-Message-State: AOJu0YyE/zH0CWsBJdlCre1nPyYonXEXyXD/1M+vrkhVcZ6nLjtMQnTq KhDZwZFDqH8dRt9DZtoYhh1/CCzlwRV7P562XjkJ5z5UcZhjWDp0/lrIQpF0oVXlmM8= X-Gm-Gg: AfdE7cm7eiPVUAH06MZWNwtHJ0fJpHxi4t3gFQ5bK3hPusjaSlJWWiA9/3uhMzWejLn BP4xvperrlzoxekk32Bb5oJ6QEcLNf5OCtaw9HEU/9AXqsr33jtThonZFhMQkHCSz9jf9cBeU0p TBhZOJWTWloSXckn0dOH025dksxro86ECBgjRaOBHfwoQPAlINl0gl8T5W1KGGidwm7rFOtwhmq gUm+ECJZTxRWJa3nv0NS/lQNKlgFOPn2exhp2z8WycKswEPUsHxJMM98BI28J+3dHFxXyauwLyu wzEWxUkzgaye3tMHw4Pf5TBpTSj4jSk13XGdj6RyBqgn+zVtC2/+JeVYtK4rZ657g2SfHbmcH4U WkLvHsk1CXAoZ9lrSvFhsNAw75cscDfia2B4CmOjL0FyAeLXv8PViC4NZV8jJZ7J0tkk3kLVLpm isYtAKXHsgBkU= X-Received: by 2002:a05:600c:a4b:b0:493:bef8:ba8 with SMTP id 5b1f17b1804b1-493c3dfc635mr53639805e9.39.1782979852907; Thu, 02 Jul 2026 01:10:52 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493bfe7427dsm70001875e9.2.2026.07.02.01.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:51 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:03 +0200 Subject: [PATCH v3 4/8] clk: sunxi-ng: sun6i-rtc: clean up DT usage Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-4-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2679; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=0uBL/FtS3qxYddEpWPm85zwv8RTdX1Kl9yqgj170ams=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz5uKxhDHKubvZxQtlYpXYIvwPrXCLC0seV1 WNDhZX/FeWJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc+QAKCRDm/A8cN/La hUh9EACSTxeO/WGvg3k425s7xQALo9JT+meGwuevXCEpXNGpfJmYnCeWBOdYw76IaUfLZz8piWu fiie9pcLKv1IbGsRhzkUQ7XXb+AWMbWYTy18NjnDAw3JR02bSjqY31qrNTtj82Ih153RgolV+R3 GGRtx8Uz1+F/a/RDy5GWAInXgSjazJtka1+8wQIXbpx6Tb4fnXXhUEsROIJlCGLx+GYAGM2Jo6N Yb/OBdqgFyOez1K4IgYerUPByqDRq9jRpN0FOR436buNMnAT+gAt7crVCsKOTHpE1TEkTqmbvUs abVPh1Xlf0XYjv/t8Pu9E/jCgA2illPyEo2OHZWAqfDexBOATbzlUJHAIiMOGrHEIGgipt81JtU dC1hmgoUzL1fkDvnkbwya7VSwPMtCYVTLNAvvPNu+UPq76zDxvG5xNmJGbJaAdFp/nZShjy2l1x KaBHVbcJxomgjd7eHdzdAaygeCz1OFPyd2iSNaTPCme9xFnKGDbC07oxPyYMsWHz807sGzm8lbE P8Z2fu5YN0DeEEZvIcTDYh5B7kTyjcpDYeYF7tPnQXGnnJ5aihpkIZMs1R1IPavzLOosR+BAXzm VU84Lp4KFojc8TShzVyouOFSlPDx9zE8qRCNN14oHHIJb6hMwcqlSMXGCMk09BFbGUt8yq0HLrL vPhFA0vSiaoyD0Q== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= With sun6i-rtc compatible devices, the "ext-osc32k" clock input is optional for the devices that support this input (r329 and onward). Probably preparing for older SoC support, the driver does something funny when parsing DT. It check if "ext-osc32k" is present in the clock-names and if it is not, it uses the first clock as "ext-osc32k". This clock will actually be the rtc bus clock so what the driver does is wrong. At the moment, the driver does not support the older SoCs that would have an external 32k clock provided on index #0 so just remove this quirk. Reviewed-by: Chen-Yu Tsai Signed-off-by: Jerome Brunet --- drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c index f6bfeba009e8..0f528bfaed00 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c @@ -191,10 +191,8 @@ static struct ccu_common iosc_32k_clk = { CLK_GET_RATE_NOCACHE), }; -static const struct clk_hw *ext_osc32k[] = { NULL }; /* updated during probe */ - -static SUNXI_CCU_GATE_HWS(ext_osc32k_gate_clk, "ext-osc32k-gate", - ext_osc32k, 0x0, BIT(4), 0); +static SUNXI_CCU_GATE_FW(ext_osc32k_gate_clk, "ext-osc32k-gate", + "ext-osc32k", 0x0, BIT(4), 0); static const struct clk_hw *osc32k_parents[] = { &iosc_32k_clk.hw, @@ -352,7 +350,6 @@ MODULE_DEVICE_TABLE(of, sun6i_rtc_ccu_match); int sun6i_rtc_ccu_probe(struct device *dev, void __iomem *reg) { const struct sun6i_rtc_match_data *data; - struct clk *ext_osc32k_clk = NULL; const struct of_device_id *match; /* This driver is only used for newer variants of the hardware. */ @@ -363,21 +360,7 @@ int sun6i_rtc_ccu_probe(struct device *dev, void __iomem *reg) data = match->data; have_iosc_calibration = data->have_iosc_calibration; - if (data->have_ext_osc32k) { - const char *fw_name; - - /* ext-osc32k was the only input clock in the old binding. */ - fw_name = of_property_present(dev->of_node, "clock-names") - ? "ext-osc32k" : NULL; - ext_osc32k_clk = devm_clk_get_optional(dev, fw_name); - if (IS_ERR(ext_osc32k_clk)) - return PTR_ERR(ext_osc32k_clk); - } - - if (ext_osc32k_clk) { - /* Link ext-osc32k-gate to its parent. */ - *ext_osc32k = __clk_get_hw(ext_osc32k_clk); - } else { + if (!data->have_ext_osc32k) { /* ext-osc32k-gate is an orphan, so do not register it. */ sun6i_rtc_ccu_hw_clks.hws[CLK_EXT_OSC32K_GATE] = NULL; osc32k_init_data.num_parents = 1; From patchwork Thu Jul 2 08:10:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2508 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id 6CE291C0929 for ; Thu, 2 Jul 2026 10:17:02 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24064-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24064-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id A53F630407CA for ; Thu, 2 Jul 2026 08:11:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47A544229AD; Thu, 2 Jul 2026 08:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="Qw3o6mtm" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926AE4189AB for ; Thu, 2 Jul 2026 08:10:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979858; cv=none; b=ETdBD6HgqH0mU6SIO+tbLSl6KPLomXcipWIh9HMGWDFpomZWCyUBLGuTecaKvqknZSnbzx/4zK102w0vzcVUZ9FPW+xBbwZqnvfcXPS/PlLe2yzUl3J9T9G7L9cK83x2jtBkK6MgbpGyCFIgXvrrzZKkGg1VIBxdcDqO9y+UCk4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979858; c=relaxed/simple; bh=gRy0cN4LadJrCLwhwvNgyXM95hAtl0BkbsLdjuQgW6A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S1CgAqETGNJ2HrnQOTYCYlhuaMj+sRfCyKHomqLly48m5sVfnqt9KZgvsbBwJFCATjdUtt3uZp2mLwVX8as+WCtmQsxaoo2ubEwrc2PSVeOSVD7uk5+Q3cKaugqmnxCQOv+1J9gg2y7qxYJCZaorua9Ls+7lB9qLrTyIOctdeQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=Qw3o6mtm; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4758bd3731bso218352f8f.0 for ; Thu, 02 Jul 2026 01:10:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979855; x=1783584655; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=gpZvamYw9AnVrZnk1GFQEFXSHxgLU3wS0Rp+AMjlVD0=; b=Qw3o6mtmV6/4bWs+Zw85BPuPIxYEyLY9WUzw7R8Ae1eKUDT2GQo1wkYB4FRv/YcpId fyY9dzU1N7jjxi5ZYXVK/gfaKPzPciGGmJM3adTAernQDFbXSuXPYFCvOWg+yOXRTnEL tJoELtryM1B4p/gRSFuBM/xgZCAmm8Tz8bu/MeFy5lsR3n8/nEfsGJf/bGmKR43rEwiR k8Sb83Zr4LlBXgJUjv6Uqu+/kypqgNJ936CSEwyr/cBVzTZjulkAUpKbLpI9obgqKGRr v05b+6qFTWUBn7MKDw2QGAVjkQvY7f1m6Zk4d1ZM0CANQTs+MR2/pKXXqicda9IBZJ0k Locg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979855; x=1783584655; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gpZvamYw9AnVrZnk1GFQEFXSHxgLU3wS0Rp+AMjlVD0=; b=STFrigZ2U2Sb818Sdryl34wxsPsBp6jgSxD0ECkOUWQRVkqjUAJ2F2eSArbJ4cILpc a2V+Dw6bzVby3Q47RLYpHeEj+RWKo9gP1gngcBxJiM9m5Gkd4Jh/MQ8R0IGTOH6U6AR2 Tr+XH3EUQesZMdDDQcpctrY7wWNcRZJpmHu+yue0jf613y+MOa4Cz55axMwSp46FBfQg PweRMbr6A3opSjrvrb8XX4ewwAvmcV1GM+1gQ2m1oj1F96/U76vwY+YdyE6C2Lk+PHUv 0bYmtHQJ0/5ipcLkM24Hh8bt1OzQfvPC5dxHVVSHXkIMTXcfcFiuL+fqniN4rRXmVXT6 /0WA== X-Forwarded-Encrypted: i=1; AHgh+RroejBfsN0ovl40FUuYd53npjAP/4MAr8EgiU3tmPQLc5m8L2WUEShE21zW8Z9bvUkzHgdbIVbjTp1ivA==@lists.linux.dev X-Gm-Message-State: AOJu0YwijosjEul4+GYfMJ0Qvz4TkeYdqD5Bu+Tmz7ZcxedhFZDrpa0/ e4QopoY8wE0L8b2HEM0vOhLrjUWS54Y9fGu5VB5T1knmt2vS6rcOdJNhwBwWn8VR0zc= X-Gm-Gg: AfdE7cnZiZt7Q7bzrUd4sDKrEOu/VT4N2oOV/ZGVgxTSg6b/acfyb9VCGNvdP2I1n1D MSB9dnBd4mpmmuMp7KArQ9Ka6WaOdChl1UQ72mw2NbarOnLoa8XkA9O6rQPdl4N9gna6nUM0FGS Yk70XRBNJItMsm8M4dMB4dPFJtmkvwfDc8iPLnsyw2WSlzDF3ikBxc5AAHFGC/JKA/tI78LZQkx p4IMHP4valvI/38bKiDbPY911+8UMKaNbLS/0Zi73cgkZHg78e2MeSv/1TujeYKTfBpex9yMN1l yHrFKTczfZzD7WaRg+obtsM/Aeuk0rpJUh/be8ydNku8nhi+R6AAK9m/plakRgfuwIPI5Wdg69p x1x2sW34WvZEjd/G9MSkFg9i7Z0pOAqqVU/qx+xlpaacE582UpKNJh/CS7CewYsXpQCiz/xtBJQ HmgKCpoQAfu6M= X-Received: by 2002:a05:6000:40ce:b0:473:c2ec:7a79 with SMTP id ffacd0b85a97d-4774424350cmr7132004f8f.12.1782979855094; Thu, 02 Jul 2026 01:10:55 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-477db3dba3csm6687967f8f.3.2026.07.02.01.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:54 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:04 +0200 Subject: [PATCH v3 5/8] clk: sunxi-ng: sun6i-rtc: Add feature bit for IOSC calibration Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-5-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3560; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=LjKLqtELI/k5Bm86qG39EiNLmLLQg2pvRCFKcypyAtM=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz6iQ4ImmQHndHiBUqhJRQYIbF2ssh6u4zet LAX/Wa+q56JAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc+gAKCRDm/A8cN/La hevvEACvUM3ca8OwIt1oufqC2tSNAYGaxdWOw46j08bNcil+NPfmr/5Af1LlNbH/cnK2mvD9i17 uhUOtHab6h+C5k9mFrYY1/iEpNmMfiAqNP9b/SiohQo4XXQ7vH9aCSJwWzZAlrArxDjOkodWaUc h88RZxUvA7mpw29FBOGQWAxNpADzCWGUspkbA8rAQRvm8euwYNVi7o/O/eqFeiyK5NHr1BWiZjK qHzdkatztZ1pM4D298w9UADjl6bwZ/dDwaRXP5VQp1nZW8W8YDaCjG7yS+RO7IomoAJgRApUaRZ fCv2H2xgcSB9tIG2M6bbAzlbJe9oHGE8VwmGCk4XO2n42566JCVwypwJDkjpELB7bHudEQpOe0N KAlOo18K8PAcZ5uZNFnxWTOZXeiYLXjOxPAUdCpyQm7RyTZ7oXKsm2oT5k8painM4yMkDUXnRVB T03tesm9gVdVWILE+46J+kE4sOjXiNG1Pp2Rw1TPyVPSHfgQ0dFqutz5HsYLHOAQYgz67YjOXfU pzBqi+eTBeBslVZK09E9N6D9jQjjoLPsCuxdb87P8ml5T5tLNLxjNmQtkhUUGOERDfIenO571u8 S/AJZCLIex6hlXowPOaM5FRdQFsxE2H3MNvMuOYOZfpG14rbnirk8o1Ip4YH603HjyOic3M3jSz A40fFvy4QCn3l1A== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= From: Junhui Liu The sun6i-rtc CCU driver currently uses a global static variable to denote whether calibration is supported, which makes IOSC operations tightly coupled to this file. Convert this into a feature bit to decouple the logic. This allows the IOSC clock code to be moved into a shared module for reuse by other SoCs. Signed-off-by: Junhui Liu Reviewed-by: Chen-Yu Tsai Signed-off-by: Jerome Brunet --- drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 17 +++++++++-------- drivers/clk/sunxi-ng/ccu_common.h | 1 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c index 0f528bfaed00..b24c8b196e66 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c @@ -52,8 +52,6 @@ struct sun6i_rtc_match_data { u8 osc32k_fanout_nparents; }; -static bool have_iosc_calibration; - static int ccu_iosc_enable(struct clk_hw *hw) { struct ccu_common *cm = hw_to_ccu_common(hw); @@ -80,7 +78,7 @@ static unsigned long ccu_iosc_recalc_rate(struct clk_hw *hw, { struct ccu_common *cm = hw_to_ccu_common(hw); - if (have_iosc_calibration) { + if (cm->features & CCU_FEATURE_IOSC_CALIBRATION) { u32 reg = readl(cm->base + IOSC_CLK_CALI_REG); /* @@ -119,7 +117,7 @@ static int ccu_iosc_32k_prepare(struct clk_hw *hw) struct ccu_common *cm = hw_to_ccu_common(hw); u32 val; - if (!have_iosc_calibration) + if (!(cm->features & CCU_FEATURE_IOSC_CALIBRATION)) return 0; val = readl(cm->base + IOSC_CLK_CALI_REG); @@ -134,7 +132,7 @@ static void ccu_iosc_32k_unprepare(struct clk_hw *hw) struct ccu_common *cm = hw_to_ccu_common(hw); u32 val; - if (!have_iosc_calibration) + if (!(cm->features & CCU_FEATURE_IOSC_CALIBRATION)) return; val = readl(cm->base + IOSC_CLK_CALI_REG); @@ -148,7 +146,7 @@ static unsigned long ccu_iosc_32k_recalc_rate(struct clk_hw *hw, struct ccu_common *cm = hw_to_ccu_common(hw); u32 val; - if (have_iosc_calibration) { + if (cm->features & CCU_FEATURE_IOSC_CALIBRATION) { val = readl(cm->base + IOSC_CLK_CALI_REG); /* Assume the calibrated 32k clock is accurate. */ @@ -167,7 +165,7 @@ static unsigned long ccu_iosc_32k_recalc_accuracy(struct clk_hw *hw, struct ccu_common *cm = hw_to_ccu_common(hw); u32 val; - if (have_iosc_calibration) { + if (cm->features & CCU_FEATURE_IOSC_CALIBRATION) { val = readl(cm->base + IOSC_CLK_CALI_REG); /* Assume the calibrated 32k clock is accurate. */ @@ -358,7 +356,10 @@ int sun6i_rtc_ccu_probe(struct device *dev, void __iomem *reg) return 0; data = match->data; - have_iosc_calibration = data->have_iosc_calibration; + if (data->have_iosc_calibration) { + iosc_clk.features |= CCU_FEATURE_IOSC_CALIBRATION; + iosc_32k_clk.features |= CCU_FEATURE_IOSC_CALIBRATION; + } if (!data->have_ext_osc32k) { /* ext-osc32k-gate is an orphan, so do not register it. */ diff --git a/drivers/clk/sunxi-ng/ccu_common.h b/drivers/clk/sunxi-ng/ccu_common.h index bbec283b9d99..d9dc24ad5503 100644 --- a/drivers/clk/sunxi-ng/ccu_common.h +++ b/drivers/clk/sunxi-ng/ccu_common.h @@ -21,6 +21,7 @@ #define CCU_FEATURE_CLOSEST_RATE BIT(9) #define CCU_FEATURE_DUAL_DIV BIT(10) #define CCU_FEATURE_UPDATE_BIT BIT(11) +#define CCU_FEATURE_IOSC_CALIBRATION BIT(12) /* MMC timing mode switch bit */ #define CCU_MMC_NEW_TIMING_MODE BIT(30) From patchwork Thu Jul 2 08:10:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2511 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4]) by mxe881.netcup.net (Postfix) with ESMTPS id 763FD1C0929 for ; Thu, 2 Jul 2026 10:19:35 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 104.64.211.4) smtp.mailfrom=linux-sunxi+bounces-24065-noreply=patchwork.local@lists.linux.dev smtp.helo=sin.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 104.64.211.4 as permitted sender) client-ip=104.64.211.4; envelope-from=linux-sunxi+bounces-24065-noreply=patchwork.local@lists.linux.dev; helo=sin.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sin.lore.kernel.org (Postfix) with ESMTP id 48894304C964 for ; Thu, 2 Jul 2026 08:11:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A27DC4229D0; Thu, 2 Jul 2026 08:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="ndc9HbB1" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CF1D64229C3 for ; Thu, 2 Jul 2026 08:10:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979860; cv=none; b=Zu5MzxWC8md8Tz2KGws7Fi3CUXeUP43O1zvHrX7wWtg4GvIquuSfZAsus8CKa/PAOeoM6Os91kTv8eulCsE1FkccYZuMoNd+MuXtBNCgGyjz9mfHZzpikqhAEMeIV84+GYkUt83gKn02rGPqZ+XXh2SYMtWz7jZ7+GMDWYD5i+c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979860; c=relaxed/simple; bh=2L2d0QfPA9w8m9zLHFuDIP+92mtPVG6eY7jP2BAgsNc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Yap+5qylRNDoRQZyplZLYjWNzRSC3xa1yIzbAv+bSKZ6O84WNkBh5Sa98F2Lw0yYVRQD34FnqH9+ByWNKwPSDmg8BO4yrSss4T0NUUXlMEd8EX9GwlMWLzLT+YceKm21l6MsW4Z/YQh1U2Fo+ZdUXGRSgRGkkmfcNr9vMxM5vkk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=ndc9HbB1; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-493c733f15aso1824285e9.0 for ; Thu, 02 Jul 2026 01:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979857; x=1783584657; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=zMIl1Eh3yVsZrdBP1XorCdcYvGVBjprl7wt0TiPGGoE=; b=ndc9HbB1fDrMrHJvRMnXszIfE78caBwUy6SyQK4a+oZf13BaOvsziFzAoZtqfy2WWB H4emHX+chOgPUkEYCc7+xDkT3xaLy1JfMznSZhUaikoJgLVxcSTY2X0m+1vnAnkHYF0i dTStyf6xaNjA/53si0Xsa+qVxpNgq92YCEIiBjyln2BC75NnQCz21wwNypbY6WlBq1kl kw0R2dYkmXFK3OKDOm4NAyIGzZc6F74ECfeHiyf4sOpa2vC6fnEJt3SgMvyQw5Z6b2w6 aKkT5pvhzd7pTINdcPXeZaIzwsSi8G/IrqRS7wO93L7+XHZKT6isbe7Xqhk8EWs0Yk/r Vwww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979857; x=1783584657; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=zMIl1Eh3yVsZrdBP1XorCdcYvGVBjprl7wt0TiPGGoE=; b=iqIsrF707Dd/pBPYU6zqOCjzwE4JBDWFtLKqecCknPt63VukO9EVWz9GRcPb7EMnhW UQlqZ50PHA9B/R+Mg0aowIexItnn1K3cf/ibqaGyIQ7kvnZuXfsxv+X+8oW9/A+83C2J +IHueL/KhGpqMVSn4SZ8aeDZ0aUW044lP4PeWb0PgSGlobBaj0I0RkAlP38kxP3qOIYb aPFmuGKKq2+ANXtv7V2tv7XJmVdRZSZbDhWCAHDXKlG6ofClB25Wp0oJ7fBnvMJ16sGS 3aGH8K8blOPMPMX73Qw0M265fadsBQi4PQhTDELEp1ZbJ6jh+2UvGwD/DXWZmweuCeRU H12w== X-Forwarded-Encrypted: i=1; AFNElJ8JqRQhFftIWE3fg/n1VfQSIAvh4wXhKMzcnF+RfarISfITmLmSR+Se5sMGhsbANofOsz8NckM1nof7DQ==@lists.linux.dev X-Gm-Message-State: AOJu0YwmAUBd8DJn40Lv/tJxPOrKIV6MGodr/G0wVZ3qiEQSRvQ0qxZv U94OSG8D/6/uVLUJ9qph/Gelz8z/7iMeJ8Mebx1U/9nWe6m8pNYke1OyYmdxNwoV6s4= X-Gm-Gg: AfdE7cl7Mx2m1wbylUZMWbKb/CfsMfH31zlQvMPTHpndGtILRNMOgNXAGQkvbigFiBg 01LLfpo3IFRp17DtRJCGuEtfQqIXzTrac7iU60erVMMdmgcvrbs1n8Dy4TI/21qo51WkGRrhc4X Kz8N5Ul9ZPUu7UB4AJH91TrerOQtB+tHV1Mw6nNWLal2h8mu3FlhkzaO89dFCfz8Wker06m9P4P MKAgm2Sh/d4JS7YK9L3opHB9NrBKu8CufStW5j1x1/kL8wWPc+4dAd93pKuWExHUSM1B89qZ5oB lyoTfdivyXyGlStdI3xu6GvzdTOYMWKgop4VmQIs+j2b2IBWQQa22XTsHMJBrzjPDUuM7emvAtu 53cKHVk8sBYl3jMP8IgWgqZWpsftrnqhdkUIf+4nZUIfDgAIY80vxe89v7kAhc6G+mIy+PCyEy1 DGeMzJrXDlcr0= X-Received: by 2002:a05:600c:3e15:b0:493:a8ff:d7af with SMTP id 5b1f17b1804b1-493c2b15c9bmr72077075e9.4.1782979857187; Thu, 02 Jul 2026 01:10:57 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493c6354771sm29596785e9.3.2026.07.02.01.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:56 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:05 +0200 Subject: [PATCH v3 6/8] clk: sunxi-ng: div: add read-only operation support Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-6-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4152; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=2L2d0QfPA9w8m9zLHFuDIP+92mtPVG6eY7jP2BAgsNc=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz7i1ZELfjYtb5C5oSl5YLVh5u5d5JSDVFlW oxSy/mKcsyJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc+wAKCRDm/A8cN/La hXkTD/9UqEGQ7lP5+o137L4ZK0dj6r9uITACcbnFagNW8dgCdbRUU1Gkc0pqcmmiv7+UB8ntF87 o3jhmGckjY10GSP4z5O8LRX/RFDQxleFMjfojpwO36ioEKJgnSlA+lu6OQhi+g46wQnN6DtJxEr 7JlXSuU8D4pI9ZQn31jIAnknDdGuyFwCU4AyWVBFecyW+hb4MBoA2tFxwxGlNEVY/TUTXx2QY4x tYvNkf1qU8DkddNz3GUjYzAil3ORQTbsYfo2jaVBXakn+CO9BWdNsGeBhkUn4ztynpV6xy/rtuU lT79/EIarFGTxDfnY+bVcEwjofdNIiVhoX+pH7wegGNzkxeYD5ZQaBA/BkWGCtjunu01dEGyu1D qfKldcvBjqwRW6evTZxpsz4AelUn8ryl95Z5blQogwYlL0us3lXlUBIA7yXmxL5H6T/aWPctE8y 6vgieBFPI3dWAgVTtuQiLGVMCGH9oUWKi+yHa9vSDnK6YOz1MT7iOcNqkzYDdwVv4TT+9uvUGB3 DCbtmqU4H6691jYrfWWqQ1Pqet1p5g4i+mv30yFGfOlGL370t9V+6n+XWEq7wiSIbX53129CGo/ xFa0KgrvLpUNUzhv2A9ND2uuvgGDvNbpeN+kjVgK1rB2PNnhZ8gwqPB7CuvqchwTz7tb4Z1BAh6 7IchPeO7hREhSqA== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add support for sunxi-ng read-only dividers. This will be useful to the a733 oscillator detection logic. Signed-off-by: Jerome Brunet Reviewed-by: Chen-Yu Tsai --- drivers/clk/sunxi-ng/ccu_div.c | 42 ++++++++++++++++++++++++++++++++++++++++++ drivers/clk/sunxi-ng/ccu_div.h | 1 + drivers/clk/sunxi-ng/ccu_mux.c | 3 ++- drivers/clk/sunxi-ng/ccu_mux.h | 4 ++++ 4 files changed, 49 insertions(+), 1 deletion(-) diff --git a/drivers/clk/sunxi-ng/ccu_div.c b/drivers/clk/sunxi-ng/ccu_div.c index 62d680ccb524..d1c8c7baa12d 100644 --- a/drivers/clk/sunxi-ng/ccu_div.c +++ b/drivers/clk/sunxi-ng/ccu_div.c @@ -84,6 +84,36 @@ static int ccu_div_determine_rate(struct clk_hw *hw, req, ccu_div_determine_rate_helper, cd); } +static int ccu_rodiv_determine_rate(struct clk_hw *hw, + struct clk_rate_request *req) +{ + struct ccu_div *cd = hw_to_ccu_div(hw); + unsigned long val; + u32 reg; + int ret; + + reg = readl(cd->common.base + cd->common.reg); + val = reg >> cd->div.shift; + val &= (1 << cd->div.width) - 1; + + req->rate = ccu_mux_helper_unapply_prediv(&cd->common, &cd->mux, -1, + req->rate); + + if (cd->common.features & CCU_FEATURE_FIXED_POSTDIV) + req->rate *= cd->fixed_post_div; + + ret = divider_ro_determine_rate(hw, req, cd->div.table, + cd->div.width, cd->div.flags, val); + + if (cd->common.features & CCU_FEATURE_FIXED_POSTDIV) + req->rate /= cd->fixed_post_div; + + req->rate = ccu_mux_helper_apply_prediv(&cd->common, &cd->mux, -1, + req->rate); + + return ret; +} + static int ccu_div_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long parent_rate) { @@ -143,3 +173,15 @@ const struct clk_ops ccu_div_ops = { .set_rate = ccu_div_set_rate, }; EXPORT_SYMBOL_NS_GPL(ccu_div_ops, "SUNXI_CCU"); + +const struct clk_ops ccu_rodiv_ops = { + .disable = ccu_div_disable, + .enable = ccu_div_enable, + .is_enabled = ccu_div_is_enabled, + + .get_parent = ccu_div_get_parent, + + .determine_rate = ccu_rodiv_determine_rate, + .recalc_rate = ccu_div_recalc_rate, +}; +EXPORT_SYMBOL_NS_GPL(ccu_rodiv_ops, "SUNXI_CCU"); diff --git a/drivers/clk/sunxi-ng/ccu_div.h b/drivers/clk/sunxi-ng/ccu_div.h index be00b3277e97..a30a92780a05 100644 --- a/drivers/clk/sunxi-ng/ccu_div.h +++ b/drivers/clk/sunxi-ng/ccu_div.h @@ -300,5 +300,6 @@ static inline struct ccu_div *hw_to_ccu_div(struct clk_hw *hw) } extern const struct clk_ops ccu_div_ops; +extern const struct clk_ops ccu_rodiv_ops; #endif /* _CCU_DIV_H_ */ diff --git a/drivers/clk/sunxi-ng/ccu_mux.c b/drivers/clk/sunxi-ng/ccu_mux.c index 766f27cff748..e2d6833a6d33 100644 --- a/drivers/clk/sunxi-ng/ccu_mux.c +++ b/drivers/clk/sunxi-ng/ccu_mux.c @@ -68,13 +68,14 @@ unsigned long ccu_mux_helper_apply_prediv(struct ccu_common *common, } EXPORT_SYMBOL_NS_GPL(ccu_mux_helper_apply_prediv, "SUNXI_CCU"); -static unsigned long ccu_mux_helper_unapply_prediv(struct ccu_common *common, +unsigned long ccu_mux_helper_unapply_prediv(struct ccu_common *common, struct ccu_mux_internal *cm, int parent_index, unsigned long parent_rate) { return parent_rate * ccu_mux_get_prediv(common, cm, parent_index); } +EXPORT_SYMBOL_NS_GPL(ccu_mux_helper_unapply_prediv, "SUNXI_CCU"); int ccu_mux_helper_determine_rate(struct ccu_common *common, struct ccu_mux_internal *cm, diff --git a/drivers/clk/sunxi-ng/ccu_mux.h b/drivers/clk/sunxi-ng/ccu_mux.h index c94a4bde5d01..272a2c36a8f2 100644 --- a/drivers/clk/sunxi-ng/ccu_mux.h +++ b/drivers/clk/sunxi-ng/ccu_mux.h @@ -134,6 +134,10 @@ unsigned long ccu_mux_helper_apply_prediv(struct ccu_common *common, struct ccu_mux_internal *cm, int parent_index, unsigned long parent_rate); +unsigned long ccu_mux_helper_unapply_prediv(struct ccu_common *common, + struct ccu_mux_internal *cm, + int parent_index, + unsigned long parent_rate); int ccu_mux_helper_determine_rate(struct ccu_common *common, struct ccu_mux_internal *cm, struct clk_rate_request *req, From patchwork Thu Jul 2 08:10:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2506 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id 8FC6F1C0929 for ; Thu, 2 Jul 2026 10:16:04 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-24066-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-24066-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by tor.lore.kernel.org (Postfix) with ESMTP id 73178309E4CE for ; Thu, 2 Jul 2026 08:11:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4C8B420E6F; Thu, 2 Jul 2026 08:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="aXzSD1XQ" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAE974229D5 for ; Thu, 2 Jul 2026 08:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979862; cv=none; b=iED7nrYwfgW//Vrw7so1uK4zSRtJQWjjSVXw0Xawmm69DzPWvoGQhoxzg5Rr5Mkaj/y96FTYXU+MaUobyAa8e/ubHGR4pQdTv4g6hc41FfRrdEaq0M+jKrwJsqJEXVvYdhbjzFOK82SDlp68Mj/cqJhBPPMw0T++k0cmh5l+axk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979862; c=relaxed/simple; bh=mDE5aNV7J0YTDC++0PyqpQq+1LRXe/OEq5dNJJriQq0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kpNxBPfhMnfNkaTVQcoW6UnsZgEAd4vSCBikiFqaSQLdJ0ZQLvu8QzVWmhfoXm3m8QMsTb/PRFuIb0Bvo3e/RU27mRkkL38M0knr/arrkVX+0FVgO8l7L4J2UJswKGYp9IXH/4AZDhDEic37ZzUR1CAvf97AJHk93hma7J1xGx8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=aXzSD1XQ; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-4720d22c94aso1357067f8f.1 for ; Thu, 02 Jul 2026 01:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979859; x=1783584659; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rSh1ZBRvKf6dioysT8A/x6MNdQs15mKol/PsSCRG53E=; b=aXzSD1XQ8hv9ZF8aDsNvNOuY+Kl+D+wFSlJP4G0um+tBCFSNe6wuedJcLQ25qYkYOY iDW/ozAbKDnmlMfq43UYSQ/xPFIJHku2pp/2H46L/S+L+b+5UHC5y4jT3nZE3QPzQ/pT GVw4Psv03J1sK/rx7yL11g8v9PjUd3ZlyBdeR7jQFrDPNyFn9sRY7E0Uel2eiqQD+Cc4 q6Cl5fgajvyyOjJzAsjxTetRCS/aacAV14HVunfjzQCTR1Zrkox7ybywkvgGg2aLS/t2 474Kk2VjJzpDzIWCV9/4txmKJ+Ang2zmXur1+e5dXMxIiX85iaIFjyhsklax80Op31Uj daSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979859; x=1783584659; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rSh1ZBRvKf6dioysT8A/x6MNdQs15mKol/PsSCRG53E=; b=nxfwizuyZW4Wwc7EJ4V7nRYmC7b9CvYe6N4FjpBaWAuJHroEjMNN23yZzpiqJa83A+ XgfxsSGUvusVEdbybnNdLqmUcZjwRbPFUFxnTSBe4xRnfAJ3OGGdEKC1VjiuTuGCh5Tr L2eDvel3XzmUWm3OH8ru61RgHixXoCOgFSNdQWRJh+7oaZjYbQtTrvkdSP4kc+FZnp+W Z2maMPi81ZP4Qok7wrJ8S7vfEFH9J54db+az6EX/lSRv+UG3h4/8ntxiRhd6RGIVTLV0 QFyoE58xbzOgsQfVT2tkCdG1uOBX6MuOFM9jDSrKQ+KlkHo/z8wjFOfxhhRZTyBFnnq5 Mrhg== X-Forwarded-Encrypted: i=1; AFNElJ/n2Iw5lvAA7aRv9tvxGeI3a69rfXxajslLR9k6aG9sQZenchB6L+mZAqPkDBOC3GIFnpyUYL7+tVTlJg==@lists.linux.dev X-Gm-Message-State: AOJu0YzwvMpy9oyKtmQL1iQUldqpodqGyPg2NLVFACP33D1BsswZpIJB SNGPQL9USmUM88+Vq4VuSqZVL2hKWzW93C0vsQOMFvcphnRUnVWwM9mEzO5axQr3RCc= X-Gm-Gg: AfdE7cmBshuUJy3ZfzoW9Bpivfv9icaItjU8nJkJMfS7nh4h/F1MlS9RS+0ye25WWEi hwIGFVecLEW+DsO1OsnYbkP7G5aPTPzor0bO2i/AUjNDBOEDr2KTCTh58Y3g/JEJkwOXodhjVl2 mrEOyja1NDYyDwjLguffxtDSGSVzNRWVcbGPwkcg5zQXu04x12lpF4MQy3HqwOuytCLQvaLKrOc SNnwFQnAJoqxRJTWq31zbhdgxD5cOteVVY4+XhRVy33LnOUasnul1xtig61ZP0PknYkdEGwnZuq EW0Fd4ujvSYuUq81iTh5Eu36GxlF84/5ovf+nNdhH4L0OUrd+diT3kOVXasY4ITV5LWbZfPqqOq cePAXgsGYZiAsU/9F+dfM2V+cLgJbN0dUVg+f9vwHX+oHI/cT88yPPzu/i3g2kto+0tSk1t/H+y 1CeMHgicIkTDB0N6QGWS7vfw== X-Received: by 2002:a05:600c:c046:b0:493:a8eb:5145 with SMTP id 5b1f17b1804b1-493c3cd4ac7mr42700915e9.4.1782979859299; Thu, 02 Jul 2026 01:10:59 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493c6372a31sm30759565e9.13.2026.07.02.01.10.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:10:58 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:06 +0200 Subject: [PATCH v3 7/8] clk: sunxi-ng: sun6i-rtc: split main oscillator div and gate. Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-7-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2479; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=mDE5aNV7J0YTDC++0PyqpQq+1LRXe/OEq5dNJJriQq0=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz84Va+eOo65gJ7r3N6Uf0cw5m///ZPyWWed jMOv7SogdyJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc/AAKCRDm/A8cN/La hX2JEAC0IHxsjEu2zR4yluC1t2Qb1R/L4bdk5ZB2cG6ZO54dIfcruEioVYrQy33K0Ed91Qx1xdE 60I8i6/hGKoLimMfyWJbAVqKQ29WXMVpz3nY2R/Qnv46o03/dSHRoXFaA6/lWNtZohRlcktfxh8 pz87aKnhsIc/yHVwoXXniWAT3FpyS4dWoG2odR05jydF7opAW1I76KngNaxEhoKAepZS1/2Pbd4 L6GlU6TUuzQmxSpqK6hyV/ltMo7+8DnGIjjaH5/LDcBkvUXgf6jfqqYWtetU3AALKJYIsasG+Qn eC7Ypky8gYw/34RmJ4M/vKUPr582khMcs9Xi9eOFXS1Zk9YSLncqBCPFLxkvkbLfk+E7moeGo4g k/6ux28KThwQx49b/VFGIiAxQKJej3xUtaUY/22zhSM2QKrSAcnSTnBneywFJLzOraENmnJCz/e VU257QrLk36zzQqVJcg7MvDtSK2PFYQ6yloz+IGekf1LYV5pCGljTyXowMn0U+uOAnh06SZKyuO BkF/Flqz2jcmaHNMsOvAHn7hL7P8HrAIJx4Iw8v3a+/mhvHAoq6nCKnSZ1y2BDMJpxj4qyCVYKF 2ZMJ0jLwbj6nrVsCADE2p0X9xadDN8s3baLJGDZCxm5FtiYxyB5kZCQXDcQ2LM7aR8Rh1+zAq8D 6FeMPTX8vOFg/lg== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [-2.16 / 15.00]; BAYES_HAM(-5.50)[100.00%]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; MAILLIST(-0.15)[generic]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; HAS_LIST_UNSUB(-0.01)[]; PRECEDENCE_BULK(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[baylibre.com:email,tor.lore.kernel.org:rdns,tor.lore.kernel.org:helo]; TAGGED_RCPT(0.00)[dt]; FUZZY_BLOCKED(0.00)[rspamd.com]; DMARC_NA(0.00)[baylibre.com]; RCPT_COUNT_TWELVE(0.00)[18]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc-20240116:i=1]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_TO(0.00)[pigmoral.tech,bootlin.com,kernel.org,gmail.com,sholland.org,baylibre.com]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114:c]; FORGED_SENDER_MAILLIST(0.00)[]; RCVD_TLS_LAST(0.00)[]; TAGGED_FROM(0.00)[bounces-24066-noreply=patchwork.local]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[jbrunet@baylibre.com,linux-sunxi@lists.linux.dev]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 8FC6F1C0929 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= On the a733 the "osc24M-32k" clock has the same gate bits as the previously supported SoC but a different divider implementation. Instead of a fixed 750 divider, the divider is selected based on the rate of the oscillator. It can be seen as a simple read-only divider. To easily replace the divider part depending the SoC, split the divider and gate into two separate clock entities. Signed-off-by: Jerome Brunet --- drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 20 +++++++++++--------- drivers/clk/sunxi-ng/ccu-sun6i-rtc.h | 3 ++- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c index b24c8b196e66..25dd87e78eb7 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c @@ -218,17 +218,18 @@ static const struct clk_parent_data osc24M[] = { { .fw_name = "hosc", .name = "osc24M" } }; -static struct ccu_gate osc24M_32k_clk = { - .enable = BIT(16), - .common = { - .reg = LOSC_OUT_GATING_REG, - .prediv = 750, - .features = CCU_FEATURE_ALL_PREDIV, - .hw.init = CLK_HW_INIT_PARENTS_DATA("osc24M-32k", osc24M, - &ccu_gate_ops, 0), - }, +static struct clk_fixed_factor osc24M_32k_div_clk = { + .mult = 1, + .div = 750, + .hw.init = CLK_HW_INIT_PARENTS_DATA("osc24M-32k-div", + osc24M, + &clk_fixed_factor_ops, + 0), }; +static SUNXI_CCU_GATE_HW(osc24M_32k_clk, "osc24M-32k", &osc24M_32k_div_clk.hw, + LOSC_OUT_GATING_REG, BIT(16), 0); + static const struct clk_hw *rtc_32k_parents[] = { &osc32k_clk.common.hw, &osc24M_32k_clk.common.hw @@ -286,6 +287,7 @@ static struct clk_hw_onecell_data sun6i_rtc_ccu_hw_clks = { [CLK_EXT_OSC32K_GATE] = &ext_osc32k_gate_clk.common.hw, [CLK_OSC24M_32K] = &osc24M_32k_clk.common.hw, [CLK_RTC_32K] = &rtc_32k_clk.common.hw, + [CLK_OSC24M_32K_DIV] = &osc24M_32k_div_clk.hw, }, }; diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h index 9ae821fc2599..ab7b92b47f59 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h @@ -9,7 +9,8 @@ #define CLK_EXT_OSC32K_GATE 4 #define CLK_OSC24M_32K 5 #define CLK_RTC_32K 6 +#define CLK_OSC24M_32K_DIV 7 -#define CLK_NUMBER (CLK_RTC_32K + 1) +#define CLK_NUMBER (CLK_OSC24M_32K_DIV + 1) #endif /* _CCU_SUN6I_RTC_H */ From patchwork Thu Jul 2 08:10:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 2510 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mxe881.netcup.net (Postfix) with ESMTPS id DAF7D1C0929 for ; Thu, 2 Jul 2026 10:18:25 +0200 (CEST) Authentication-Results: mxe881; dkim=pass header.d=baylibre.com; spf=pass (sender IP is 172.232.135.74) smtp.mailfrom=linux-sunxi+bounces-24067-noreply=patchwork.local@lists.linux.dev smtp.helo=sto.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.232.135.74 as permitted sender) client-ip=172.232.135.74; envelope-from=linux-sunxi+bounces-24067-noreply=patchwork.local@lists.linux.dev; helo=sto.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1]) by sto.lore.kernel.org (Postfix) with ESMTP id E4F653051544 for ; Thu, 2 Jul 2026 08:11:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDE894252B1; Thu, 2 Jul 2026 08:11:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="KX7deSTe" X-Original-To: linux-sunxi@lists.linux.dev Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DCC9420E73 for ; Thu, 2 Jul 2026 08:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979864; cv=none; b=DTTSNX0GUkkNS8ci8Xr9s2URZXLZklmXnqydk13EnF2k+b2VdswBNZyI3pU50FqAzqp8cZ4gcMCsi7YbanEZL4nYTo4LgOBPMRW86DvptOkK/syNyKEtw3W+m3oXY+JE1Aljmyqra9FyWyytPkgp+/Cxgq8KwKXDA+E7Sd9hVy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782979864; c=relaxed/simple; bh=rBendd4uuEhgkyP4RE0zkVRJMkAWDgIQr5V1OAvN0oA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fgqOFpKWbtMd1ibGYvfuA1Rju7dQMU4P7G2t9I0dBHltbJPNly5XwVqAHR4p1+MSLyAtUA84gTmAV/cMGH3srW6SAoZ5nWQW3t6oO0Zl0PROzqsonV7eMnbk7kUtsHbz5g3ZD2QwI7Cy/gzmfCB47w2I8LCAAqLSo+VLd2cp1Ec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=KX7deSTe; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-493c2b3dc8bso8993225e9.2 for ; Thu, 02 Jul 2026 01:11:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1782979861; x=1783584661; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=9owqjjgV0H2CtePOueZPc6abek2AjkJLNAZcj3bC1qU=; b=KX7deSTex/+TXLRRLeK8mbWKzCBUNqQrydQRhZqhfoWCeE22LvSfhWAuw+Fuptc63h PkU0pqrlqV3bbuRxBRV2wX8PDZ3LqLuuQ0H7sfxMLezRK6weomvEELICQvVhEFD4kyX7 SRFhwq3mK+QVWUi3zilzVYwqfR1yOQh+bBj/m+0AWl8GXs8qv6qXyNXFaDQD/zzKuexk 10j5A3IzGvOMgzSvIftYoTZG0wDT0iuDMlpyAJ9pI4ipw2oWpFUE2WSuLZBNU6F0/V2m p8OHwwYbykdAkFrNyMSwkDQS36GpEeBZCEHN9nm/F+0RR/CTWqchhROJKQRGIyB3y1Vq a5fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782979861; x=1783584661; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9owqjjgV0H2CtePOueZPc6abek2AjkJLNAZcj3bC1qU=; b=szKyDD2HGAluDHdtJWx856HohEMP82qwhjSyYS05lea7Sa+4gavpijMJNpyYt8cqAn OOv04ZPNR5yJkvxk00df4YvbOXAfx99jxKQVJ2RGuExoxIGTOyhTJGH5W2LIUClL8u6+ v4ehIqVyjrjuuWVclBgD4ZXljhp/UyZdCkIp+dtHbjJto15wNW2T1zsTe82ORN0h+3cr G3we2AkDHMw4FQYigMlLufiT8QXy758N1VMaulTs1qg4pZdKC4YMbok+RZrPN5s5FBDx 1rbB9ypm8WjszC9dNeMJ7yRm8OY+FDbua08cnFk1PCqDL8bDK2A1g8Jv2QaqHYiB8ztg Vlwg== X-Forwarded-Encrypted: i=1; AFNElJ/8pNHxcpb/5vlJr1a6jeoliOuYRT/CWy0Zho3IzxlfowOw0DXmZYFUxSzxn18698ZCkLLMMgpqkEMZIQ==@lists.linux.dev X-Gm-Message-State: AOJu0YwfCh2/+55wq40/ylXSq3fweqqcJvheFBXem8C/BCRxhbF1KfG+ RgUiC3XOHmr60IaCR5TW0ULy74lY2CHQyBGRyKzJ9JFD4KB9WF7MgIjAIgiYDwwflXU= X-Gm-Gg: AfdE7cmWsAeDc2bZEJE+j2JHdlKTixsgVwPyyqFd2e75SJIra/rdQZsLK6n0yV/mgc/ OPgytOkdx1FtG0NzWlIrOM/hxg9ErzS0ZeXMO6Fw4p6oNKc4JSPbkyYD16NAFSqVF6ofxUc7++F yyB7tvVKCU0Lfp4Vh/moDMLrwMce0lTKzo1kaiIf0exlBQhGniVa2x/N08kmGM/ketxsxB/KhYx FhoZqcp2f/nlwBYnlrZipsLjKLogkZcv1cVPg/7Lgg/xRsWppfeI2SydNyH7t/pD3znDio9nlZb QEASKsMKzrCu8JZrs8oa/j6wr9yyT1FNuvn99zgnhAToJuDcT7iIjLQCp4lHeexDJU0gM12UH8v 7u/onEqFM+6WTTPOEg/4QUzWLoi0GnqYqwQB0gPf9u/PV//ltrq6u8yYvMk3pj4hpq2GiHO5V9X rOlDvsog4IIcI= X-Received: by 2002:a05:600d:3:b0:492:523f:a3df with SMTP id 5b1f17b1804b1-493c2b161b3mr65913275e9.5.1782979861478; Thu, 02 Jul 2026 01:11:01 -0700 (PDT) Received: from localhost ([2a01:e0a:3c5:5fb1:2e3a:7dcd:d2a4:6556]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-493c6372c52sm28787545e9.14.2026.07.02.01.11.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2026 01:11:00 -0700 (PDT) From: Jerome Brunet Date: Thu, 02 Jul 2026 10:10:07 +0200 Subject: [PATCH v3 8/8] clk: sunxi-ng: sun6i-rtc: add a733 support Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20260702-a733-rtc-v3-8-eb2580374de6@baylibre.com> References: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> In-Reply-To: <20260702-a733-rtc-v3-0-eb2580374de6@baylibre.com> To: Junhui Liu , Alexandre Belloni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Michael Turquette , Stephen Boyd , Maxime Ripard Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Jerome Brunet X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5987; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=rBendd4uuEhgkyP4RE0zkVRJMkAWDgIQr5V1OAvN0oA=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBqRhz9MfScamz8f3pP7xitK//ZEvxJoGjJ0MX75 2HPdtq2wluJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCakYc/QAKCRDm/A8cN/La hf3tD/4qrfRYAsDWz3OImGSBlUMd9kVZBJFcHpm6lgnF7Xz5khE8dx91e2N/LsXXZ80MMe8QZt+ tadCt3+gZ7NmM+EaoPyD4JqtQjUU8nn01d2z0GHtytQU0fAT8p99uponfmU15Zb4muhQ2nZ+Pjd y9LwLf2oc5qoD8Ms61OJ66IE12pEYJLM5ngg6wjgWyja8uouZTTXtvjb1cHSyCp4KM4fvOA4yf+ 0RUBLu9sgeBbYCQa0wxbAfbx6bknmOAPkx9p/CXO3o+kuB+qRJLdLSPaaFodWhhyEn1h3NX/Ufl NvLFPbe5y2IHk9Blfh1QA4eImXCkxVVMv95kTEouSJ3LpEmos26iV1ZCQ2kaUtV/+d/G2cufvMh E/DAXhp8iIgWaKtlg8P62ol8Ku3UUOMkn42CgxmSzzhdHCAXTCEuRTTJLSlc4gbrLAziINHYO8H j4dmB6JOTCrbXOCFhFwGlnrGMdo0ZVZWc+g4fXobq+W6vpTjEpkw7D7V9dRKQHJmk7/lrUgyZy4 MjRMJoMrCIw2/ZUUcTgsZlLy8UMSuE9CKYYIHjySqwQcI3YS0OhVobpIurMybhv2ryoziwLmmrU SgpR9Ncy46g5XqoQUr7b+WfOMyuT0jHDalAj6OnRP76+VOvImO+Ob6XwgYAX4rWGy3348xv2Cyu Rn4LEty4+fXIIxw== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= Add support for the sun60i a733 CCU RTC. Compared to the a523, this SoC has a different input oscillator divider which auto-detects the oscillator rate and select a divider to provide a fixed 32768Hz clock. It also provides several phy reference clocks with dedicated clock gates. Signed-off-by: Jerome Brunet --- drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 73 ++++++++++++++++++++++++++++++++++-- drivers/clk/sunxi-ng/ccu-sun6i-rtc.h | 2 +- 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c index 25dd87e78eb7..6b71bbd80255 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c @@ -44,9 +44,13 @@ #define DCXO_CTRL_REG 0x160 #define DCXO_CTRL_CLK16M_RC_EN BIT(0) +#define DCXO_GATING_REG 0x16c + struct sun6i_rtc_match_data { bool have_ext_osc32k : 1; bool have_iosc_calibration : 1; + bool have_dcxo_status : 1; + bool have_phy_ref_gates : 1; bool rtc_32k_single_parent : 1; const struct clk_parent_data *osc32k_fanout_parents; u8 osc32k_fanout_nparents; @@ -213,7 +217,12 @@ static struct ccu_mux osc32k_clk = { }, }; -/* This falls back to the global name for fwnodes without a named reference. */ +/* + * This falls back to the global name for fwnodes without a named reference. + * NOTE: osc24M name might be misleading the oscillator could also be a 26MHz + * or a 19.2MHz one starting with the a733. The original name is kept anyway + * in case anything is relying on it. + */ static const struct clk_parent_data osc24M[] = { { .fw_name = "hosc", .name = "osc24M" } }; @@ -227,8 +236,28 @@ static struct clk_fixed_factor osc24M_32k_div_clk = { 0), }; -static SUNXI_CCU_GATE_HW(osc24M_32k_clk, "osc24M-32k", &osc24M_32k_div_clk.hw, - LOSC_OUT_GATING_REG, BIT(16), 0); +static struct clk_div_table osc24M_32k_div_a733_table[] = { + { .val = 0, .div = 732 }, + { .val = 1, .div = 586 }, + { .val = 2, .div = 793 }, + { .val = 3, .div = 732 }, + { /* Sentinel */ }, +}; + +static struct ccu_div osc24M_32k_div_a733_clk = { + .enable = BIT(1), + .div = _SUNXI_CCU_DIV_TABLE(14, 2, osc24M_32k_div_a733_table), + .common = { + .reg = DCXO_CTRL_REG, + .hw.init = CLK_HW_INIT_PARENTS_DATA("osc24M-32k-div", + osc24M, + &ccu_rodiv_ops, + 0), + }, +}; + +static SUNXI_CCU_GATE(osc24M_32k_clk, "osc24M-32k", "osc24M-32k-div", + LOSC_OUT_GATING_REG, BIT(16), 0); static const struct clk_hw *rtc_32k_parents[] = { &osc32k_clk.common.hw, @@ -267,6 +296,15 @@ static struct ccu_mux osc32k_fanout_clk = { }, }; +static SUNXI_CCU_GATE_FW(hosc_serdes1_clk, "hosc-serdes1", "hosc", + DCXO_GATING_REG, BIT(5), 0); +static SUNXI_CCU_GATE_FW(hosc_serdes0_clk, "hosc-serdes0", "hosc", + DCXO_GATING_REG, BIT(4), 0); +static SUNXI_CCU_GATE_FW(hosc_hdmi_clk, "hosc-hdmi", "hosc", + DCXO_GATING_REG, BIT(1), 0); +static SUNXI_CCU_GATE_FW(hosc_ufs_clk, "hosc-ufs", "hosc", + DCXO_GATING_REG, BIT(0), 0); + static struct ccu_common *sun6i_rtc_ccu_clks[] = { &iosc_clk, &iosc_32k_clk, @@ -275,6 +313,11 @@ static struct ccu_common *sun6i_rtc_ccu_clks[] = { &osc24M_32k_clk.common, &rtc_32k_clk.common, &osc32k_fanout_clk.common, + &osc24M_32k_div_a733_clk.common, + &hosc_serdes1_clk.common, + &hosc_serdes0_clk.common, + &hosc_hdmi_clk.common, + &hosc_ufs_clk.common, }; static struct clk_hw_onecell_data sun6i_rtc_ccu_hw_clks = { @@ -288,6 +331,10 @@ static struct clk_hw_onecell_data sun6i_rtc_ccu_hw_clks = { [CLK_OSC24M_32K] = &osc24M_32k_clk.common.hw, [CLK_RTC_32K] = &rtc_32k_clk.common.hw, [CLK_OSC24M_32K_DIV] = &osc24M_32k_div_clk.hw, + [CLK_HOSC_UFS] = &hosc_ufs_clk.common.hw, + [CLK_HOSC_HDMI] = &hosc_hdmi_clk.common.hw, + [CLK_HOSC_SERDES0] = &hosc_serdes0_clk.common.hw, + [CLK_HOSC_SERDES1] = &hosc_serdes1_clk.common.hw, }, }; @@ -330,6 +377,15 @@ static const struct sun6i_rtc_match_data sun55i_a523_rtc_ccu_data = { .osc32k_fanout_nparents = ARRAY_SIZE(sun50i_r329_osc32k_fanout_parents), }; +static const struct sun6i_rtc_match_data sun60i_a733_rtc_ccu_data = { + .have_ext_osc32k = true, + .have_iosc_calibration = true, + .have_dcxo_status = true, + .have_phy_ref_gates = true, + .osc32k_fanout_parents = sun50i_r329_osc32k_fanout_parents, + .osc32k_fanout_nparents = ARRAY_SIZE(sun50i_r329_osc32k_fanout_parents), +}; + static const struct of_device_id sun6i_rtc_ccu_match[] = { { .compatible = "allwinner,sun50i-h616-rtc", @@ -343,6 +399,10 @@ static const struct of_device_id sun6i_rtc_ccu_match[] = { .compatible = "allwinner,sun55i-a523-rtc", .data = &sun55i_a523_rtc_ccu_data, }, + { + .compatible = "allwinner,sun60i-a733-rtc", + .data = &sun60i_a733_rtc_ccu_data, + }, {}, }; MODULE_DEVICE_TABLE(of, sun6i_rtc_ccu_match); @@ -375,6 +435,13 @@ int sun6i_rtc_ccu_probe(struct device *dev, void __iomem *reg) osc32k_fanout_init_data.parent_data = data->osc32k_fanout_parents; osc32k_fanout_init_data.num_parents = data->osc32k_fanout_nparents; + if (data->have_dcxo_status) + sun6i_rtc_ccu_hw_clks.hws[CLK_OSC24M_32K_DIV] = + &osc24M_32k_div_a733_clk.common.hw; + + if (!data->have_phy_ref_gates) + sun6i_rtc_ccu_hw_clks.num = CLK_OSC24M_32K_DIV + 1; + return devm_sunxi_ccu_probe(dev, reg, &sun6i_rtc_ccu_desc); } diff --git a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h index ab7b92b47f59..4f4f4cb00f1d 100644 --- a/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h +++ b/drivers/clk/sunxi-ng/ccu-sun6i-rtc.h @@ -11,6 +11,6 @@ #define CLK_RTC_32K 6 #define CLK_OSC24M_32K_DIV 7 -#define CLK_NUMBER (CLK_OSC24M_32K_DIV + 1) +#define CLK_NUMBER (CLK_HOSC_SERDES1 + 1) #endif /* _CCU_SUN6I_RTC_H */