diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2016-10-14 13:08:19 +0300 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@free-electrons.com> | 2017-01-23 13:45:01 +0300 |
commit | 0c3c8e135897eb8e896a0bb82a5aff6c9bc158cc (patch) | |
tree | 1ee8199653ceeccb7954da33a2b36d740f12269b /drivers/clk/sunxi-ng/ccu_mult.h | |
parent | c9520be3839063bbb50aabec531cc0d0b8595564 (diff) | |
download | linux-0c3c8e135897eb8e896a0bb82a5aff6c9bc158cc.tar.xz |
clk: sunxi-ng: Implement multiplier maximum
Some multipliers have a maximum rate that is lower than what the register
width allows to. Add a field in the multiplier structure to allow CCU
driver to set that maximum.
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu_mult.h')
-rw-r--r-- | drivers/clk/sunxi-ng/ccu_mult.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/clk/sunxi-ng/ccu_mult.h b/drivers/clk/sunxi-ng/ccu_mult.h index 84839641dfdf..524acddfcb2e 100644 --- a/drivers/clk/sunxi-ng/ccu_mult.h +++ b/drivers/clk/sunxi-ng/ccu_mult.h @@ -10,24 +10,26 @@ struct ccu_mult_internal { u8 shift; u8 width; u8 min; + u8 max; }; -#define _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, _offset, _min) \ +#define _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, _min, _max) \ { \ .min = _min, \ + .max = _max, \ .offset = _offset, \ .shift = _shift, \ .width = _width, \ } #define _SUNXI_CCU_MULT_MIN(_shift, _width, _min) \ - _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, 1, _min) + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, _min, 0) #define _SUNXI_CCU_MULT_OFFSET(_shift, _width, _offset) \ - _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, _offset, 1) + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, _offset, 1, 0) #define _SUNXI_CCU_MULT(_shift, _width) \ - _SUNXI_CCU_MULT_OFFSET_MIN(_shift, _width, 1, 1) + _SUNXI_CCU_MULT_OFFSET_MIN_MAX(_shift, _width, 1, 1, 0) struct ccu_mult { u32 enable; |