[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <212df54b-b3b8-454e-8d4b-e79bd9b69349@tuxon.dev>
Date: Sat, 6 Sep 2025 21:33:34 +0300
From: claudiu beznea <claudiu.beznea@...on.dev>
To: Ryan.Wanner@...rochip.com, mturquette@...libre.com, sboyd@...nel.org,
nicolas.ferre@...rochip.com, alexandre.belloni@...tlin.com
Cc: varshini.rajendran@...rochip.com, linux-clk@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
robh@...nel.org
Subject: Re: [PATCH v3 01/32] clk: at91: pmc: add macros for clk_parent_data
Hi, Ryan,
On 7/10/25 23:06, Ryan.Wanner@...rochip.com wrote:
> From: Claudiu Beznea <claudiu.beznea@...on.dev>
>
> Add helpers to set parent_data objects in platform specific drivers.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...on.dev>
> [ryan.wanner@...rochip.com: enclose complex macro with parentheses.]
> Signed-off-by: Ryan Wanner <Ryan.Wanner@...rochip.com>
> ---
> drivers/clk/at91/pmc.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
> index 4fb29ca111f7..0b721a65b77f 100644
> --- a/drivers/clk/at91/pmc.h
> +++ b/drivers/clk/at91/pmc.h
> @@ -15,6 +15,12 @@
>
> #include <dt-bindings/clock/at91.h>
>
> +#define AT91_CLK_PD_NAME(n, i) ((struct clk_parent_data){ \
> + .hw = NULL, .name = (n), .fw_name = (n), .index = (i), \
It's been a while since I worked on this. Looking again at it, having .name
and .fw_name filled with the same data may not be valid all the time.
Moreover, investigating it further I found that we cannot use struct
clk_parent_data::fw_name and struct clk_parent_data::index as the clocks
for these SoCs are registered with CLK_OF_REGISTER() and have no struct
device associated such that dev_or_parent_of_node() (called with
__clk_register()) to return a struct device_node pointer and associated
fw_name code to work properly.
It should have been something like:
#define AT91_CLK_PD_NAME(n) ((struct clk_parent_data){ \
.hw = NULL, .name = (n), .fw_name = NULL, .index = -1, \
}
> +})
> +
> +#define AT91_CLK_PD_HW(h) ((struct clk_parent_data){ .hw = (h) })
Could you please update this one, something like:
#define AT91_CLK_PD_HW(h) ((struct clk_parent_data){ \
.hw = (h), .name = NULL, .fw_name = NULL, .index = -1, \
}
Thank you,
Claudiu
> +
> extern spinlock_t pmc_pcr_lock;
>
> struct pmc_data {
Powered by blists - more mailing lists