Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
64 lines
1.6 KiB
C
64 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2014 MediaTek Inc.
|
|
* Author: James Liao <jamesjj.liao@mediatek.com>
|
|
*/
|
|
|
|
#ifndef __DRV_CLK_GATE_H
|
|
#define __DRV_CLK_GATE_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct clk;
|
|
struct clk_hw_onecell_data;
|
|
struct clk_ops;
|
|
struct device;
|
|
struct device_node;
|
|
|
|
extern const struct clk_ops mtk_clk_gate_ops_setclr;
|
|
extern const struct clk_ops mtk_clk_gate_ops_setclr_inv;
|
|
extern const struct clk_ops mtk_clk_gate_ops_no_setclr;
|
|
extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv;
|
|
extern const struct clk_ops mtk_clk_gate_hwv_ops_setclr;
|
|
extern const struct clk_ops mtk_clk_gate_hwv_ops_setclr_inv;
|
|
|
|
struct mtk_gate_regs {
|
|
u32 sta_ofs;
|
|
u32 clr_ofs;
|
|
u32 set_ofs;
|
|
};
|
|
|
|
struct mtk_gate {
|
|
int id;
|
|
const char *name;
|
|
const char *parent_name;
|
|
const struct mtk_gate_regs *regs;
|
|
const struct mtk_gate_regs *hwv_regs;
|
|
int shift;
|
|
const struct clk_ops *ops;
|
|
unsigned long flags;
|
|
};
|
|
|
|
#define GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, \
|
|
_ops, _flags) { \
|
|
.id = _id, \
|
|
.name = _name, \
|
|
.parent_name = _parent, \
|
|
.regs = _regs, \
|
|
.shift = _shift, \
|
|
.ops = _ops, \
|
|
.flags = _flags, \
|
|
}
|
|
|
|
#define GATE_MTK(_id, _name, _parent, _regs, _shift, _ops) \
|
|
GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, _ops, 0)
|
|
|
|
int mtk_clk_register_gates(struct device *dev, struct device_node *node,
|
|
const struct mtk_gate *clks, int num,
|
|
struct clk_hw_onecell_data *clk_data);
|
|
|
|
void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
|
|
struct clk_hw_onecell_data *clk_data);
|
|
|
|
#endif /* __DRV_CLK_GATE_H */
|