From: Chen-Yu Tsai <wens@kernel.org>
To: Stephen Boyd <sboyd@kernel.org>, Chen-Yu Tsai <wens@csie.org>,
Jernej Skrabec <jernej@kernel.org>,
Samuel Holland <samuel@sholland.org>
Cc: Andre Przywara <andre.przywara@arm.com>,
linux-sunxi@lists.linux.dev, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 4/7] clk: sunxi-ng: div: support power-of-two dividers
Date: Fri, 12 Sep 2025 01:47:07 +0800 [thread overview]
Message-ID: <20250911174710.3149589-5-wens@kernel.org> (raw)
In-Reply-To: <20250911174710.3149589-1-wens@kernel.org>
From: Chen-Yu Tsai <wens@csie.org>
Some clocks (for timers) on the A523 are mux-divider-gate types
with the divider being values of power-of-two.
Add a macro for these types of clocks so that we can use the divider
types instead of the M-P types without an M divider.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
drivers/clk/sunxi-ng/ccu_div.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/clk/sunxi-ng/ccu_div.h b/drivers/clk/sunxi-ng/ccu_div.h
index 90d49ee8e0cc..be00b3277e97 100644
--- a/drivers/clk/sunxi-ng/ccu_div.h
+++ b/drivers/clk/sunxi-ng/ccu_div.h
@@ -274,6 +274,24 @@ struct ccu_div {
SUNXI_CCU_M_HWS_WITH_GATE(_struct, _name, _parent, _reg, \
_mshift, _mwidth, 0, _flags)
+#define SUNXI_CCU_P_DATA_WITH_MUX_GATE(_struct, _name, _parents, _reg, \
+ _mshift, _mwidth, \
+ _muxshift, _muxwidth, \
+ _gate, _flags) \
+ struct ccu_div _struct = { \
+ .enable = _gate, \
+ .div = _SUNXI_CCU_DIV_FLAGS(_mshift, _mwidth, \
+ CLK_DIVIDER_POWER_OF_TWO), \
+ .mux = _SUNXI_CCU_MUX(_muxshift, _muxwidth), \
+ .common = { \
+ .reg = _reg, \
+ .hw.init = CLK_HW_INIT_PARENTS_DATA(_name, \
+ _parents, \
+ &ccu_div_ops, \
+ _flags), \
+ }, \
+ }
+
static inline struct ccu_div *hw_to_ccu_div(struct clk_hw *hw)
{
struct ccu_common *common = hw_to_ccu_common(hw);
--
2.39.5
next prev parent reply other threads:[~2025-09-11 17:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 17:47 [PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU Chen-Yu Tsai
2025-09-11 17:47 ` [PATCH v2 1/7] dt-bindings: clock: sun55i-a523-ccu: Add missing NPU module clock Chen-Yu Tsai
2025-09-11 17:47 ` [PATCH v2 2/7] dt-bindings: clock: sun55i-a523-ccu: Add A523 MCU CCU clock controller Chen-Yu Tsai
2025-09-11 17:47 ` [PATCH v2 3/7] clk: sunxi-ng: sun55i-a523-ccu: Add missing NPU module clock Chen-Yu Tsai
2025-09-11 18:07 ` Jernej Škrabec
2025-09-12 10:19 ` Andre Przywara
2025-09-11 17:47 ` Chen-Yu Tsai [this message]
2025-09-11 18:08 ` [PATCH v2 4/7] clk: sunxi-ng: div: support power-of-two dividers Jernej Škrabec
2025-09-11 17:47 ` [PATCH v2 5/7] clk: sunxi-ng: add support for the A523/T527 MCU CCU Chen-Yu Tsai
2025-09-11 18:45 ` Jernej Škrabec
2025-09-11 17:47 ` [PATCH v2 6/7] arm64: dts: allwinner: a523: Add MCU PRCM CCU node Chen-Yu Tsai
2025-09-11 18:46 ` Jernej Škrabec
2025-09-11 17:47 ` [PATCH v2 7/7] arm64: dts: allwinner: a523: Add NPU device node Chen-Yu Tsai
2025-09-11 18:46 ` Jernej Škrabec
2025-09-13 5:55 ` [PATCH v2 0/7] arm64: allwinner: a523: Enable MCU PRCM and NPU Chen-Yu Tsai
2025-09-13 5:55 ` Chen-Yu Tsai
2025-09-13 6:16 ` (subset) " Chen-Yu Tsai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250911174710.3149589-5-wens@kernel.org \
--to=wens@kernel.org \
--cc=andre.przywara@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=jernej@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@lists.linux.dev \
--cc=samuel@sholland.org \
--cc=sboyd@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox