| .. | .. | 
|---|
|  | 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ | 
|---|
| 1 | 2 | /* | 
|---|
| 2 | 3 | * 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. | 
|---|
| 12 | 4 | */ | 
|---|
| 13 | 5 |  | 
|---|
| 14 | 6 | #ifndef _CCU_NM_H_ | 
|---|
| .. | .. | 
|---|
| 38 | 30 |  | 
|---|
| 39 | 31 | unsigned int		fixed_post_div; | 
|---|
| 40 | 32 | unsigned int		min_rate; | 
|---|
|  | 33 | +	unsigned int		max_rate; | 
|---|
| 41 | 34 |  | 
|---|
| 42 | 35 | struct ccu_common	common; | 
|---|
| 43 | 36 | }; | 
|---|
| .. | .. | 
|---|
| 115 | 108 | },							\ | 
|---|
| 116 | 109 | } | 
|---|
| 117 | 110 |  | 
|---|
|  | 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 | + | 
|---|
| 118 | 140 | #define SUNXI_CCU_NM_WITH_GATE_LOCK(_struct, _name, _parent, _reg,	\ | 
|---|
| 119 | 141 | _nshift, _nwidth,			\ | 
|---|
| 120 | 142 | _mshift, _mwidth,			\ | 
|---|