[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aTo54Q3luukdJiJw@pie>
Date: Thu, 11 Dec 2025 03:26:25 +0000
From: Yao Zi <me@...ao.cc>
To: Yixun Lan <dlan@...too.org>, Stephen Boyd <sboyd@...nel.org>,
Michael Turquette <mturquette@...libre.com>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>
Cc: Haylen Chu <heylenay@....org>, Inochi Amaoto <inochiama@...il.com>,
linux-clk@...r.kernel.org, devicetree@...r.kernel.org,
linux-riscv@...ts.infradead.org, spacemit@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 2/4] clk: spacemit: ccu_mix: add inverted enable gate
clock
On Thu, Dec 11, 2025 at 09:19:42AM +0800, Yixun Lan wrote:
> K3 SoC has the clock IP which support to write value 0 for enabling the
> clock, while write 1 for disabling it, thus the enable BIT is inverted.
> So, introduce a flag to support the inverted gate clock.
>
> Signed-off-by: Yixun Lan <dlan@...too.org>
> ---
> drivers/clk/spacemit/ccu_mix.c | 12 ++++++++----
> drivers/clk/spacemit/ccu_mix.h | 12 ++++++++++++
> 2 files changed, 20 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/spacemit/ccu_mix.c b/drivers/clk/spacemit/ccu_mix.c
> index 7b7990875372..14fbf7048c89 100644
> --- a/drivers/clk/spacemit/ccu_mix.c
> +++ b/drivers/clk/spacemit/ccu_mix.c
> @@ -16,17 +16,19 @@
> static void ccu_gate_disable(struct clk_hw *hw)
> {
> struct ccu_mix *mix = hw_to_ccu_mix(hw);
> + struct ccu_gate_config *gate = &mix->gate;
> + u32 val = gate->inverted ? gate->mask : 0;
>
> - ccu_update(&mix->common, ctrl, mix->gate.mask, 0);
> + ccu_update(&mix->common, ctrl, gate->mask, val);
> }
>
> static int ccu_gate_enable(struct clk_hw *hw)
> {
> struct ccu_mix *mix = hw_to_ccu_mix(hw);
> struct ccu_gate_config *gate = &mix->gate;
> + u32 val = gate->inverted ? 0 : gate->mask;
>
> - ccu_update(&mix->common, ctrl, gate->mask, gate->mask);
> -
> + ccu_update(&mix->common, ctrl, gate->mask, val);
An unrelated blank line gets removed here, is this intended?
> return 0;
> }
Regards,
Yao Zi
Powered by blists - more mailing lists