Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.3-rc6 59 lines 1.4 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Copyright (c) 2014 MediaTek Inc. 4 * Author: James Liao <jamesjj.liao@mediatek.com> 5 */ 6 7#ifndef __DRV_CLK_GATE_H 8#define __DRV_CLK_GATE_H 9 10#include <linux/regmap.h> 11#include <linux/clk-provider.h> 12 13struct clk; 14 15struct mtk_clk_gate { 16 struct clk_hw hw; 17 struct regmap *regmap; 18 int set_ofs; 19 int clr_ofs; 20 int sta_ofs; 21 u8 bit; 22}; 23 24static inline struct mtk_clk_gate *to_mtk_clk_gate(struct clk_hw *hw) 25{ 26 return container_of(hw, struct mtk_clk_gate, hw); 27} 28 29extern const struct clk_ops mtk_clk_gate_ops_setclr; 30extern const struct clk_ops mtk_clk_gate_ops_setclr_inv; 31extern const struct clk_ops mtk_clk_gate_ops_no_setclr; 32extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv; 33 34struct clk *mtk_clk_register_gate( 35 const char *name, 36 const char *parent_name, 37 struct regmap *regmap, 38 int set_ofs, 39 int clr_ofs, 40 int sta_ofs, 41 u8 bit, 42 const struct clk_ops *ops, 43 unsigned long flags); 44 45#define GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, \ 46 _ops, _flags) { \ 47 .id = _id, \ 48 .name = _name, \ 49 .parent_name = _parent, \ 50 .regs = _regs, \ 51 .shift = _shift, \ 52 .ops = _ops, \ 53 .flags = _flags, \ 54 } 55 56#define GATE_MTK(_id, _name, _parent, _regs, _shift, _ops) \ 57 GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, _ops, 0) 58 59#endif /* __DRV_CLK_GATE_H */