mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 14:41:22 -05:00
clk: spacemit: fix sspax_clk
Hardware Requirement:
BIT[3] of this register must be set if need to select i2s_bclk as
SSPA parent clock, to solve this, introduces a new SSPAx_I2S_BCLK
clock as the virtual gate clock.
Fixes: 1b72c59db0 ("clk: spacemit: Add clock support for SpacemiT K1 SoC")
Suggested-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Haylen Chu <heylenay@4d2.org>
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
Link: https://lore.kernel.org/r/20250811-k1-clk-i2s-v5-2-ebadd06e1e91@linux.spacemit.com
Signed-off-by: Yixun Lan <dlan@gentoo.org>
This commit is contained in:
@@ -247,7 +247,14 @@ CCU_GATE_DEFINE(aib_clk, CCU_PARENT_NAME(vctcxo_24m), APBC_AIB_CLK_RST, BIT(1),
|
||||
|
||||
CCU_GATE_DEFINE(onewire_clk, CCU_PARENT_NAME(vctcxo_24m), APBC_ONEWIRE_CLK_RST, BIT(1), 0);
|
||||
|
||||
static const struct clk_parent_data sspa_parents[] = {
|
||||
/*
|
||||
* When i2s_bclk is selected as the parent clock of sspa,
|
||||
* the hardware requires bit3 to be set
|
||||
*/
|
||||
CCU_GATE_DEFINE(sspa0_i2s_bclk, CCU_PARENT_HW(i2s_bclk), APBC_SSPA0_CLK_RST, BIT(3), 0);
|
||||
CCU_GATE_DEFINE(sspa1_i2s_bclk, CCU_PARENT_HW(i2s_bclk), APBC_SSPA1_CLK_RST, BIT(3), 0);
|
||||
|
||||
static const struct clk_parent_data sspa0_parents[] = {
|
||||
CCU_PARENT_HW(pll1_d384_6p4),
|
||||
CCU_PARENT_HW(pll1_d192_12p8),
|
||||
CCU_PARENT_HW(pll1_d96_25p6),
|
||||
@@ -255,10 +262,22 @@ static const struct clk_parent_data sspa_parents[] = {
|
||||
CCU_PARENT_HW(pll1_d768_3p2),
|
||||
CCU_PARENT_HW(pll1_d1536_1p6),
|
||||
CCU_PARENT_HW(pll1_d3072_0p8),
|
||||
CCU_PARENT_HW(i2s_bclk),
|
||||
CCU_PARENT_HW(sspa0_i2s_bclk),
|
||||
};
|
||||
CCU_MUX_GATE_DEFINE(sspa0_clk, sspa_parents, APBC_SSPA0_CLK_RST, 4, 3, BIT(1), 0);
|
||||
CCU_MUX_GATE_DEFINE(sspa1_clk, sspa_parents, APBC_SSPA1_CLK_RST, 4, 3, BIT(1), 0);
|
||||
CCU_MUX_GATE_DEFINE(sspa0_clk, sspa0_parents, APBC_SSPA0_CLK_RST, 4, 3, BIT(1), 0);
|
||||
|
||||
static const struct clk_parent_data sspa1_parents[] = {
|
||||
CCU_PARENT_HW(pll1_d384_6p4),
|
||||
CCU_PARENT_HW(pll1_d192_12p8),
|
||||
CCU_PARENT_HW(pll1_d96_25p6),
|
||||
CCU_PARENT_HW(pll1_d48_51p2),
|
||||
CCU_PARENT_HW(pll1_d768_3p2),
|
||||
CCU_PARENT_HW(pll1_d1536_1p6),
|
||||
CCU_PARENT_HW(pll1_d3072_0p8),
|
||||
CCU_PARENT_HW(sspa1_i2s_bclk),
|
||||
};
|
||||
CCU_MUX_GATE_DEFINE(sspa1_clk, sspa1_parents, APBC_SSPA1_CLK_RST, 4, 3, BIT(1), 0);
|
||||
|
||||
CCU_GATE_DEFINE(dro_clk, CCU_PARENT_HW(apb_clk), APBC_DRO_CLK_RST, BIT(1), 0);
|
||||
CCU_GATE_DEFINE(ir_clk, CCU_PARENT_HW(apb_clk), APBC_IR_CLK_RST, BIT(1), 0);
|
||||
CCU_GATE_DEFINE(tsen_clk, CCU_PARENT_HW(apb_clk), APBC_TSEN_CLK_RST, BIT(1), 0);
|
||||
@@ -865,6 +884,8 @@ static struct clk_hw *k1_ccu_apbc_hws[] = {
|
||||
[CLK_SSPA1_BUS] = &sspa1_bus_clk.common.hw,
|
||||
[CLK_TSEN_BUS] = &tsen_bus_clk.common.hw,
|
||||
[CLK_IPC_AP2AUD_BUS] = &ipc_ap2aud_bus_clk.common.hw,
|
||||
[CLK_SSPA0_I2S_BCLK] = &sspa0_i2s_bclk.common.hw,
|
||||
[CLK_SSPA1_I2S_BCLK] = &sspa1_i2s_bclk.common.hw,
|
||||
};
|
||||
|
||||
static const struct spacemit_ccu_data k1_ccu_apbc_data = {
|
||||
|
||||
Reference in New Issue
Block a user