forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/clk/at91/clk-i2s-mux.c
....@@ -14,7 +14,7 @@
1414
1515 #include <soc/at91/atmel-sfr.h>
1616
17
-#define I2S_BUS_NR 2
17
+#include "pmc.h"
1818
1919 struct clk_i2s_mux {
2020 struct clk_hw hw;
....@@ -48,7 +48,7 @@
4848 .determine_rate = __clk_mux_determine_rate,
4949 };
5050
51
-static struct clk_hw * __init
51
+struct clk_hw * __init
5252 at91_clk_i2s_mux_register(struct regmap *regmap, const char *name,
5353 const char * const *parent_names,
5454 unsigned int num_parents, u8 bus_id)
....@@ -78,39 +78,3 @@
7878
7979 return &i2s_ck->hw;
8080 }
81
-
82
-static void __init of_sama5d2_clk_i2s_mux_setup(struct device_node *np)
83
-{
84
- struct regmap *regmap_sfr;
85
- u8 bus_id;
86
- const char *parent_names[2];
87
- struct device_node *i2s_mux_np;
88
- struct clk_hw *hw;
89
- int ret;
90
-
91
- regmap_sfr = syscon_regmap_lookup_by_compatible("atmel,sama5d2-sfr");
92
- if (IS_ERR(regmap_sfr))
93
- return;
94
-
95
- for_each_child_of_node(np, i2s_mux_np) {
96
- if (of_property_read_u8(i2s_mux_np, "reg", &bus_id))
97
- continue;
98
-
99
- if (bus_id > I2S_BUS_NR)
100
- continue;
101
-
102
- ret = of_clk_parent_fill(i2s_mux_np, parent_names, 2);
103
- if (ret != 2)
104
- continue;
105
-
106
- hw = at91_clk_i2s_mux_register(regmap_sfr, i2s_mux_np->name,
107
- parent_names, 2, bus_id);
108
- if (IS_ERR(hw))
109
- continue;
110
-
111
- of_clk_add_hw_provider(i2s_mux_np, of_clk_hw_simple_get, hw);
112
- }
113
-}
114
-
115
-CLK_OF_DECLARE(sama5d2_clk_i2s_mux, "atmel,sama5d2-clk-i2s-mux",
116
- of_sama5d2_clk_i2s_mux_setup);