From: Haylen Chu <heylenay@4d2.org>
To: Troy Mitchell <troy.mitchell@linux.spacemit.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>, Yixun Lan <dlan@gentoo.org>,
Alex Elder <elder@riscstar.com>,
Inochi Amaoto <inochiama@outlook.com>
Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org,
linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
linux-kernel@vger.kernel.org,
Jinmei Wei <weijinmei@linux.spacemit.com>
Subject: Re: [PATCH v2 2/4] clk: spacemit: introduce pre-div for ddn clock
Date: Mon, 18 Aug 2025 02:04:39 +0000 [thread overview]
Message-ID: <aKKKNynq-w89YeAx@ketchup> (raw)
In-Reply-To: <20250811-k1-clk-i2s-generation-v2-2-e4d3ec268b7a@linux.spacemit.com>
On Mon, Aug 11, 2025 at 10:04:28PM +0800, Troy Mitchell wrote:
> The original DDN operations applied an implicit divide-by-2, which should
> not be a default behavior.
>
> This patch removes that assumption, letting each clock define its
> actual behavior explicitly.
>
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> ---
> drivers/clk/spacemit/ccu_ddn.c | 12 ++++++------
> drivers/clk/spacemit/ccu_ddn.h | 6 ++++--
> 2 files changed, 10 insertions(+), 8 deletions(-)
The code change looks good to me, but
> diff --git a/drivers/clk/spacemit/ccu_ddn.h b/drivers/clk/spacemit/ccu_ddn.h
> index a52fabe77d62eba16426867a9c13481e72f025c0..4838414a8e8dc04af49d3b8d39280efedbd75616 100644
> --- a/drivers/clk/spacemit/ccu_ddn.h
> +++ b/drivers/clk/spacemit/ccu_ddn.h
> @@ -18,13 +18,14 @@ struct ccu_ddn {
> unsigned int num_shift;
> unsigned int den_mask;
> unsigned int den_shift;
> + unsigned int pre_div;
> };
>
> #define CCU_DDN_INIT(_name, _parent, _flags) \
> CLK_HW_INIT_HW(#_name, &_parent.common.hw, &spacemit_ccu_ddn_ops, _flags)
>
> #define CCU_DDN_DEFINE(_name, _parent, _reg_ctrl, _num_shift, _num_width, \
> - _den_shift, _den_width, _flags) \
> + _den_shift, _den_width, _pre_div, _flags) \
You changed the definition of CCU_DDN_DEFINE without adjusting consumers
of this macro. If I'm correct, this creates a build failure.
> static struct ccu_ddn _name = { \
> .common = { \
> .reg_ctrl = _reg_ctrl, \
> @@ -33,7 +34,8 @@ static struct ccu_ddn _name = { \
> .num_mask = GENMASK(_num_shift + _num_width - 1, _num_shift), \
> .num_shift = _num_shift, \
> .den_mask = GENMASK(_den_shift + _den_width - 1, _den_shift), \
> - .den_shift = _den_shift, \
> + .den_shift = _den_shift, \
> + .pre_div = _pre_div, \
> }
>
> static inline struct ccu_ddn *hw_to_ccu_ddn(struct clk_hw *hw)
>
> --
> 2.50.1
>
Best regards,
Haylen Chu
next prev parent reply other threads:[~2025-08-18 2:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-11 14:04 [PATCH v2 0/4] clk: spacemit: fix i2s clock Troy Mitchell
2025-08-11 14:04 ` [PATCH v2 1/4] dt-bindings: clock: spacemit: introduce i2s pre-clock to " Troy Mitchell
2025-08-14 8:58 ` Krzysztof Kozlowski
2025-08-11 14:04 ` [PATCH v2 2/4] clk: spacemit: introduce pre-div for ddn clock Troy Mitchell
2025-08-18 2:04 ` Haylen Chu [this message]
2025-08-18 7:32 ` Troy Mitchell
2025-08-11 14:04 ` [PATCH v2 3/4] clk: spacemit: introduce factor for div clock Troy Mitchell
2025-08-18 2:20 ` Haylen Chu
2025-08-18 7:33 ` Troy Mitchell
2025-08-11 14:04 ` [PATCH v2 4/4] clk: spacemit: fix i2s clock Troy Mitchell
2025-08-14 1:05 ` kernel test robot
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=aKKKNynq-w89YeAx@ketchup \
--to=heylenay@4d2.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@gentoo.org \
--cc=elder@riscstar.com \
--cc=inochiama@outlook.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=troy.mitchell@linux.spacemit.com \
--cc=weijinmei@linux.spacemit.com \
/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;
as well as URLs for NNTP newsgroup(s).