blob: fed851a51aafaa8bf347dbcacd377aa44b470f0b [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __MACH_COMMON_CLKDEV_H
3#define __MACH_COMMON_CLKDEV_H
4
5#include <linux/clk.h>
6
7struct clk_ops {
8 unsigned long (*get_rate)(struct clk *clk);
9 unsigned long (*round_rate)(struct clk *clk, unsigned long rate);
10 int (*set_rate)(struct clk *clk, unsigned long rate);
11 int (*enable)(struct clk *clk);
12 int (*disable)(struct clk *clk);
13};
14
15struct clk {
16 const char *name;
17 unsigned long rate;
18 spinlock_t lock;
19 u32 flags;
20 const struct clk_ops *ops;
21 const struct params *params;
22 void __iomem *reg;
23 u32 mask;
24 u32 shift;
25};
26
27#endif
28