mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-24 22:07:45 +07:00
d2912cb15b
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
66 lines
1.5 KiB
C
66 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
|
|
#include <linux/clkdev.h>
|
|
|
|
struct clkops {
|
|
void (*enable)(struct clk *);
|
|
void (*disable)(struct clk *);
|
|
unsigned long (*getrate)(struct clk *);
|
|
int (*setrate)(struct clk *, unsigned long);
|
|
};
|
|
|
|
struct clk {
|
|
const struct clkops *ops;
|
|
|
|
void __iomem *clk_rst; /* clock reset control register */
|
|
int fnclksel; /* functional clock select (APBC) */
|
|
uint32_t enable_val; /* value for clock enable (APMU) */
|
|
unsigned long rate;
|
|
int enabled;
|
|
};
|
|
|
|
extern struct clkops apbc_clk_ops;
|
|
extern struct clkops apmu_clk_ops;
|
|
|
|
#define APBC_CLK(_name, _reg, _fnclksel, _rate) \
|
|
struct clk clk_##_name = { \
|
|
.clk_rst = APBC_##_reg, \
|
|
.fnclksel = _fnclksel, \
|
|
.rate = _rate, \
|
|
.ops = &apbc_clk_ops, \
|
|
}
|
|
|
|
#define APBC_CLK_OPS(_name, _reg, _fnclksel, _rate, _ops) \
|
|
struct clk clk_##_name = { \
|
|
.clk_rst = APBC_##_reg, \
|
|
.fnclksel = _fnclksel, \
|
|
.rate = _rate, \
|
|
.ops = _ops, \
|
|
}
|
|
|
|
#define APMU_CLK(_name, _reg, _eval, _rate) \
|
|
struct clk clk_##_name = { \
|
|
.clk_rst = APMU_##_reg, \
|
|
.enable_val = _eval, \
|
|
.rate = _rate, \
|
|
.ops = &apmu_clk_ops, \
|
|
}
|
|
|
|
#define APMU_CLK_OPS(_name, _reg, _eval, _rate, _ops) \
|
|
struct clk clk_##_name = { \
|
|
.clk_rst = APMU_##_reg, \
|
|
.enable_val = _eval, \
|
|
.rate = _rate, \
|
|
.ops = _ops, \
|
|
}
|
|
|
|
#define INIT_CLKREG(_clk, _devname, _conname) \
|
|
{ \
|
|
.clk = _clk, \
|
|
.dev_id = _devname, \
|
|
.con_id = _conname, \
|
|
}
|
|
|
|
extern struct clk clk_pxa168_gpio;
|
|
extern struct clk clk_pxa168_timers;
|