Skip to content

Commit 085a4ea

Browse files
Jian Husuperna9999
authored andcommitted
clk: meson: g12a: add peripheral clock controller
Add the peripheral clock controller found in the g12a SoC family Signed-off-by: Jian Hu <jian.hu@amlogic.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Link: https://lkml.kernel.org/r/20190201145345.6795-4-jbrunet@baylibre.com
1 parent 25db146 commit 085a4ea

File tree

5 files changed

+2594
-2
lines changed

5 files changed

+2594
-2
lines changed

drivers/clk/meson/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,15 @@ config COMMON_CLK_AXG_AUDIO
8888
help
8989
Support for the audio clock controller on AmLogic A113D devices,
9090
aka axg, Say Y if you want audio subsystem to work.
91+
92+
config COMMON_CLK_G12A
93+
bool
94+
depends on ARCH_MESON
95+
select COMMON_CLK_MESON_INPUT
96+
select COMMON_CLK_MESON_REGMAP
97+
select COMMON_CLK_MESON_MPLL
98+
select COMMON_CLK_MESON_PLL
99+
select MFD_SYSCON
100+
help
101+
Support for the clock controller on Amlogic S905D2, S905X2 and S905Y2
102+
devices, aka g12a. Say Y if you want peripherals to work.

drivers/clk/meson/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ obj-$(CONFIG_COMMON_CLK_MESON_VID_PLL_DIV) += vid-pll-div.o
1515
obj-$(CONFIG_COMMON_CLK_AXG) += axg.o axg-aoclk.o
1616
obj-$(CONFIG_COMMON_CLK_AXG_AUDIO) += axg-audio.o
1717
obj-$(CONFIG_COMMON_CLK_GXBB) += gxbb.o gxbb-aoclk.o
18+
obj-$(CONFIG_COMMON_CLK_G12A) += g12a.o
1819
obj-$(CONFIG_COMMON_CLK_MESON8B) += meson8b.o

drivers/clk/meson/clk-regmap.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,24 @@ clk_get_regmap_mux_data(struct clk_regmap *clk)
111111
extern const struct clk_ops clk_regmap_mux_ops;
112112
extern const struct clk_ops clk_regmap_mux_ro_ops;
113113

114-
#define MESON_GATE(_name, _reg, _bit) \
114+
#define __MESON_GATE(_name, _reg, _bit, _ops) \
115115
struct clk_regmap _name = { \
116116
.data = &(struct clk_regmap_gate_data){ \
117117
.offset = (_reg), \
118118
.bit_idx = (_bit), \
119119
}, \
120120
.hw.init = &(struct clk_init_data) { \
121121
.name = #_name, \
122-
.ops = &clk_regmap_gate_ops, \
122+
.ops = _ops, \
123123
.parent_names = (const char *[]){ "clk81" }, \
124124
.num_parents = 1, \
125125
.flags = (CLK_SET_RATE_PARENT | CLK_IGNORE_UNUSED), \
126126
}, \
127127
}
128128

129+
#define MESON_GATE(_name, _reg, _bit) \
130+
__MESON_GATE(_name, _reg, _bit, &clk_regmap_gate_ops)
131+
132+
#define MESON_GATE_RO(_name, _reg, _bit) \
133+
__MESON_GATE(_name, _reg, _bit, &clk_regmap_gate_ro_ops)
129134
#endif /* __CLK_REGMAP_H */

0 commit comments

Comments
 (0)