Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/3] clk: rockchip: rk3506: Add the SAI MCLK output gate clocks
@ 2026-11-23  0:38 Xiangyu Zhu
  2026-11-23  1:51 ` Chaoyi Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Xiangyu Zhu @ 2026-11-23  0:38 UTC (permalink / raw)
  To: Heiko Stuebner, Stephen Boyd
  Cc: Xiangyu Zhu, Michael Turquette, Krzysztof Kozlowski, Conor Dooley,
	linux-clk, linux-rockchip, linux-arm-kernel, devicetree,
	linux-kernel

The RK3506 has four SAI MCLK output gates: SAI0 and SAI1 are controlled
by bits in the PMU GRF, SAI2 and SAI3 by bits in the system GRF.  Model
them as GRF gate clocks so the SAI MCLK pin direction can be controlled
through the clock framework.

This is v4 of the earlier "rockchip,clk-out" binding/driver submission.
That one introduced a generic "rockchip,clk-out" compatible plus a
standalone driver, which is not acceptable: upstream already has generic
GRF gate support (branch_grf_gate together with rockchip_clk_add_grf()),
and RK3576 and RK3588 register their SAI/I2S MCLK output gates with it.
No device tree changes are included.

v2 registered all four gates from one branch table while only the PMU GRF
was added as an auxiliary GRF.  The two system GRF gates therefore came
right after two PMU GRF gates in the same table, and
rockchip_clk_register_branches() keeps using the regmap it picked for the
previous branch when it finds no entry for a branch's grf_type, so they
ended up toggling bits of the PMU GRF.  The SAI0/SAI1 gates are now
registered from their own table, and only once the PMU GRF was really
added, so no branch table mixes two GRF types and the PMU GRF gates can
no longer fall back to the system GRF.

The series now also documents the RK3506 GRF compatibles in the Rockchip
GRF binding, including the "rockchip,rk3506-pmu-grf" name used by the
clock driver.  The RK3506 DTS uses the same PMU GRF compatible; that
rename is part of the RK3506 DTS series.

Tested on a RK3506B board: the SAI0 MCLK output runs at 12.288 MHz and
drives the ES8388 codec, audio playback works, and the GRF gate bits were
read back from the registers to confirm that they get set.  Enabling the
SAI2/SAI3 gates sets bit 2 and bit 3 of the system GRF (0xff288004) and
leaves the PMU GRF alone.

Changes since v3:
 - add the RK3506 GRF compatibles to the Rockchip GRF binding
 - look up the PMU GRF using the documented "rockchip,rk3506-pmu-grf"
   compatible instead of the vendor's "rockchip,rk3506-grf-pmu" name

Changes since v2:
 - register the SAI0/SAI1 gates from a separate table that is only used
   when the PMU GRF was added successfully

Changes since v1:
 - drop the rockchip,clk-out binding and driver
 - use the existing GATE_GRF support like RK3576 and RK3588 do
 - limit the series to the clock driver and the dt-bindings IDs

Xiangyu Zhu (3):
  dt-bindings: soc: rockchip: Add RK3506 GRF compatibles
  dt-bindings: clock: rockchip,rk3506-cru: Add SAI MCLK output gate IDs
  clk: rockchip: rk3506: Register the SAI MCLK output gates

 .../devicetree/bindings/soc/rockchip/grf.yaml |  4 +++
 drivers/clk/rockchip/clk-rk3506.c             | 27 +++++++++++++++++++
 .../dt-bindings/clock/rockchip,rk3506-cru.h   |  4 +++
 3 files changed, 35 insertions(+)

-- 
2.47.3



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 0/3] clk: rockchip: rk3506: Add the SAI MCLK output gate clocks
  2026-11-23  0:38 [PATCH v4 0/3] clk: rockchip: rk3506: Add the SAI MCLK output gate clocks Xiangyu Zhu
@ 2026-11-23  1:51 ` Chaoyi Chen
  2026-11-23  9:23   ` Heiko Stübner
  0 siblings, 1 reply; 3+ messages in thread
From: Chaoyi Chen @ 2026-11-23  1:51 UTC (permalink / raw)
  To: Xiangyu Zhu
  Cc: Heiko Stuebner, Stephen Boyd, Michael Turquette,
	Krzysztof Kozlowski, Conor Dooley, linux-clk, linux-rockchip,
	linux-arm-kernel, devicetree, linux-kernel

Hi Xiangyu,

On 11/23/2026 8:38 AM, Xiangyu Zhu wrote:
> The RK3506 has four SAI MCLK output gates: SAI0 and SAI1 are controlled
> by bits in the PMU GRF, SAI2 and SAI3 by bits in the system GRF.  Model
> them as GRF gate clocks so the SAI MCLK pin direction can be controlled
> through the clock framework.
> 
> This is v4 of the earlier "rockchip,clk-out" binding/driver submission.
> That one introduced a generic "rockchip,clk-out" compatible plus a
> standalone driver, which is not acceptable: upstream already has generic
> GRF gate support (branch_grf_gate together with rockchip_clk_add_grf()),
> and RK3576 and RK3588 register their SAI/I2S MCLK output gates with it.
> No device tree changes are included.

Please slow down the pace at which you send patches so that people have
time to read them. Don't send your patches within 24 hours.

In addition, your Message-ID seems to have been modified by your email
provider:

Message-ID: <tencent_C4C715C962613597F98212938F8940633306@qq.com>

Please try the downgrade the git version[0] you use for
git send-email, or switch to a different email provider.

[0]: https://lore.kernel.org/all/8771714B848C3A9F+9f64a309-ff70-466f-8d29-15950318b728@airkyi.com/

> 
> v2 registered all four gates from one branch table while only the PMU GRF
> was added as an auxiliary GRF.  The two system GRF gates therefore came
> right after two PMU GRF gates in the same table, and
> rockchip_clk_register_branches() keeps using the regmap it picked for the
> previous branch when it finds no entry for a branch's grf_type, so they
> ended up toggling bits of the PMU GRF.  The SAI0/SAI1 gates are now
> registered from their own table, and only once the PMU GRF was really
> added, so no branch table mixes two GRF types and the PMU GRF gates can
> no longer fall back to the system GRF.
> 
> The series now also documents the RK3506 GRF compatibles in the Rockchip
> GRF binding, including the "rockchip,rk3506-pmu-grf" name used by the
> clock driver.  The RK3506 DTS uses the same PMU GRF compatible; that
> rename is part of the RK3506 DTS series.
> 
> Tested on a RK3506B board: the SAI0 MCLK output runs at 12.288 MHz and
> drives the ES8388 codec, audio playback works, and the GRF gate bits were
> read back from the registers to confirm that they get set.  Enabling the
> SAI2/SAI3 gates sets bit 2 and bit 3 of the system GRF (0xff288004) and
> leaves the PMU GRF alone.
> 
> Changes since v3:
>  - add the RK3506 GRF compatibles to the Rockchip GRF binding
>  - look up the PMU GRF using the documented "rockchip,rk3506-pmu-grf"
>    compatible instead of the vendor's "rockchip,rk3506-grf-pmu" name
> 
> Changes since v2:
>  - register the SAI0/SAI1 gates from a separate table that is only used
>    when the PMU GRF was added successfully
> 
> Changes since v1:
>  - drop the rockchip,clk-out binding and driver
>  - use the existing GATE_GRF support like RK3576 and RK3588 do
>  - limit the series to the clock driver and the dt-bindings IDs
> 
> Xiangyu Zhu (3):
>   dt-bindings: soc: rockchip: Add RK3506 GRF compatibles
>   dt-bindings: clock: rockchip,rk3506-cru: Add SAI MCLK output gate IDs
>   clk: rockchip: rk3506: Register the SAI MCLK output gates
> 
>  .../devicetree/bindings/soc/rockchip/grf.yaml |  4 +++
>  drivers/clk/rockchip/clk-rk3506.c             | 27 +++++++++++++++++++
>  .../dt-bindings/clock/rockchip,rk3506-cru.h   |  4 +++
>  3 files changed, 35 insertions(+)
> 

-- 
Best, 
Chaoyi


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4 0/3] clk: rockchip: rk3506: Add the SAI MCLK output gate clocks
  2026-11-23  1:51 ` Chaoyi Chen
