Re: [PATCH v2 4/9] clk: renesas: rzg2l: Add support for divider flags
From: Geert Uytterhoeven
Date: Fri Aug 14 2026 - 08:36:31 EST
Hi Biju,
On Tue, 11 Aug 2026 at 20:27, Biju <biju.das.au@xxxxxxxxx> wrote:
> From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> Add support for passing divider flags apart from clock flags from soc
> specific clock drivers.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
> ---
> v1->v2:
> * Collected tag.
> * Fixed a check patch warning by using (_div_flags) in DEF_DIV_FLAGS
> macro.
Thanks for the update!
> --- a/drivers/clk/renesas/rzg2l-cpg.h
> +++ b/drivers/clk/renesas/rzg2l-cpg.h
> @@ -112,6 +112,7 @@ struct cpg_core_clk {
> notifier_fn_t notifier;
> u32 core_flags;
> u32 mux_flags;
> + u32 div_flags;
> int num_parents;
> };
>
> @@ -168,11 +169,18 @@ enum clk_types {
> #define DEF_DIV(_name, _id, _parent, _conf, _dtable) \
> DEF_TYPE(_name, _id, CLK_TYPE_DIV, .conf = _conf, \
> .parent = _parent, .dtable = _dtable, \
> - .core_flags = CLK_DIVIDER_HIWORD_MASK)
> + .core_flags = 0, \
> + .div_flags = CLK_DIVIDER_HIWORD_MASK)
This can be simplified to:
DEF_DIV_FLAGS(_name, _id, _parent, _conf, _dtable, 0, 0)
I will do that while queuing in renesas-clk for v7.4.
> #define DEF_DIV_RO(_name, _id, _parent, _conf, _dtable) \
> DEF_TYPE(_name, _id, CLK_TYPE_DIV, .conf = _conf, \
> .parent = _parent, .dtable = _dtable, \
> - .core_flags = CLK_DIVIDER_READ_ONLY)
> + .core_flags = 0, \
> + .div_flags = CLK_DIVIDER_READ_ONLY)
> +#define DEF_DIV_FLAGS(_name, _id, _parent, _conf, _dtable, _flags, _div_flags) \
> + DEF_TYPE(_name, _id, CLK_TYPE_DIV, .conf = _conf, \
> + .parent = _parent, .dtable = _dtable, \
> + .core_flags = _flags, \
> + .div_flags = CLK_DIVIDER_HIWORD_MASK | (_div_flags))
> #define DEF_G3S_DIV(_name, _id, _parent, _conf, _sconf, _dtable, _invalid_rate, \
> _max_rate, _clk_flags, _notif) \
> DEF_TYPE(_name, _id, CLK_TYPE_G3S_DIV, .conf = _conf, .sconf = _sconf, \
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds