clk: mediatek: Consistently use GATE_MTK() macro
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 6 Mar 2023 14:05:11 +0000 (15:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:32 +0000 (23:03 +0900)
[ Upstream commit 4c85e20b656607897e3bb06ff565822fa4b4de95 ]

All the various MediaTek clock drivers are, in a way or another,
redefining the GATE_MTK() macro with different names: while some
are doing that by actually using GATE_MTK(), others are copying
it entirely (hence, entirely redefining it).

Change all clock drivers to always and consistently use this macro.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Chen-Yu Tsai <wenst@chromium.org> # MT8183, MT8192, MT8195 Chromebooks
Link: https://lore.kernel.org/r/20230306140543.1813621-23-angelogioacchino.delregno@collabora.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Stable-dep-of: fa8c0d01df62 ("clk: mediatek: mt7622: Properly use CLK_IS_CRITICAL flag")
Signed-off-by: Sasha Levin <sashal@kernel.org>
47 files changed:
drivers/clk/mediatek/clk-mt2701-aud.c
drivers/clk/mediatek/clk-mt2701-bdp.c
drivers/clk/mediatek/clk-mt2701-eth.c
drivers/clk/mediatek/clk-mt2701-g3d.c
drivers/clk/mediatek/clk-mt2701-hif.c
drivers/clk/mediatek/clk-mt2701-img.c
drivers/clk/mediatek/clk-mt2701-mm.c
drivers/clk/mediatek/clk-mt2701-vdec.c
drivers/clk/mediatek/clk-mt2701.c
drivers/clk/mediatek/clk-mt2712-bdp.c
drivers/clk/mediatek/clk-mt2712-img.c
drivers/clk/mediatek/clk-mt2712-jpgdec.c
drivers/clk/mediatek/clk-mt2712-mfg.c
drivers/clk/mediatek/clk-mt2712-mm.c
drivers/clk/mediatek/clk-mt2712-vdec.c
drivers/clk/mediatek/clk-mt2712-venc.c
drivers/clk/mediatek/clk-mt2712.c
drivers/clk/mediatek/clk-mt6765-audio.c
drivers/clk/mediatek/clk-mt6765-cam.c
drivers/clk/mediatek/clk-mt6765-img.c
drivers/clk/mediatek/clk-mt6765-mipi0a.c
drivers/clk/mediatek/clk-mt6765-mm.c
drivers/clk/mediatek/clk-mt6765-vcodec.c
drivers/clk/mediatek/clk-mt6765.c
drivers/clk/mediatek/clk-mt6797-img.c
drivers/clk/mediatek/clk-mt6797-mm.c
drivers/clk/mediatek/clk-mt6797-vdec.c
drivers/clk/mediatek/clk-mt6797-venc.c
drivers/clk/mediatek/clk-mt6797.c
drivers/clk/mediatek/clk-mt7622-aud.c
drivers/clk/mediatek/clk-mt7622-eth.c
drivers/clk/mediatek/clk-mt7622-hif.c
drivers/clk/mediatek/clk-mt7622.c
drivers/clk/mediatek/clk-mt7629-eth.c
drivers/clk/mediatek/clk-mt7629-hif.c
drivers/clk/mediatek/clk-mt7629.c
drivers/clk/mediatek/clk-mt7986-eth.c
drivers/clk/mediatek/clk-mt7986-infracfg.c
drivers/clk/mediatek/clk-mt8135.c
drivers/clk/mediatek/clk-mt8167-aud.c
drivers/clk/mediatek/clk-mt8167-img.c
drivers/clk/mediatek/clk-mt8167-mfgcfg.c
drivers/clk/mediatek/clk-mt8167-mm.c
drivers/clk/mediatek/clk-mt8167-vdec.c
drivers/clk/mediatek/clk-mt8173-mm.c
drivers/clk/mediatek/clk-mt8516-aud.c
drivers/clk/mediatek/clk-mt8516.c

index 6ba398e..4287bd3 100644 (file)
 
 #include <dt-bindings/clock/mt2701-clk.h>
 
-#define GATE_AUDIO0(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio0_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO0(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO1(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio1_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO1(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO2(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio2_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO2(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio2_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO3(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio3_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO3(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio3_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate_regs audio0_cg_regs = {
        .set_ofs = 0x0,
index 435ed48..b0f0572 100644 (file)
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs bdp1_cg_regs = {
        .sta_ofs = 0x0110,
 };
 
-#define GATE_BDP0(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &bdp0_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_BDP0(_id, _name, _parent, _shift)                 \
+       GATE_MTK(_id, _name, _parent, &bdp0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_BDP1(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &bdp1_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_BDP1(_id, _name, _parent, _shift)                 \
+       GATE_MTK(_id, _name, _parent, &bdp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate bdp_clks[] = {
        GATE_BDP0(CLK_BDP_BRG_BA, "brg_baclk", "mm_sel", 0),
index edf1e2e..6013587 100644 (file)
@@ -16,14 +16,8 @@ static const struct mtk_gate_regs eth_cg_regs = {
        .sta_ofs = 0x0030,
 };
 
-#define GATE_ETH(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &eth_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_ETH(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &eth_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate eth_clks[] = {
        GATE_ETH(CLK_ETHSYS_HSDMA, "hsdma_clk", "ethif_sel", 5),
index 1458109..8d1fc8e 100644 (file)
 
 #include <dt-bindings/clock/mt2701-clk.h>
 
-#define GATE_G3D(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &g3d_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_G3D(_id, _name, _parent, _shift)                          \
+       GATE_MTK(_id, _name, _parent, &g3d_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate_regs g3d_cg_regs = {
        .sta_ofs = 0x0,
index 434cbbe..edeeb03 100644 (file)
@@ -16,14 +16,8 @@ static const struct mtk_gate_regs hif_cg_regs = {
        .sta_ofs = 0x0030,
 };
 
-#define GATE_HIF(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &hif_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_HIF(_id, _name, _parent, _shift)                          \
+       GATE_MTK(_id, _name, _parent, &hif_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate hif_clks[] = {
        GATE_HIF(CLK_HIFSYS_USB0PHY, "usb0_phy_clk", "ethpll_500m_ck", 21),
index 7e53deb..eb17247 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs img_cg_regs = {
        .sta_ofs = 0x0000,
 };
 
-#define GATE_IMG(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &img_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IMG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate img_clks[] = {
        GATE_IMG(CLK_IMG_SMI_COMM, "img_smi_comm", "mm_sel", 0),
index 9ea7aba..eb069f3 100644 (file)
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs disp1_cg_regs = {
        .sta_ofs = 0x0110,
 };
 
-#define GATE_DISP0(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &disp0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_DISP0(_id, _name, _parent, _shift)        \
+       GATE_MTK(_id, _name, _parent, &disp0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_DISP1(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &disp1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_DISP1(_id, _name, _parent, _shift)        \
+       GATE_MTK(_id, _name, _parent, &disp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mm_clks[] = {
        GATE_DISP0(CLK_MM_SMI_COMMON, "mm_smi_comm", "mm_sel", 0),
index d3089da..0f07c5d 100644 (file)
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = {
        .sta_ofs = 0x0008,
 };
 
-#define GATE_VDEC0(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &vdec0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VDEC0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_VDEC1(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &vdec1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VDEC1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate vdec_clks[] = {
        GATE_VDEC0(CLK_VDEC_CKGEN, "vdec_cken", "vdec_sel", 0),
index 9b442af..1c3a931 100644 (file)
@@ -636,14 +636,8 @@ static const struct mtk_gate_regs top_aud_cg_regs = {
        .sta_ofs = 0x012C,
 };
 
-#define GATE_TOP_AUD(_id, _name, _parent, _shift) {    \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top_aud_cg_regs,               \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_TOP_AUD(_id, _name, _parent, _shift)                      \
+       GATE_MTK(_id, _name, _parent, &top_aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate top_clks[] = {
        GATE_TOP_AUD(CLK_TOP_AUD_48K_TIMING, "a1sys_hp_ck", "aud_mux1_div",
@@ -701,14 +695,8 @@ static const struct mtk_gate_regs infra_cg_regs = {
        .sta_ofs = 0x0048,
 };
 
-#define GATE_ICG(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &infra_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_ICG(_id, _name, _parent, _shift)                          \
+       GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate infra_clks[] = {
        GATE_ICG(CLK_INFRA_DBG, "dbgclk", "axi_sel", 0),
@@ -822,23 +810,11 @@ static const struct mtk_gate_regs peri1_cg_regs = {
        .sta_ofs = 0x001c,
 };
 
-#define GATE_PERI0(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_PERI0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI1(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_PERI1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate peri_clks[] = {
        GATE_PERI0(CLK_PERI_USB0_MCU, "usb0_mcu_ck", "axi_sel", 31),
index 684d03e..5e66865 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs bdp_cg_regs = {
        .sta_ofs = 0x100,
 };
 
-#define GATE_BDP(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &bdp_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_BDP(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &bdp_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate bdp_clks[] = {
        GATE_BDP(CLK_BDP_BRIDGE_B, "bdp_bridge_b", "mm_sel", 0),
index 335049c..3ffa513 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs img_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_IMG(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &img_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_IMG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate img_clks[] = {
        GATE_IMG(CLK_IMG_SMI_LARB2, "img_smi_larb2", "mm_sel", 0),
index 07ba7c5..8c768d5 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs jpgdec_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_JPGDEC(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &jpgdec_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_JPGDEC(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &jpgdec_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate jpgdec_clks[] = {
        GATE_JPGDEC(CLK_JPGDEC_JPGDEC1, "jpgdec_jpgdec1", "jpgdec_sel", 0),
index 42f8cf3..8949315 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs mfg_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_MFG(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mfg_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_MFG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mfg_clks[] = {
        GATE_MFG(CLK_MFG_BG3D, "mfg_bg3d", "mfg_sel", 0),
index 7d44b09..ad6daa8 100644 (file)
@@ -30,32 +30,14 @@ static const struct mtk_gate_regs mm2_cg_regs = {
        .sta_ofs = 0x220,
 };
 
-#define GATE_MM0(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mm0_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
-
-#define GATE_MM1(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mm1_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
-
-#define GATE_MM2(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mm2_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_MM0(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
+
+#define GATE_MM1(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
+
+#define GATE_MM2(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mm_clks[] = {
        /* MM0 */
index 6296ed5..572290d 100644 (file)
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = {
        .sta_ofs = 0x8,
 };
 
-#define GATE_VDEC0(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &vdec0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VDEC0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_VDEC1(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &vdec1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VDEC1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate vdec_clks[] = {
        /* VDEC0 */
index b9bfc35..9588eb0 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs venc_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_VENC(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &venc_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VENC(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &venc_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate venc_clks[] = {
        GATE_VENC(CLK_VENC_SMI_COMMON_CON, "venc_smi", "mm_sel", 0),
index 7309b58..d6c2cc1 100644 (file)
@@ -958,23 +958,11 @@ static const struct mtk_gate_regs top1_cg_regs = {
        .sta_ofs = 0x424,
 };
 
-#define GATE_TOP0(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top0_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_TOP0(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_TOP1(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top1_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_TOP1(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate top_clks[] = {
        /* TOP0 */
@@ -998,14 +986,8 @@ static const struct mtk_gate_regs infra_cg_regs = {
        .sta_ofs = 0x48,
 };
 
-#define GATE_INFRA(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &infra_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_INFRA(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate infra_clks[] = {
        GATE_INFRA(CLK_INFRA_DBGCLK, "infra_dbgclk", "axi_sel", 0),
@@ -1035,32 +1017,14 @@ static const struct mtk_gate_regs peri2_cg_regs = {
        .sta_ofs = 0x42c,
 };
 
-#define GATE_PERI0(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_PERI0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI1(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_PERI1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI2(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri2_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_PERI2(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri2_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate peri_clks[] = {
        /* PERI0 */
index 0aa6c0d..5682e03 100644 (file)
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs audio1_cg_regs = {
        .sta_ofs = 0x4,
 };
 
-#define GATE_AUDIO0(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio0_cg_regs,                \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO0(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO1(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio1_cg_regs,                \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO1(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate audio_clks[] = {
        /* AUDIO0 */
index 25f2bef..6e7d192 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs cam_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_CAM(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &cam_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_CAM(_id, _name, _parent, _shift)                          \
+       GATE_MTK(_id, _name, _parent, &cam_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate cam_clks[] = {
        GATE_CAM(CLK_CAM_LARB3, "cam_larb3", "mm_ck", 0),
index a62303e..cfbc907 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs img_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_IMG(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &img_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IMG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate img_clks[] = {
        GATE_IMG(CLK_IMG_LARB2, "img_larb2", "mm_ck", 0),
index 25c829f..f2b9dc8 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs mipi0a_cg_regs = {
        .sta_ofs = 0x80,
 };
 
-#define GATE_MIPI0A(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mipi0a_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_MIPI0A(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &mipi0a_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate mipi0a_clks[] = {
        GATE_MIPI0A(CLK_MIPI0A_CSR_CSI_EN_0A,
index bda7746..a4570c9 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs mm_cg_regs = {
        .sta_ofs = 0x100,
 };
 
-#define GATE_MM(_id, _name, _parent, _shift) {         \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mm_cg_regs,                    \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_MM(_id, _name, _parent, _shift)   \
+       GATE_MTK(_id, _name, _parent, &mm_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mm_clks[] = {
        /* MM */
index 2bc1fbd..75d72b9 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs venc_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_VENC(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &venc_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VENC(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &venc_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate venc_clks[] = {
        GATE_VENC(CLK_VENC_SET0_LARB, "venc_set0_larb", "mm_ck", 0),
index e9b9e67..665981f 100644 (file)
@@ -483,32 +483,14 @@ static const struct mtk_gate_regs top2_cg_regs = {
        .sta_ofs = 0x320,
 };
 
-#define GATE_TOP0(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top0_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_TOP0(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_TOP1(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top1_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_TOP1(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
-#define GATE_TOP2(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top2_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_TOP2(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top2_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate top_clks[] = {
        /* TOP0 */
@@ -559,41 +541,17 @@ static const struct mtk_gate_regs ifr5_cg_regs = {
        .sta_ofs = 0xc8,
 };
 
-#define GATE_IFR2(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &ifr2_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IFR2(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &ifr2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_IFR3(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &ifr3_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IFR3(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &ifr3_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_IFR4(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &ifr4_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IFR4(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &ifr4_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_IFR5(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &ifr5_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IFR5(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &ifr5_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate ifr_clks[] = {
        /* INFRA_TOPAXI */
@@ -674,14 +632,8 @@ static const struct mtk_gate_regs apmixed_cg_regs = {
        .sta_ofs = 0x14,
 };
 
-#define GATE_APMIXED(_id, _name, _parent, _shift) {    \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &apmixed_cg_regs,               \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv,         \
-       }
+#define GATE_APMIXED(_id, _name, _parent, _shift)                      \
+       GATE_MTK(_id, _name, _parent, &apmixed_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate apmixed_clks[] = {
        /* AUDIO0 */
index 7c6a53f..0644139 100644 (file)
@@ -16,14 +16,8 @@ static const struct mtk_gate_regs img_cg_regs = {
        .sta_ofs = 0x0000,
 };
 
-#define GATE_IMG(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &img_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IMG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate img_clks[] = {
        GATE_IMG(CLK_IMG_FDVT, "img_fdvt", "mm_sel", 11),
index 0846011..99a63f4 100644 (file)
@@ -23,23 +23,11 @@ static const struct mtk_gate_regs mm1_cg_regs = {
        .sta_ofs = 0x0110,
 };
 
-#define GATE_MM0(_id, _name, _parent, _shift) {                        \
-       .id = _id,                                      \
-       .name = _name,                                  \
-       .parent_name = _parent,                         \
-       .regs = &mm0_cg_regs,                           \
-       .shift = _shift,                                \
-       .ops = &mtk_clk_gate_ops_setclr,                \
-}
+#define GATE_MM0(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_MM1(_id, _name, _parent, _shift) {                        \
-       .id = _id,                                      \
-       .name = _name,                                  \
-       .parent_name = _parent,                         \
-       .regs = &mm1_cg_regs,                           \
-       .shift = _shift,                                \
-       .ops = &mtk_clk_gate_ops_setclr,                \
-}
+#define GATE_MM1(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mm_clks[] = {
        GATE_MM0(CLK_MM_SMI_COMMON, "mm_smi_common", "mm_sel", 0),
index 6120fcc..8622ddd 100644 (file)
@@ -24,23 +24,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = {
        .sta_ofs = 0x0008,
 };
 
-#define GATE_VDEC0(_id, _name, _parent, _shift) {              \
-       .id = _id,                                      \
-       .name = _name,                                  \
-       .parent_name = _parent,                         \
-       .regs = &vdec0_cg_regs,                         \
-       .shift = _shift,                                \
-       .ops = &mtk_clk_gate_ops_setclr_inv,            \
-}
+#define GATE_VDEC0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_VDEC1(_id, _name, _parent, _shift) {              \
-       .id = _id,                                      \
-       .name = _name,                                  \
-       .parent_name = _parent,                         \
-       .regs = &vdec1_cg_regs,                         \
-       .shift = _shift,                                \
-       .ops = &mtk_clk_gate_ops_setclr_inv,            \
-}
+#define GATE_VDEC1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate vdec_clks[] = {
        GATE_VDEC0(CLK_VDEC_CKEN_ENG, "vdec_cken_eng", "vdec_sel", 8),
index 834d383..928d611 100644 (file)
@@ -18,14 +18,8 @@ static const struct mtk_gate_regs venc_cg_regs = {
        .sta_ofs = 0x0000,
 };
 
-#define GATE_VENC(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &venc_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VENC(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &venc_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate venc_clks[] = {
        GATE_VENC(CLK_VENC_0, "venc_0", "mm_sel", 0),
index b89f325..78339cb 100644 (file)
@@ -420,40 +420,22 @@ static const struct mtk_gate_regs infra2_cg_regs = {
        .sta_ofs = 0x00b0,
 };
 
-#define GATE_ICG0(_id, _name, _parent, _shift) {               \
-       .id = _id,                                              \
-       .name = _name,                                          \
-       .parent_name = _parent,                                 \
-       .regs = &infra0_cg_regs,                                \
-       .shift = _shift,                                        \
-       .ops = &mtk_clk_gate_ops_setclr,                        \
-}
+#define GATE_ICG0(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &infra0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_ICG1(_id, _name, _parent, _shift)                 \
-       GATE_ICG1_FLAGS(_id, _name, _parent, _shift, 0)
+#define GATE_ICG1(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &infra1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_ICG1_FLAGS(_id, _name, _parent, _shift, _flags) { \
-       .id = _id,                                              \
-       .name = _name,                                          \
-       .parent_name = _parent,                                 \
-       .regs = &infra1_cg_regs,                                \
-       .shift = _shift,                                        \
-       .ops = &mtk_clk_gate_ops_setclr,                        \
-       .flags = _flags,                                        \
-}
+#define GATE_ICG1_FLAGS(_id, _name, _parent, _shift, _flags)           \
+       GATE_MTK_FLAGS(_id, _name, _parent, &infra1_cg_regs, _shift,    \
+                      &mtk_clk_gate_ops_setclr, _flags)
 
-#define GATE_ICG2(_id, _name, _parent, _shift)                 \
-       GATE_ICG2_FLAGS(_id, _name, _parent, _shift, 0)
+#define GATE_ICG2(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &infra2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_ICG2_FLAGS(_id, _name, _parent, _shift, _flags) { \
-       .id = _id,                                              \
-       .name = _name,                                          \
-       .parent_name = _parent,                                 \
-       .regs = &infra2_cg_regs,                                \
-       .shift = _shift,                                        \
-       .ops = &mtk_clk_gate_ops_setclr,                        \
-       .flags = _flags,                                        \
-}
+#define GATE_ICG2_FLAGS(_id, _name, _parent, _shift, _flags)           \
+       GATE_MTK_FLAGS(_id, _name, _parent, &infra2_cg_regs, _shift,    \
+                      &mtk_clk_gate_ops_setclr, _flags)
 
 /*
  * Clock gates dramc and dramc_b are needed by the DRAM controller.
index 9f2e5aa..b17731f 100644 (file)
 
 #include <dt-bindings/clock/mt7622-clk.h>
 
-#define GATE_AUDIO0(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio0_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO0(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO1(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio1_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO1(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO2(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio2_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO2(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio2_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_AUDIO3(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &audio3_cg_regs,                        \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_AUDIO3(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &audio3_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate_regs audio0_cg_regs = {
        .set_ofs = 0x0,
index 43de047..a60190e 100644 (file)
 
 #include <dt-bindings/clock/mt7622-clk.h>
 
-#define GATE_ETH(_id, _name, _parent, _shift) {        \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &eth_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_ETH(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &eth_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate_regs eth_cg_regs = {
        .set_ofs = 0x30,
@@ -45,14 +39,8 @@ static const struct mtk_gate_regs sgmii_cg_regs = {
        .sta_ofs = 0xE4,
 };
 
-#define GATE_SGMII(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &sgmii_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_SGMII(_id, _name, _parent, _shift)                        \
+       GATE_MTK(_id, _name, _parent, &sgmii_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate sgmii_clks[] = {
        GATE_SGMII(CLK_SGMII_TX250M_EN, "sgmii_tx250m_en",
index 67e9623..55baa6d 100644 (file)
 
 #include <dt-bindings/clock/mt7622-clk.h>
 
-#define GATE_PCIE(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &pcie_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_PCIE(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &pcie_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
-#define GATE_SSUSB(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &ssusb_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_SSUSB(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &ssusb_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate_regs pcie_cg_regs = {
        .set_ofs = 0x30,
index 3b55f86..41b3d03 100644 (file)
                 _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, _pcw_shift,  \
                 NULL, "clkxtal")
 
-#define GATE_APMIXED(_id, _name, _parent, _shift) {                    \
-               .id = _id,                                              \
-               .name = _name,                                          \
-               .parent_name = _parent,                                 \
-               .regs = &apmixed_cg_regs,                               \
-               .shift = _shift,                                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv,                 \
-       }
+#define GATE_APMIXED(_id, _name, _parent, _shift)                      \
+       GATE_MTK(_id, _name, _parent, &apmixed_cg_regs, _shift,         \
+                &mtk_clk_gate_ops_no_setclr_inv)
 
-#define GATE_INFRA(_id, _name, _parent, _shift) {                      \
-               .id = _id,                                              \
-               .name = _name,                                          \
-               .parent_name = _parent,                                 \
-               .regs = &infra_cg_regs,                                 \
-               .shift = _shift,                                        \
-               .ops = &mtk_clk_gate_ops_setclr,                        \
-       }
+#define GATE_INFRA(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_TOP0(_id, _name, _parent, _shift) {                       \
-               .id = _id,                                              \
-               .name = _name,                                          \
-               .parent_name = _parent,                                 \
-               .regs = &top0_cg_regs,                                  \
-               .shift = _shift,                                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,                     \
-       }
+#define GATE_TOP0(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_TOP1(_id, _name, _parent, _shift) {                       \
-               .id = _id,                                              \
-               .name = _name,                                          \
-               .parent_name = _parent,                                 \
-               .regs = &top1_cg_regs,                                  \
-               .shift = _shift,                                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,                     \
-       }
+#define GATE_TOP1(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
-#define GATE_PERI0(_id, _name, _parent, _shift) {                      \
-               .id = _id,                                              \
-               .name = _name,                                          \
-               .parent_name = _parent,                                 \
-               .regs = &peri0_cg_regs,                                 \
-               .shift = _shift,                                        \
-               .ops = &mtk_clk_gate_ops_setclr,                        \
-       }
+#define GATE_PERI0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI1(_id, _name, _parent, _shift) {                      \
-               .id = _id,                                              \
-               .name = _name,                                          \
-               .parent_name = _parent,                                 \
-               .regs = &peri1_cg_regs,                                 \
-               .shift = _shift,                                        \
-               .ops = &mtk_clk_gate_ops_setclr,                        \
-       }
+#define GATE_PERI1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static DEFINE_SPINLOCK(mt7622_clk_lock);
 
index 282dd65..b0c8fa3 100644 (file)
 
 #include <dt-bindings/clock/mt7629-clk.h>
 
-#define GATE_ETH(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &eth_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_ETH(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &eth_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate_regs eth_cg_regs = {
        .set_ofs = 0x30,
@@ -45,14 +39,8 @@ static const struct mtk_gate_regs sgmii_cg_regs = {
        .sta_ofs = 0xE4,
 };
 
-#define GATE_SGMII(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &sgmii_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_SGMII(_id, _name, _parent, _shift)                        \
+       GATE_MTK(_id, _name, _parent, &sgmii_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate sgmii_clks[2][4] = {
        {
index 0c8b9e1..3628811 100644 (file)
 
 #include <dt-bindings/clock/mt7629-clk.h>
 
-#define GATE_PCIE(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &pcie_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_PCIE(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &pcie_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
-#define GATE_SSUSB(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &ssusb_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_SSUSB(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &ssusb_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate_regs pcie_cg_regs = {
        .set_ofs = 0x30,
index e4a08c8..0bc88b7 100644 (file)
                _pd_reg, _pd_shift, _tuner_reg, _pcw_reg, _pcw_shift,   \
                NULL, "clk20m")
 
-#define GATE_APMIXED(_id, _name, _parent, _shift) {    \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &apmixed_cg_regs,               \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv, \
-       }
+#define GATE_APMIXED(_id, _name, _parent, _shift)                      \
+       GATE_MTK(_id, _name, _parent, &apmixed_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
-#define GATE_INFRA(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &infra_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_INFRA(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI0(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_PERI0(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI1(_id, _name, _parent, _shift) {      \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &peri1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_PERI1(_id, _name, _parent, _shift)                                \
+       GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static DEFINE_SPINLOCK(mt7629_clk_lock);
 
index 7868c07..c21e1d6 100644 (file)
@@ -22,12 +22,8 @@ static const struct mtk_gate_regs sgmii0_cg_regs = {
        .sta_ofs = 0xe4,
 };
 
-#define GATE_SGMII0(_id, _name, _parent, _shift)                               \
-       {                                                                      \
-               .id = _id, .name = _name, .parent_name = _parent,              \
-               .regs = &sgmii0_cg_regs, .shift = _shift,                      \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv,                        \
-       }
+#define GATE_SGMII0(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &sgmii0_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate sgmii0_clks[] __initconst = {
        GATE_SGMII0(CLK_SGMII0_TX250M_EN, "sgmii0_tx250m_en", "top_xtal", 2),
@@ -42,12 +38,8 @@ static const struct mtk_gate_regs sgmii1_cg_regs = {
        .sta_ofs = 0xe4,
 };
 
-#define GATE_SGMII1(_id, _name, _parent, _shift)                               \
-       {                                                                      \
-               .id = _id, .name = _name, .parent_name = _parent,              \
-               .regs = &sgmii1_cg_regs, .shift = _shift,                      \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv,                        \
-       }
+#define GATE_SGMII1(_id, _name, _parent, _shift)               \
+       GATE_MTK(_id, _name, _parent, &sgmii1_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate sgmii1_clks[] __initconst = {
        GATE_SGMII1(CLK_SGMII1_TX250M_EN, "sgmii1_tx250m_en", "top_xtal", 2),
@@ -62,12 +54,8 @@ static const struct mtk_gate_regs eth_cg_regs = {
        .sta_ofs = 0x30,
 };
 
-#define GATE_ETH(_id, _name, _parent, _shift)                                  \
-       {                                                                      \
-               .id = _id, .name = _name, .parent_name = _parent,              \
-               .regs = &eth_cg_regs, .shift = _shift,                         \
-               .ops = &mtk_clk_gate_ops_no_setclr_inv,                        \
-       }
+#define GATE_ETH(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &eth_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr_inv)
 
 static const struct mtk_gate eth_clks[] __initconst = {
        GATE_ETH(CLK_ETH_FE_EN, "eth_fe_en", "netsys_2x_sel", 6),
index 4966604..74e68a7 100644 (file)
@@ -87,26 +87,14 @@ static const struct mtk_gate_regs infra2_cg_regs = {
        .sta_ofs = 0x68,
 };
 
-#define GATE_INFRA0(_id, _name, _parent, _shift)                               \
-       {                                                                      \
-               .id = _id, .name = _name, .parent_name = _parent,              \
-               .regs = &infra0_cg_regs, .shift = _shift,                      \
-               .ops = &mtk_clk_gate_ops_setclr,                               \
-       }
+#define GATE_INFRA0(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &infra0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_INFRA1(_id, _name, _parent, _shift)                               \
-       {                                                                      \
-               .id = _id, .name = _name, .parent_name = _parent,              \
-               .regs = &infra1_cg_regs, .shift = _shift,                      \
-               .ops = &mtk_clk_gate_ops_setclr,                               \
-       }
+#define GATE_INFRA1(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &infra1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_INFRA2(_id, _name, _parent, _shift)                               \
-       {                                                                      \
-               .id = _id, .name = _name, .parent_name = _parent,              \
-               .regs = &infra2_cg_regs, .shift = _shift,                      \
-               .ops = &mtk_clk_gate_ops_setclr,                               \
-       }
+#define GATE_INFRA2(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &infra2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate infra_clks[] = {
        /* INFRA0 */
index b68888a..1cbe095 100644 (file)
@@ -401,14 +401,8 @@ static const struct mtk_gate_regs infra_cg_regs = {
        .sta_ofs = 0x0048,
 };
 
-#define GATE_ICG(_id, _name, _parent, _shift) {        \
-               .id = _id,                                      \
-               .name = _name,                                  \
-               .parent_name = _parent,                         \
-               .regs = &infra_cg_regs,                         \
-               .shift = _shift,                                \
-               .ops = &mtk_clk_gate_ops_setclr,                \
-       }
+#define GATE_ICG(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &infra_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate infra_clks[] __initconst = {
        GATE_ICG(CLK_INFRA_PMIC_WRAP, "pmic_wrap_ck", "axi_sel", 23),
@@ -438,23 +432,11 @@ static const struct mtk_gate_regs peri1_cg_regs = {
        .sta_ofs = 0x001c,
 };
 
-#define GATE_PERI0(_id, _name, _parent, _shift) {      \
-               .id = _id,                                      \
-               .name = _name,                                  \
-               .parent_name = _parent,                         \
-               .regs = &peri0_cg_regs,                         \
-               .shift = _shift,                                \
-               .ops = &mtk_clk_gate_ops_setclr,                \
-       }
+#define GATE_PERI0(_id, _name, _parent, _shift)        \
+       GATE_MTK(_id, _name, _parent, &peri0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_PERI1(_id, _name, _parent, _shift) {      \
-               .id = _id,                                      \
-               .name = _name,                                  \
-               .parent_name = _parent,                         \
-               .regs = &peri1_cg_regs,                         \
-               .shift = _shift,                                \
-               .ops = &mtk_clk_gate_ops_setclr,                \
-       }
+#define GATE_PERI1(_id, _name, _parent, _shift)        \
+       GATE_MTK(_id, _name, _parent, &peri1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate peri_gates[] __initconst = {
        /* PERI0 */
index ce1ae8d..b5ac196 100644 (file)
@@ -23,14 +23,9 @@ static const struct mtk_gate_regs aud_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_AUD(_id, _name, _parent, _shift) {        \
-               .id = _id,                      \
-               .name = _name,                  \
-               .parent_name = _parent,         \
-               .regs = &aud_cg_regs,           \
-               .shift = _shift,                \
-               .ops = &mtk_clk_gate_ops_no_setclr,             \
-       }
+#define GATE_AUD(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
+
 
 static const struct mtk_gate aud_clks[] __initconst = {
        GATE_AUD(CLK_AUD_AFE, "aud_afe", "clk26m_ck", 2),
index e359e56..4e7c077 100644 (file)
@@ -23,14 +23,8 @@ static const struct mtk_gate_regs img_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_IMG(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &img_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_IMG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate img_clks[] __initconst = {
        GATE_IMG(CLK_IMG_LARB1_SMI, "img_larb1_smi", "smi_mm", 0),
index 4fd82fe..1927144 100644 (file)
@@ -23,14 +23,8 @@ static const struct mtk_gate_regs mfg_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_MFG(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mfg_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_MFG(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &mfg_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mfg_clks[] __initconst = {
        GATE_MFG(CLK_MFG_BAXI, "mfg_baxi", "ahb_infra_sel", 0),
index 7391006..a94961b 100644 (file)
@@ -29,23 +29,11 @@ static const struct mtk_gate_regs mm1_cg_regs = {
        .sta_ofs = 0x110,
 };
 
-#define GATE_MM0(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mm0_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
-
-#define GATE_MM1(_id, _name, _parent, _shift) {                \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &mm1_cg_regs,                   \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_MM0(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
+
+#define GATE_MM1(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mm_clks[] = {
        /* MM0 */
index ee4fffb..38f0ba3 100644 (file)
@@ -29,23 +29,11 @@ static const struct mtk_gate_regs vdec1_cg_regs = {
        .sta_ofs = 0x8,
 };
 
-#define GATE_VDEC0_I(_id, _name, _parent, _shift) {    \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &vdec0_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VDEC0_I(_id, _name, _parent, _shift)                      \
+       GATE_MTK(_id, _name, _parent, &vdec0_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_VDEC1_I(_id, _name, _parent, _shift) {    \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &vdec1_cg_regs,                 \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_VDEC1_I(_id, _name, _parent, _shift)                      \
+       GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
 static const struct mtk_gate vdec_clks[] __initconst = {
        /* VDEC0 */
index 8abf42c..5826eab 100644 (file)
@@ -25,23 +25,11 @@ static const struct mtk_gate_regs mm1_cg_regs = {
        .sta_ofs = 0x0110,
 };
 
-#define GATE_MM0(_id, _name, _parent, _shift) {                        \
-               .id = _id,                                      \
-               .name = _name,                                  \
-               .parent_name = _parent,                         \
-               .regs = &mm0_cg_regs,                           \
-               .shift = _shift,                                \
-               .ops = &mtk_clk_gate_ops_setclr,                \
-       }
-
-#define GATE_MM1(_id, _name, _parent, _shift) {                        \
-               .id = _id,                                      \
-               .name = _name,                                  \
-               .parent_name = _parent,                         \
-               .regs = &mm1_cg_regs,                           \
-               .shift = _shift,                                \
-               .ops = &mtk_clk_gate_ops_setclr,                \
-       }
+#define GATE_MM0(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm0_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
+
+#define GATE_MM1(_id, _name, _parent, _shift)  \
+       GATE_MTK(_id, _name, _parent, &mm1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate mt8173_mm_clks[] = {
        /* MM0 */
index 90f4806..a3dafc7 100644 (file)
@@ -22,14 +22,8 @@ static const struct mtk_gate_regs aud_cg_regs = {
        .sta_ofs = 0x0,
 };
 
-#define GATE_AUD(_id, _name, _parent, _shift) {        \
-               .id = _id,                      \
-               .name = _name,                  \
-               .parent_name = _parent,         \
-               .regs = &aud_cg_regs,           \
-               .shift = _shift,                \
-               .ops = &mtk_clk_gate_ops_no_setclr,             \
-       }
+#define GATE_AUD(_id, _name, _parent, _shift)                  \
+       GATE_MTK(_id, _name, _parent, &aud_cg_regs, _shift, &mtk_clk_gate_ops_no_setclr)
 
 static const struct mtk_gate aud_clks[] __initconst = {
        GATE_AUD(CLK_AUD_AFE, "aud_afe", "clk26m_ck", 2),
index b96db88..056953d 100644 (file)
@@ -525,59 +525,23 @@ static const struct mtk_gate_regs top5_cg_regs = {
        .sta_ofs = 0x44,
 };
 
-#define GATE_TOP1(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top1_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_TOP1(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top1_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_TOP2(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top2_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_TOP2(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top2_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_TOP2_I(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top2_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_TOP2_I(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &top2_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_TOP3(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top3_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr,        \
-       }
+#define GATE_TOP3(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top3_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
-#define GATE_TOP4_I(_id, _name, _parent, _shift) {     \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top4_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_setclr_inv,    \
-       }
+#define GATE_TOP4_I(_id, _name, _parent, _shift)                       \
+       GATE_MTK(_id, _name, _parent, &top4_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv)
 
-#define GATE_TOP5(_id, _name, _parent, _shift) {       \
-               .id = _id,                              \
-               .name = _name,                          \
-               .parent_name = _parent,                 \
-               .regs = &top5_cg_regs,                  \
-               .shift = _shift,                        \
-               .ops = &mtk_clk_gate_ops_no_setclr,     \
-       }
+#define GATE_TOP5(_id, _name, _parent, _shift)                         \
+       GATE_MTK(_id, _name, _parent, &top5_cg_regs, _shift, &mtk_clk_gate_ops_setclr)
 
 static const struct mtk_gate top_clks[] __initconst = {
        /* TOP1 */