diff options
author | Emil Renner Berthing <kernel@esmil.dk> | 2022-01-26 18:39:52 +0100 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2022-03-10 18:17:33 -0800 |
commit | 8c373f8c793cc1bb8f708433dcb8343ba078bd17 (patch) | |
tree | 32384219d316922eba15f3df8416f513dc717bb2 /drivers/clk/starfive/clk-starfive-jh7100.h | |
parent | 26ad971faa07951179ae6d39f91b6622da4d020c (diff) | |
download | lwn-8c373f8c793cc1bb8f708433dcb8343ba078bd17.tar.gz lwn-8c373f8c793cc1bb8f708433dcb8343ba078bd17.zip |
clk: starfive: jh7100: Support more clock types
Unlike the system clocks there are audio clocks that combine both
multiplexer/divider and gate/multiplexer/divider, so add support for
that.
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Link: https://lore.kernel.org/r/20220126173953.1016706-7-kernel@esmil.dk
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/starfive/clk-starfive-jh7100.h')
-rw-r--r-- | drivers/clk/starfive/clk-starfive-jh7100.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/clk/starfive/clk-starfive-jh7100.h b/drivers/clk/starfive/clk-starfive-jh7100.h index 8eccd8c0a746..f116be5740a5 100644 --- a/drivers/clk/starfive/clk-starfive-jh7100.h +++ b/drivers/clk/starfive/clk-starfive-jh7100.h @@ -70,6 +70,21 @@ struct jh7100_clk_data { .parents = { __VA_ARGS__ }, \ } +#define JH7100_MDIV(_idx, _name, _max, _nparents, ...) [_idx] = { \ + .name = _name, \ + .flags = 0, \ + .max = (((_nparents) - 1) << JH7100_CLK_MUX_SHIFT) | (_max), \ + .parents = { __VA_ARGS__ }, \ +} + +#define JH7100__GMD(_idx, _name, _flags, _max, _nparents, ...) [_idx] = { \ + .name = _name, \ + .flags = _flags, \ + .max = JH7100_CLK_ENABLE | \ + (((_nparents) - 1) << JH7100_CLK_MUX_SHIFT) | (_max), \ + .parents = { __VA_ARGS__ }, \ +} + #define JH7100__INV(_idx, _name, _parent) [_idx] = { \ .name = _name, \ .flags = CLK_SET_RATE_PARENT, \ |