@ 2026-11-23  9:23   ` Heiko Stübner
  0 siblings, 0 replies; 3+ messages in thread
From: Heiko Stübner @ 2026-11-23  9:23 UTC (permalink / raw)
  To: Xiangyu Zhu, Chaoyi Chen
  Cc: Stephen Boyd, Michael Turquette, Krzysztof Kozlowski,
	Conor Dooley, linux-clk, linux-rockchip, linux-arm-kernel,
	devicetree, linux-kernel

Am Montag, 23. November 2026, 02:51:32 Mitteleuropäische Normalzeit schrieb Chaoyi Chen:
> Hi Xiangyu,
> 
> On 11/23/2026 8:38 AM, Xiangyu Zhu wrote:
> > The RK3506 has four SAI MCLK output gates: SAI0 and SAI1 are controlled
> > by bits in the PMU GRF, SAI2 and SAI3 by bits in the system GRF.  Model
> > them as GRF gate clocks so the SAI MCLK pin direction can be controlled
> > through the clock framework.
> > 
> > This is v4 of the earlier "rockchip,clk-out" binding/driver submission.
> > That one introduced a generic "rockchip,clk-out" compatible plus a
> > standalone driver, which is not acceptable: upstream already has generic
> > GRF gate support (branch_grf_gate together with rockchip_clk_add_grf()),
> > and RK3576 and RK3588 register their SAI/I2S MCLK output gates with it.
> > No device tree changes are included.
> 
> Please slow down the pace at which you send patches so that people have
> time to read them. Don't send your patches within 24 hours.
> 
> In addition, your Message-ID seems to have been modified by your email
> provider:
> 
> Message-ID: <tencent_C4C715C962613597F98212938F8940633306@qq.com>
> 
> Please try the downgrade the git version[0] you use for
> git send-email, or switch to a different email provider.
> 
> [0]: https://lore.kernel.org/all/8771714B848C3A9F+9f64a309-ff70-466f-8d29-15950318b728@airkyi.com/

tencent is notorious for mangling message-ids (adding that "tencent_"
in front. This will likely happen with all git versions.

I think the best way forward is what most "qq" users do nowadays
to use "b4" and use it web-submission option [0]


Heiko

[0] https://b4.docs.kernel.org/en/latest/contributor/send.html




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-23  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23  0:38 [PATCH v4 0/3] clk: rockchip: rk3506: Add the SAI MCLK output gate clocks Xiangyu Zhu
2026-11-23  1:51 ` Chaoyi Chen
2026-11-23  9:23   ` Heiko Stübner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox