2016-02-02 12:11:32 +00:00
|
|
|
/*
|
2016-07-19 12:56:13 +00:00
|
|
|
* Copyright (C) 2016 Socionext Inc.
|
|
|
|
* Author: Masahiro Yamada <yamada.masahiro@socionext.com>
|
2016-02-02 12:11:32 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CLK_UNIPHIER_H__
|
|
|
|
#define __CLK_UNIPHIER_H__
|
|
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
#define UNIPHIER_CLK_MAX_NR_MUXS 8
|
|
|
|
|
2016-02-02 12:11:32 +00:00
|
|
|
struct uniphier_clk_gate_data {
|
2016-10-17 13:18:01 +00:00
|
|
|
unsigned int id;
|
2016-02-02 12:11:32 +00:00
|
|
|
unsigned int reg;
|
2016-10-17 13:18:01 +00:00
|
|
|
unsigned int bit;
|
2016-02-02 12:11:32 +00:00
|
|
|
};
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
struct uniphier_clk_mux_data {
|
|
|
|
unsigned int id;
|
|
|
|
unsigned int nr_muxs;
|
2016-02-02 12:11:32 +00:00
|
|
|
unsigned int reg;
|
2016-10-17 13:18:01 +00:00
|
|
|
unsigned int masks[UNIPHIER_CLK_MAX_NR_MUXS];
|
|
|
|
unsigned int vals[UNIPHIER_CLK_MAX_NR_MUXS];
|
|
|
|
unsigned long rates[UNIPHIER_CLK_MAX_NR_MUXS];
|
2016-02-02 12:11:32 +00:00
|
|
|
};
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
struct uniphier_clk_data {
|
2016-09-21 22:42:20 +00:00
|
|
|
const struct uniphier_clk_gate_data *gate;
|
2016-10-17 13:18:01 +00:00
|
|
|
const struct uniphier_clk_mux_data *mux;
|
2016-02-02 12:11:32 +00:00
|
|
|
};
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
#define UNIPHIER_CLK_ID_END (unsigned int)(-1)
|
|
|
|
|
|
|
|
#define UNIPHIER_CLK_END \
|
|
|
|
{ .id = UNIPHIER_CLK_ID_END }
|
|
|
|
|
|
|
|
#define UNIPHIER_CLK_GATE(_id, _reg, _bit) \
|
|
|
|
{ \
|
|
|
|
.id = (_id), \
|
|
|
|
.reg = (_reg), \
|
|
|
|
.bit = (_bit), \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define UNIPHIER_CLK_FIXED_RATE(_id, _rate) \
|
2016-02-02 12:11:32 +00:00
|
|
|
{ \
|
2016-10-17 13:18:01 +00:00
|
|
|
.id = (_id), \
|
|
|
|
.rates = {(_reg),}, \
|
2016-02-02 12:11:32 +00:00
|
|
|
}
|
|
|
|
|
2016-10-17 13:18:01 +00:00
|
|
|
extern const struct uniphier_clk_data uniphier_mio_clk_data;
|
2016-02-02 12:11:32 +00:00
|
|
|
|
|
|
|
#endif /* __CLK_UNIPHIER_H__ */
|