Commit 81c7fcac authored by Jerome Brunet's avatar Jerome Brunet Committed by Neil Armstrong

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: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
parent ea11dda9
...@@ -20,6 +20,7 @@ config COMMON_CLK_GXBB ...@@ -20,6 +20,7 @@ config COMMON_CLK_GXBB
bool bool
depends on COMMON_CLK_AMLOGIC depends on COMMON_CLK_AMLOGIC
select RESET_CONTROLLER select RESET_CONTROLLER
select COMMON_CLK_REGMAP_MESON
help help
Support for the clock controller on AmLogic S905 devices, aka gxbb. Support for the clock controller on AmLogic S905 devices, aka gxbb.
Say Y if you want peripherals and CPU frequency scaling to work. Say Y if you want peripherals and CPU frequency scaling to work.
......
...@@ -4,6 +4,6 @@ ...@@ -4,6 +4,6 @@
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-cpu.o clk-mpll.o clk-audio-divider.o obj-$(CONFIG_COMMON_CLK_AMLOGIC) += clk-pll.o clk-cpu.o clk-mpll.o clk-audio-divider.o
obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o
obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o gxbb-aoclk-regmap.o gxbb-aoclk-32k.o obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o gxbb-aoclk-32k.o
obj-$(CONFIG_COMMON_CLK_AXG) += axg.o obj-$(CONFIG_COMMON_CLK_AXG) += axg.o
obj-$(CONFIG_COMMON_CLK_REGMAP_MESON) += clk-regmap.o obj-$(CONFIG_COMMON_CLK_REGMAP_MESON) += clk-regmap.o
...@@ -62,10 +62,9 @@ ...@@ -62,10 +62,9 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <dt-bindings/clock/gxbb-aoclkc.h> #include <dt-bindings/clock/gxbb-aoclkc.h>
#include <dt-bindings/reset/gxbb-aoclkc.h> #include <dt-bindings/reset/gxbb-aoclkc.h>
#include "clk-regmap.h"
#include "gxbb-aoclk.h" #include "gxbb-aoclk.h"
static DEFINE_SPINLOCK(gxbb_aoclk_lock);
struct gxbb_aoclk_reset_controller { struct gxbb_aoclk_reset_controller {
struct reset_controller_dev reset; struct reset_controller_dev reset;
unsigned int *data; unsigned int *data;
...@@ -87,12 +86,14 @@ static const struct reset_control_ops gxbb_aoclk_reset_ops = { ...@@ -87,12 +86,14 @@ static const struct reset_control_ops gxbb_aoclk_reset_ops = {
}; };
#define GXBB_AO_GATE(_name, _bit) \ #define GXBB_AO_GATE(_name, _bit) \
static struct aoclk_gate_regmap _name##_ao = { \ static struct clk_regmap _name##_ao = { \
.bit_idx = (_bit), \ .data = &(struct clk_regmap_gate_data) { \
.lock = &gxbb_aoclk_lock, \ .offset = AO_RTI_GEN_CNTL_REG0, \
.bit_idx = (_bit), \
}, \
.hw.init = &(struct clk_init_data) { \ .hw.init = &(struct clk_init_data) { \
.name = #_name "_ao", \ .name = #_name "_ao", \
.ops = &meson_aoclk_gate_regmap_ops, \ .ops = &clk_regmap_gate_ops, \
.parent_names = (const char *[]){ "clk81" }, \ .parent_names = (const char *[]){ "clk81" }, \
.num_parents = 1, \ .num_parents = 1, \
.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), \ .flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), \
...@@ -107,7 +108,6 @@ GXBB_AO_GATE(uart2, 5); ...@@ -107,7 +108,6 @@ GXBB_AO_GATE(uart2, 5);
GXBB_AO_GATE(ir_blaster, 6); GXBB_AO_GATE(ir_blaster, 6);
static struct aoclk_cec_32k cec_32k_ao = { static struct aoclk_cec_32k cec_32k_ao = {
.lock = &gxbb_aoclk_lock,
.hw.init = &(struct clk_init_data) { .hw.init = &(struct clk_init_data) {
.name = "cec_32k_ao", .name = "cec_32k_ao",
.ops = &meson_aoclk_cec_32k_ops, .ops = &meson_aoclk_cec_32k_ops,
...@@ -126,7 +126,7 @@ static unsigned int gxbb_aoclk_reset[] = { ...@@ -126,7 +126,7 @@ static unsigned int gxbb_aoclk_reset[] = {
[RESET_AO_IR_BLASTER] = 23, [RESET_AO_IR_BLASTER] = 23,
}; };
static struct aoclk_gate_regmap *gxbb_aoclk_gate[] = { static struct clk_regmap *gxbb_aoclk_gate[] = {
[CLKID_AO_REMOTE] = &remote_ao, [CLKID_AO_REMOTE] = &remote_ao,
[CLKID_AO_I2C_MASTER] = &i2c_master_ao, [CLKID_AO_I2C_MASTER] = &i2c_master_ao,
[CLKID_AO_I2C_SLAVE] = &i2c_slave_ao, [CLKID_AO_I2C_SLAVE] = &i2c_slave_ao,
...@@ -177,10 +177,10 @@ static int gxbb_aoclkc_probe(struct platform_device *pdev) ...@@ -177,10 +177,10 @@ static int gxbb_aoclkc_probe(struct platform_device *pdev)
* Populate regmap and register all clks * Populate regmap and register all clks
*/ */
for (clkid = 0; clkid < ARRAY_SIZE(gxbb_aoclk_gate); clkid++) { for (clkid = 0; clkid < ARRAY_SIZE(gxbb_aoclk_gate); clkid++) {
gxbb_aoclk_gate[clkid]->regmap = regmap; gxbb_aoclk_gate[clkid]->map = regmap;
ret = devm_clk_hw_register(dev, ret = devm_clk_hw_register(dev,
gxbb_aoclk_onecell_data.hws[clkid]); gxbb_aoclk_onecell_data.hws[clkid]);
if (ret) if (ret)
return ret; return ret;
} }
......
...@@ -32,7 +32,6 @@ extern const struct clk_ops meson_aoclk_gate_regmap_ops; ...@@ -32,7 +32,6 @@ extern const struct clk_ops meson_aoclk_gate_regmap_ops;
struct aoclk_cec_32k { struct aoclk_cec_32k {
struct clk_hw hw; struct clk_hw hw;
struct regmap *regmap; struct regmap *regmap;
spinlock_t *lock;
}; };
#define to_aoclk_cec_32k(_hw) container_of(_hw, struct aoclk_cec_32k, hw) #define to_aoclk_cec_32k(_hw) container_of(_hw, struct aoclk_cec_32k, hw)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment