|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: SuperKali <hello@superkali.me> |
| 3 | +Date: Sat, 27 Jun 2026 12:00:00 +0200 |
| 4 | +Subject: clk: rockchip: rk3588: don't disable unused I2S MCLK output gates |
| 5 | + |
| 6 | +No in-tree board references these gates yet. Boards drive the codec |
| 7 | +MCLK through the parent I2S*_8CH_MCLKOUT, and now that the gates are |
| 8 | +managed clocks, clk_disable_unused() turns them off at boot. On a board |
| 9 | +that relied on firmware leaving the output enabled, that cuts the MCLK |
| 10 | +and analog audio stops working. |
| 11 | + |
| 12 | +Mark the four gates CLK_IGNORE_UNUSED so an unreferenced gate keeps the |
| 13 | +state firmware left. A board that wants the kernel to own the gate can |
| 14 | +reference I2S*_8CH_MCLKOUT_TO_IO from DT instead. |
| 15 | + |
| 16 | +Upstream: https://lore.kernel.org/linux-rockchip/20260624123914.1767374-1-hello@superkali.me/ |
| 17 | + |
| 18 | +Signed-off-by: SuperKali <hello@superkali.me> |
| 19 | +--- |
| 20 | + drivers/clk/rockchip/clk-rk3588.c | 8 ++++---- |
| 21 | + 1 file changed, 4 insertions(+), 4 deletions(-) |
| 22 | + |
| 23 | +diff --git a/drivers/clk/rockchip/clk-rk3588.c b/drivers/clk/rockchip/clk-rk3588.c |
| 24 | +index 2cc85fb..169ed47 100644 |
| 25 | +--- a/drivers/clk/rockchip/clk-rk3588.c |
| 26 | ++++ b/drivers/clk/rockchip/clk-rk3588.c |
| 27 | +@@ -896,7 +896,7 @@ static struct rockchip_clk_branch rk3588_early_clk_branches[] __initdata = { |
| 28 | + MUX(I2S2_2CH_MCLKOUT, "i2s2_2ch_mclkout", i2s2_2ch_mclkout_p, CLK_SET_RATE_PARENT, |
| 29 | + RK3588_CLKSEL_CON(30), 2, 1, MFLAGS), |
| 30 | + GATE_GRF(I2S2_2CH_MCLKOUT_TO_IO, "i2s2_2ch_mclkout_to_io", "i2s2_2ch_mclkout", |
| 31 | +- 0, RK3588_SYSGRF_SOC_CON6, 2, GFLAGS, grf_type_sys), |
| 32 | ++ CLK_IGNORE_UNUSED, RK3588_SYSGRF_SOC_CON6, 2, GFLAGS, grf_type_sys), |
| 33 | + |
| 34 | + COMPOSITE(CLK_I2S3_2CH_SRC, "clk_i2s3_2ch_src", gpll_aupll_p, 0, |
| 35 | + RK3588_CLKSEL_CON(30), 8, 1, MFLAGS, 3, 5, DFLAGS, |
| 36 | +@@ -913,7 +913,7 @@ static struct rockchip_clk_branch rk3588_early_clk_branches[] __initdata = { |
| 37 | + MUX(I2S3_2CH_MCLKOUT, "i2s3_2ch_mclkout", i2s3_2ch_mclkout_p, CLK_SET_RATE_PARENT, |
| 38 | + RK3588_CLKSEL_CON(32), 2, 1, MFLAGS), |
| 39 | + GATE_GRF(I2S3_2CH_MCLKOUT_TO_IO, "i2s3_2ch_mclkout_to_io", "i2s3_2ch_mclkout", |
| 40 | +- 0, RK3588_SYSGRF_SOC_CON6, 7, GFLAGS, grf_type_sys), |
| 41 | ++ CLK_IGNORE_UNUSED, RK3588_SYSGRF_SOC_CON6, 7, GFLAGS, grf_type_sys), |
| 42 | + GATE(PCLK_ACDCDIG, "pclk_acdcdig", "pclk_audio_root", 0, |
| 43 | + RK3588_CLKGATE_CON(7), 11, GFLAGS), |
| 44 | + GATE(HCLK_I2S0_8CH, "hclk_i2s0_8ch", "hclk_audio_root", 0, |
| 45 | +@@ -943,7 +943,7 @@ static struct rockchip_clk_branch rk3588_early_clk_branches[] __initdata = { |
| 46 | + MUX(I2S0_8CH_MCLKOUT, "i2s0_8ch_mclkout", i2s0_8ch_mclkout_p, CLK_SET_RATE_PARENT, |
| 47 | + RK3588_CLKSEL_CON(28), 2, 2, MFLAGS), |
| 48 | + GATE_GRF(I2S0_8CH_MCLKOUT_TO_IO, "i2s0_8ch_mclkout_to_io", "i2s0_8ch_mclkout", |
| 49 | +- 0, RK3588_SYSGRF_SOC_CON6, 0, GFLAGS, grf_type_sys), |
| 50 | ++ CLK_IGNORE_UNUSED, RK3588_SYSGRF_SOC_CON6, 0, GFLAGS, grf_type_sys), |
| 51 | + |
| 52 | + GATE(HCLK_PDM1, "hclk_pdm1", "hclk_audio_root", 0, |
| 53 | + RK3588_CLKGATE_CON(9), 6, GFLAGS), |
| 54 | +@@ -2230,7 +2230,7 @@ static struct rockchip_clk_branch rk3588_early_clk_branches[] __initdata = { |
| 55 | + MUX(I2S1_8CH_MCLKOUT, "i2s1_8ch_mclkout", i2s1_8ch_mclkout_p, CLK_SET_RATE_PARENT, |
| 56 | + RK3588_PMU_CLKSEL_CON(9), 2, 2, MFLAGS), |
| 57 | + GATE_GRF(I2S1_8CH_MCLKOUT_TO_IO, "i2s1_8ch_mclkout_to_io", "i2s1_8ch_mclkout", |
| 58 | +- 0, RK3588_SYSGRF_SOC_CON6, 1, GFLAGS, grf_type_sys), |
| 59 | ++ CLK_IGNORE_UNUSED, RK3588_SYSGRF_SOC_CON6, 1, GFLAGS, grf_type_sys), |
| 60 | + GATE(PCLK_PMU1, "pclk_pmu1", "pclk_pmu0_root", CLK_IS_CRITICAL, |
| 61 | + RK3588_PMU_CLKGATE_CON(1), 0, GFLAGS), |
| 62 | + GATE(CLK_DDR_FAIL_SAFE, "clk_ddr_fail_safe", "clk_pmu0", CLK_IGNORE_UNUSED, |
| 63 | +-- |
| 64 | +Armbian |
0 commit comments