1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2014 MediaTek Inc.
4 * Author: James Liao <jamesjj.liao@mediatek.com>
7 #ifndef __DRV_CLK_GATE_H
8 #define __DRV_CLK_GATE_H
10 #include <linux/regmap.h>
11 #include <linux/clk-provider.h>
17 struct regmap
*regmap
;
24 static inline struct mtk_clk_gate
*to_mtk_clk_gate(struct clk_hw
*hw
)
26 return container_of(hw
, struct mtk_clk_gate
, hw
);
29 extern const struct clk_ops mtk_clk_gate_ops_setclr
;
30 extern const struct clk_ops mtk_clk_gate_ops_setclr_inv
;
31 extern const struct clk_ops mtk_clk_gate_ops_no_setclr
;
32 extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv
;
34 struct clk
*mtk_clk_register_gate(
36 const char *parent_name
,
37 struct regmap
*regmap
,
42 const struct clk_ops
*ops
,
46 #define GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, \
50 .parent_name = _parent, \
57 #define GATE_MTK(_id, _name, _parent, _regs, _shift, _ops) \
58 GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, _ops, 0)
60 #endif /* __DRV_CLK_GATE_H */