Skip to contentSkip to conversation

clk: meson: axg-audio: migrate to the new parent description method

PATCH In review Alexandre Mergnat 2 participants 2 messages Jul 25, 2019 – Jul 29, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 clk: meson: axg-audio: migrate to the new parent description method

This clock controller use the string comparison method to describe parent relation between the clocks, which is not optimized. A recent patch [0] allows parents to be specified without string names or with device-tree clock name by using a new assignment structure.

Migrate to the new way by using .parent_hws where possible (when parent clocks are localy declared in the controller) and use .parent_data otherwise.

Remove clk input helper and all bypass clocks (declared in probe function) which are no longer used since we are able to use device-tree clock name directly.

[0] commit fc0c209c147f ("clk: Allow parents to be specified without string names")

---

Change since v1:
- Typo fixes

 drivers/clk/meson/Kconfig     |   1 -
 drivers/clk/meson/axg-audio.c | 261 ++++++++++++++++------------------
 2 files changed, 120 insertions(+), 142 deletions(-)
drivers/clk/meson/Kconfig +0 -1
index a6b20e123e0c..ee0b84b6b329 100644
@@ -86,7 +86,6 @@ config COMMON_CLK_AXG
 config COMMON_CLK_AXG_AUDIO
 	tristate "Meson AXG Audio Clock Controller Driver"
 	depends on ARCH_MESON
-	select COMMON_CLK_MESON_INPUT
 	select COMMON_CLK_MESON_REGMAP
 	select COMMON_CLK_MESON_PHASE
 	select COMMON_CLK_MESON_SCLK_DIV
drivers/clk/meson/axg-audio.c +120 -141

457 lines not on this page · raw message

Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#1 lore raw
Quoted 9 lines · Alexandre Mergnat

/* Audio Master Clocks */

drivers/clk/meson/axg-audio.c +5 -3
-static const char * const mst_mux_parent_names[] = {
-	"aud_mst_in0", "aud_mst_in1", "aud_mst_in2", "aud_mst_in3",
-	"aud_mst_in4", "aud_mst_in5", "aud_mst_in6", "aud_mst_in7",
+static const struct clk_parent_data mst_mux_parent_data[] = {
+	{ .fw_name = "mst_in0", },
+	{ .fw_name = "mst_in1", },
+	{ .fw_name = "mst_in2", },
+	{ .fw_name = "mst_in3", },

drivers/clk/meson/axg-audio.c static AUD_PCLK_GATE(power_detect, 19); · line 127

Quoted 10 lines
drivers/clk/meson/axg-audio.c +5 -1
+	{ .fw_name = "mst_in4", },
+	{ .fw_name = "mst_in5", },
+	{ .fw_name = "mst_in6", },
+	{ .fw_name = "mst_in7", },
 };
 
 #define AUD_MST_MUX(_name, _reg, _flag)				\
 	AUD_MUX(_name##_sel, _reg, 0x7, 24, _flag,		\
-		mst_mux_parent_names, CLK_SET_RATE_PARENT)
+		mst_mux_parent_data, CLK_SET_RATE_PARENT)

Actually, you should have dropped the CLK_SET_RATE_PARENT above.

Before, the rate propagation was stopped by the input clock but now, there no such thing so the rate propagation must be stopped here.

It was almost impossible to know without testing audio, so fixed it when applying the change.

Thanks for this rework !