Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 1 | /* |
Masahiro Yamada | fa1f73f | 2016-07-19 21:56:13 +0900 | [diff] [blame] | 2 | * Copyright (C) 2016 Socionext Inc. |
| 3 | * Author: Masahiro Yamada <yamada.masahiro@socionext.com> |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 4 | * |
| 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 | |
| 13 | struct uniphier_clk_gate_data { |
| 14 | int index; |
| 15 | unsigned int reg; |
| 16 | u32 mask; |
| 17 | u32 data; |
| 18 | }; |
| 19 | |
| 20 | struct 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 | |
| 29 | struct uniphier_clk_soc_data { |
Masahiro Yamada | 630c99f | 2016-09-22 07:42:20 +0900 | [diff] [blame] | 30 | const struct uniphier_clk_gate_data *gate; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 31 | unsigned int nr_gate; |
Masahiro Yamada | 630c99f | 2016-09-22 07:42:20 +0900 | [diff] [blame] | 32 | const struct uniphier_clk_rate_data *rate; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 33 | 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 Yamada | f18559e | 2016-09-22 07:42:21 +0900 | [diff] [blame] | 43 | extern const struct uniphier_clk_soc_data uniphier_mio_clk_data; |
Masahiro Yamada | e4dfb05 | 2016-02-02 21:11:32 +0900 | [diff] [blame] | 44 | |
| 45 | #endif /* __CLK_UNIPHIER_H__ */ |