Skip to content

Commit 81c7fca

Browse files
jbrun3tsuperna9999
authored andcommitted
clk: meson: switch gxbb ao_clk to clk_regmap
Drop the gxbb ao specific regmap based clock and use the meson clk_regmap based clock instead. Signed-off-by: Jerome Brunet <[email protected]> Signed-off-by: Neil Armstrong <[email protected]>
1 parent ea11dda commit 81c7fca

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

drivers/clk/meson/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ config COMMON_CLK_GXBB
2020
bool
2121
depends on COMMON_CLK_AMLOGIC
2222
select RESET_CONTROLLER
23+
select COMMON_CLK_REGMAP_MESON
2324
help
2425
Support for the clock controller on AmLogic S905 devices, aka gxbb.
2526
Say Y if you want peripherals and CPU frequency scaling to work.

drivers/clk/meson/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-cpu.o clk-mpll.o clk-audio-divider.o
66
obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o
7-
obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o gxbb-aoclk-regmap.o gxbb-aoclk-32k.o
7+
obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o gxbb-aoclk-32k.o
88
obj-$(CONFIG_COMMON_CLK_AXG) += axg.o
99
obj-$(CONFIG_COMMON_CLK_REGMAP_MESON) += clk-regmap.o

drivers/clk/meson/gxbb-aoclk.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@
6262
#include <linux/delay.h>
6363
#include <dt-bindings/clock/gxbb-aoclkc.h>
6464
#include <dt-bindings/reset/gxbb-aoclkc.h>
65+
#include "clk-regmap.h"
6566
#include "gxbb-aoclk.h"
6667

67-
static DEFINE_SPINLOCK(gxbb_aoclk_lock);
68-
6968
struct gxbb_aoclk_reset_controller {
7069
struct reset_controller_dev reset;
7170
unsigned int *data;
@@ -87,12 +86,14 @@ static const struct reset_control_ops gxbb_aoclk_reset_ops = {
8786
};
8887

8988
#define GXBB_AO_GATE(_name, _bit) \
90-
static struct aoclk_gate_regmap _name##_ao = { \
91-
.bit_idx = (_bit), \
92-
.lock = &gxbb_aoclk_lock, \
89+
static struct clk_regmap _name##_ao = { \
90+
.data = &(struct clk_regmap_gate_data) { \
91+
.offset = AO_RTI_GEN_CNTL_REG0, \
92+
.bit_idx = (_bit), \
93+
}, \
9394
.hw.init = &(struct clk_init_data) { \
9495
.name = #_name "_ao", \
95-
.ops = &meson_aoclk_gate_regmap_ops, \
96+
.ops = &clk_regmap_gate_ops, \
9697
.parent_names = (const char *[]){ "clk81" }, \
9798
.num_parents = 1, \
9899
.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), \
@@ -107,7 +108,6 @@ GXBB_AO_GATE(uart2, 5);
107108
GXBB_AO_GATE(ir_blaster, 6);
108109

109110
static struct aoclk_cec_32k cec_32k_ao = {
110-
.lock = &gxbb_aoclk_lock,
111111
.hw.init = &(struct clk_init_data) {
112112
.name = "cec_32k_ao",
113113
.ops = &meson_aoclk_cec_32k_ops,
@@ -126,7 +126,7 @@ static unsigned int gxbb_aoclk_reset[] = {
126126
[RESET_AO_IR_BLASTER] = 23,
127127
};
128128

129-
static struct aoclk_gate_regmap *gxbb_aoclk_gate[] = {
129+
static struct clk_regmap *gxbb_aoclk_gate[] = {
130130
[CLKID_AO_REMOTE] = &remote_ao,
131131
[CLKID_AO_I2C_MASTER] = &i2c_master_ao,
132132
[CLKID_AO_I2C_SLAVE] = &i2c_slave_ao,
@@ -177,10 +177,10 @@ static int gxbb_aoclkc_probe(struct platform_device *pdev)
177177
* Populate regmap and register all clks
178178
*/
179179
for (clkid = 0; clkid < ARRAY_SIZE(gxbb_aoclk_gate); clkid++) {
180-
gxbb_aoclk_gate[clkid]->regmap = regmap;
180+
gxbb_aoclk_gate[clkid]->map = regmap;
181181

182182
ret = devm_clk_hw_register(dev,
183-
gxbb_aoclk_onecell_data.hws[clkid]);
183+
gxbb_aoclk_onecell_data.hws[clkid]);
184184
if (ret)
185185
return ret;
186186
}

drivers/clk/meson/gxbb-aoclk.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ extern const struct clk_ops meson_aoclk_gate_regmap_ops;
3232
struct aoclk_cec_32k {
3333
struct clk_hw hw;
3434
struct regmap *regmap;
35-
spinlock_t *lock;
3635
};
3736

3837
#define to_aoclk_cec_32k(_hw) container_of(_hw, struct aoclk_cec_32k, hw)

0 commit comments

Comments
 (0)