clk: meson: axg-audio: migrate to the new parent description method
PATCH 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")
--- drivers/clk/meson/Kconfig | 1 - drivers/clk/meson/axg-audio.c | 253 ++++++++++++++++------------------ 2 files changed, 116 insertions(+), 138 deletions(-)
drivers/clk/meson/Kconfig +0 -1
@@ -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 +116 -137
452 lines not on this page · raw message
Signature · 1 line
2.17.1
Jerome Brunet
maintainerQuoted 22 lines · Alexandre Mergnat
drivers/clk/meson/axg-audio.c +1
-2@@ -15,7 +15,6 @@#include <linux/slab.h> #include "axg-audio.h" -#include "clk-input.h" #include "clk-regmap.h" #include "clk-phase.h" #include "sclk-div.h" @@ -24,7 +23,7 @@#define AUD_SLV_SCLK_COUNT 10#define AUD_SLV_LRCLK_COUNT 10 -#define AUD_GATE (_name, _reg, _bit, _pname, _iflags) \ +#define AUD_GATE (_name, _reg, _bit, _phws, _iflags) \ struct clk_regmap aud_##_name = { \ .data = &(struct clk_regmap_gate_data){ \ .offset = (_reg), \
drivers/clk/meson/axg-audio.c struct clk_regmap aud_##_name = { \ · line 35
Quoted 5 lines
drivers/clk/meson/axg-audio.c +1
-1@@ -33,13 +32,13 @@ struct clk_regmap aud_##_name = { \ .hw.init = &(struct clk_init_data) { \ .name = "aud_"#_name, \ .ops = &clk_regmap_gate_ops, \ - .parent_names = (const char *[]){ _pname }, \ + .parent_hws = (const struct clk_hw *[]) { &_phws.hw }, \
Those '\' are aligned with tabs. please check, you have aligned a few with spaces instead
Quoted 1 line
drivers/clk/meson/axg-audio.c +0
-0.num_parents = 1, \