cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

clk-gate.h (1628B)


      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/types.h>
     11
     12struct clk;
     13struct clk_hw_onecell_data;
     14struct clk_ops;
     15struct device;
     16struct device_node;
     17
     18extern const struct clk_ops mtk_clk_gate_ops_setclr;
     19extern const struct clk_ops mtk_clk_gate_ops_setclr_inv;
     20extern const struct clk_ops mtk_clk_gate_ops_no_setclr;
     21extern const struct clk_ops mtk_clk_gate_ops_no_setclr_inv;
     22
     23struct mtk_gate_regs {
     24	u32 sta_ofs;
     25	u32 clr_ofs;
     26	u32 set_ofs;
     27};
     28
     29struct mtk_gate {
     30	int id;
     31	const char *name;
     32	const char *parent_name;
     33	const struct mtk_gate_regs *regs;
     34	int shift;
     35	const struct clk_ops *ops;
     36	unsigned long flags;
     37};
     38
     39#define GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift,	\
     40			_ops, _flags) {				\
     41		.id = _id,					\
     42		.name = _name,					\
     43		.parent_name = _parent,				\
     44		.regs = _regs,					\
     45		.shift = _shift,				\
     46		.ops = _ops,					\
     47		.flags = _flags,				\
     48	}
     49
     50#define GATE_MTK(_id, _name, _parent, _regs, _shift, _ops)		\
     51	GATE_MTK_FLAGS(_id, _name, _parent, _regs, _shift, _ops, 0)
     52
     53int mtk_clk_register_gates(struct device_node *node,
     54			   const struct mtk_gate *clks, int num,
     55			   struct clk_hw_onecell_data *clk_data);
     56
     57int 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,
     60				    struct device *dev);
     61
     62void mtk_clk_unregister_gates(const struct mtk_gate *clks, int num,
     63			      struct clk_hw_onecell_data *clk_data);
     64
     65#endif /* __DRV_CLK_GATE_H */