1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2014 MediaTek Inc.
7 #ifndef __DRV_CLK_GATE_H
8 #define __DRV_CLK_GATE_H
10 #include <linux/types.h>
13 struct clk_hw_onecell_data;
18 extern const struct clk_ops mtk_clk_gate_ops_setclr;
19 extern const struct clk_ops mtk_clk_gate_ops_setclr_inv;
20 extern const struct clk_ops mtk_clk_gate_ops_no_setclr;
21 extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv;
23 struct mtk_gate_regs {
32 const char *parent_name;
33 const struct mtk_gate_regs *regs;
35 const struct clk_ops *ops;
39 #define GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, \
43 .parent_name = _parent, \
50 #define GATE_MTK(_id, _name, _parent, _regs, _shift, _ops) \
51 GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, _ops, 0)
53 int mtk_clk_register_gates(struct device_node *node,
54 const struct mtk_gate *clks, int num,
55 struct clk_hw_onecell_data *clk_data);
57 int mtk_clk_register_gates_with_dev(struct device_node *node,
58 const struct mtk_gate *clks, int num,
59 struct clk_hw_onecell_data *clk_data,
62 void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
63 struct clk_hw_onecell_data *clk_data);
65 #endif /* __DRV_CLK_GATE_H */