Skip to content

Commit cf52db4

Browse files
committed
clk: meson: axg-audio: provide clk top signal name
The peripheral clock on the sm1 goes through some muxes and dividers before reaching the audio gates. To model that, without repeating our self too much, the "top" clock signal is introduced and will serve as a the parent of the gates. On the axg and g12a, the top clock is just a pass-through to the audio peripheral clock provided by the main controller. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Jerome Brunet <[email protected]>
1 parent 8ff93f2 commit cf52db4

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

drivers/clk/meson/axg-audio.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,7 @@
7474
.hw.init = &(struct clk_init_data) { \
7575
.name = "aud_"#_name, \
7676
.ops = &clk_regmap_gate_ops, \
77-
.parent_data = &(const struct clk_parent_data) { \
78-
.fw_name = "pclk", \
79-
}, \
77+
.parent_names = (const char *[]){ "aud_top" }, \
8078
.num_parents = 1, \
8179
}, \
8280
}
@@ -504,6 +502,18 @@ static struct clk_regmap tdmout_c_lrclk =
504502
AUD_TDM_LRLCK(out_c, AUDIO_CLK_TDMOUT_C_CTRL);
505503

506504
/* AXG/G12A Clocks */
505+
static struct clk_hw axg_aud_top = {
506+
.init = &(struct clk_init_data) {
507+
/* Provide aud_top signal name on axg and g12a */
508+
.name = "aud_top",
509+
.ops = &(const struct clk_ops) {},
510+
.parent_data = &(const struct clk_parent_data) {
511+
.fw_name = "pclk",
512+
},
513+
.num_parents = 1,
514+
},
515+
};
516+
507517
static struct clk_regmap mst_a_mclk_sel =
508518
AUD_MST_MCLK_MUX(mst_a_mclk, AUDIO_MCLK_A_CTRL);
509519
static struct clk_regmap mst_b_mclk_sel =
@@ -691,6 +701,7 @@ static struct clk_hw_onecell_data axg_audio_hw_onecell_data = {
691701
[AUD_CLKID_TDMOUT_A_LRCLK] = &tdmout_a_lrclk.hw,
692702
[AUD_CLKID_TDMOUT_B_LRCLK] = &tdmout_b_lrclk.hw,
693703
[AUD_CLKID_TDMOUT_C_LRCLK] = &tdmout_c_lrclk.hw,
704+
[AUD_CLKID_TOP] = &axg_aud_top,
694705
[NR_CLKS] = NULL,
695706
},
696707
.num = NR_CLKS,
@@ -835,6 +846,7 @@ static struct clk_hw_onecell_data g12a_audio_hw_onecell_data = {
835846
[AUD_CLKID_TDM_SCLK_PAD0] = &g12a_tdm_sclk_pad_0.hw,
836847
[AUD_CLKID_TDM_SCLK_PAD1] = &g12a_tdm_sclk_pad_1.hw,
837848
[AUD_CLKID_TDM_SCLK_PAD2] = &g12a_tdm_sclk_pad_2.hw,
849+
[AUD_CLKID_TOP] = &axg_aud_top,
838850
[NR_CLKS] = NULL,
839851
},
840852
.num = NR_CLKS,

drivers/clk/meson/axg-audio.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,10 @@
116116
#define AUD_CLKID_SPDIFOUT_B_CLK_SEL 153
117117
#define AUD_CLKID_SPDIFOUT_B_CLK_DIV 154
118118

119+
119120
/* include the CLKIDs which are part of the DT bindings */
120121
#include <dt-bindings/clock/axg-audio-clkc.h>
121122

122-
#define NR_CLKS 163
123+
#define NR_CLKS 164
123124

124125
#endif /*__AXG_AUDIO_CLKC_H */

0 commit comments

Comments
 (0)