blob: 0b60337205e79c596e476de5a5a87b408cfc97a8 [file] [log] [blame]
Masahiro Yamadae4dfb052016-02-02 21:11:32 +09001/*
Masahiro Yamadafa1f73f2016-07-19 21:56:13 +09002 * Copyright (C) 2016 Socionext Inc.
3 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
Masahiro Yamadae4dfb052016-02-02 21:11:32 +09004 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#ifndef __CLK_UNIPHIER_H__
9#define __CLK_UNIPHIER_H__
10
11#include <linux/kernel.h>
12
13struct uniphier_clk_gate_data {
14 int index;
15 unsigned int reg;
16 u32 mask;
17 u32 data;
18};
19
20struct uniphier_clk_rate_data {
21 int index;
22 unsigned int reg;
23#define UNIPHIER_CLK_RATE_IS_FIXED UINT_MAX
24 u32 mask;
25 u32 data;
26 unsigned long rate;
27};
28
29struct uniphier_clk_soc_data {
Masahiro Yamada630c99f2016-09-22 07:42:20 +090030 const struct uniphier_clk_gate_data *gate;
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090031 unsigned int nr_gate;
Masahiro Yamada630c99f2016-09-22 07:42:20 +090032 const struct uniphier_clk_rate_data *rate;
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090033 unsigned int nr_rate;
34};
35
36#define UNIPHIER_CLK_FIXED_RATE(i, f) \
37 { \
38 .index = i, \
39 .reg = UNIPHIER_CLK_RATE_IS_FIXED, \
40 .rate = f, \
41 }
42
Masahiro Yamadaf18559e2016-09-22 07:42:21 +090043extern const struct uniphier_clk_soc_data uniphier_mio_clk_data;
Masahiro Yamadae4dfb052016-02-02 21:11:32 +090044
45#endif /* __CLK_UNIPHIER_H__ */