forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 cde9070d9970eef1f7ec2360586c802a16230ad8
kernel/drivers/clk/sunxi-ng/ccu_nm.h
....@@ -1,14 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (c) 2016 Maxime Ripard. All rights reserved.
3
- *
4
- * This software is licensed under the terms of the GNU General Public
5
- * License version 2, as published by the Free Software Foundation, and
6
- * may be copied, distributed, and modified under those terms.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 */
135
146 #ifndef _CCU_NM_H_
....@@ -38,6 +30,7 @@
3830
3931 unsigned int fixed_post_div;
4032 unsigned int min_rate;
33
+ unsigned int max_rate;
4134
4235 struct ccu_common common;
4336 };
....@@ -115,6 +108,35 @@
115108 }, \
116109 }
117110
111
+#define SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK_MIN_MAX(_struct, _name, \
112
+ _parent, _reg, \
113
+ _min_rate, _max_rate, \
114
+ _nshift, _nwidth, \
115
+ _mshift, _mwidth, \
116
+ _frac_en, _frac_sel, \
117
+ _frac_rate_0, \
118
+ _frac_rate_1, \
119
+ _gate, _lock, _flags) \
120
+ struct ccu_nm _struct = { \
121
+ .enable = _gate, \
122
+ .lock = _lock, \
123
+ .n = _SUNXI_CCU_MULT(_nshift, _nwidth), \
124
+ .m = _SUNXI_CCU_DIV(_mshift, _mwidth), \
125
+ .frac = _SUNXI_CCU_FRAC(_frac_en, _frac_sel, \
126
+ _frac_rate_0, \
127
+ _frac_rate_1), \
128
+ .min_rate = _min_rate, \
129
+ .max_rate = _max_rate, \
130
+ .common = { \
131
+ .reg = _reg, \
132
+ .features = CCU_FEATURE_FRACTIONAL, \
133
+ .hw.init = CLK_HW_INIT(_name, \
134
+ _parent, \
135
+ &ccu_nm_ops, \
136
+ _flags), \
137
+ }, \
138
+ }
139
+
118140 #define SUNXI_CCU_NM_WITH_GATE_LOCK(_struct, _name, _parent, _reg, \
119141 _nshift, _nwidth, \
120142 _mshift, _mwidth, \