public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] clk: rockchip: rk3588: add I2S MCLK output gate clocks
@ 2026-03-16 13:06 Daniele Briguglio
  2026-03-16 13:06 ` [PATCH 1/3] dt-bindings: clock: rockchip,rk3588-cru: add I2S MCLK output to IO clock IDs Daniele Briguglio
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Daniele Briguglio @ 2026-03-16 13:06 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heiko Stuebner
  Cc: linux-clk, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Nicolas Frattaroli, Daniele Briguglio

On RK3588, the four I2S master clock (MCLK) outputs to external IO
pins are gated by bits in SYS_GRF SOC_CON6 (offset 0x0318). These
are set-to-disable gates with hiword mask semantics.

The TRM documents the reset value of these bits as 0 (gate open),
but in practice the Rockchip firmware (BL31) may set them during
early boot, preventing the MCLK signal from reaching external audio
codecs. The kernel should manage these gates explicitly so that
audio functionality does not depend on bootloader register state.

This series adds GATE_GRF clock entries for all four I2S MCLK output
gates, following the same approach used for the RK3576 SAI MCLK
output gates [1]. Board DTS files that need MCLK on an IO pin can
reference these clocks (e.g. clocks = <&cru I2S0_8CH_MCLKOUT_TO_IO>),
ensuring the output gate is opened when the clock is enabled.

Patch 1 adds the four clock ID bindings.
Patch 2 removes the grf_type_sys exclusion from the aux_grf_table
        lookup, which prevented SYS_GRF-based GATE_GRF entries from
        being resolved on RK3588 (where ctx->grf points to PHP_GRF).
Patch 3 registers the SYS_GRF as an auxiliary GRF and adds the four
        GATE_GRF clock entries, each placed after its parent MCLKOUT.

Tested on a Youyeetoo YY3588 (RK3588) board with an ES8388 audio
codec connected to I2S0. Without this series the firmware leaves the
gate closed and the codec receives no master clock. With the series
applied and DTS updated, audio playback works correctly.

[1] https://lore.kernel.org/r/20250305-rk3576-sai-v1-2-64e6cf863e9a@collabora.com/

Signed-off-by: Daniele Briguglio <hello@superkali.me>
---
Daniele Briguglio (3):
      dt-bindings: clock: rockchip,rk3588-cru: add I2S MCLK output to IO clock IDs
      clk: rockchip: allow grf_type_sys lookup in aux_grf_table
      clk: rockchip: rk3588: add GATE_GRF clocks for I2S MCLK output to IO

 drivers/clk/rockchip/clk-rk3588.c               | 22 ++++++++++++++++++++++
 drivers/clk/rockchip/clk.c                      |  7 +++----
 include/dt-bindings/clock/rockchip,rk3588-cru.h |  4 ++++
 3 files changed, 29 insertions(+), 4 deletions(-)
---
base-commit: b84a0ebe421ca56995ff78b66307667b62b3a900
change-id: 20260316-rk3588-mclk-gate-grf-c4b180438fc0

Best regards,
-- 
Daniele Briguglio <hello@superkali.me>


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

end of thread, other threads:[~2026-03-19  7:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16 13:06 [PATCH 0/3] clk: rockchip: rk3588: add I2S MCLK output gate clocks Daniele Briguglio
2026-03-16 13:06 ` [PATCH 1/3] dt-bindings: clock: rockchip,rk3588-cru: add I2S MCLK output to IO clock IDs Daniele Briguglio
2026-03-17  7:40   ` Krzysztof Kozlowski
2026-03-16 13:06 ` [PATCH 2/3] clk: rockchip: allow grf_type_sys lookup in aux_grf_table Daniele Briguglio
2026-03-18 12:35   ` Nicolas Frattaroli
2026-03-16 13:06 ` [PATCH 3/3] clk: rockchip: rk3588: add GATE_GRF clocks for I2S MCLK output to IO Daniele Briguglio
2026-03-19  7:03   ` kernel test robot
2026-03-18  0:44 ` [PATCH 0/3] clk: rockchip: rk3588: add I2S MCLK output gate clocks Ricardo Pardini

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