[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4754b656-6168-417e-8fc8-450d1b0a3293@tuxon.dev>
Date: Sat, 6 Sep 2025 21:46:49 +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 22/32] clk: at91: sam9x60: switch to parent_hw and
parent_data
Hi, Ryan,
On 7/10/25 23:07, Ryan.Wanner@...rochip.com wrote:
> From: Claudiu Beznea <claudiu.beznea@...on.dev>
>
> Switch SAM9X60 clocks to use modern parent_hw and parent_data.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...on.dev>
> Signed-off-by: Ryan Wanner <Ryan.Wanner@...rochip.com>
> ---
> drivers/clk/at91/sam9x60.c | 109 +++++++++++++++++--------------------
> 1 file changed, 51 insertions(+), 58 deletions(-)
>
> diff --git a/drivers/clk/at91/sam9x60.c b/drivers/clk/at91/sam9x60.c
> index eb38da77d69a..b2e86e600a9f 100644
> --- a/drivers/clk/at91/sam9x60.c
> +++ b/drivers/clk/at91/sam9x60.c
> @@ -79,9 +79,9 @@ static const struct clk_pcr_layout sam9x60_pcr_layout = {
> .pid_mask = GENMASK(6, 0),
> };
>
> -static const struct {
> +static struct {
> char *n;
> - char *p;
> + struct clk_hw *parent_hw;
> unsigned long flags;
> u8 id;
> } sam9x60_systemck[] = {
> @@ -89,11 +89,11 @@ static const struct {
> * ddrck feeds DDR controller and is enabled by bootloader thus we need
> * to keep it enabled in case there is no Linux consumer for it.
> */
> - { .n = "ddrck", .p = "masterck_div", .id = 2, .flags = CLK_IS_CRITICAL },
> - { .n = "uhpck", .p = "usbck", .id = 6 },
> - { .n = "pck0", .p = "prog0", .id = 8 },
> - { .n = "pck1", .p = "prog1", .id = 9 },
> - { .n = "qspick", .p = "masterck_div", .id = 19 },
> + { .n = "ddrck", .id = 2, .flags = CLK_IS_CRITICAL },
> + { .n = "uhpck", .id = 6 },
> + { .n = "pck0", .id = 8 },
> + { .n = "pck1", .id = 9 },
> + { .n = "qspick", .id = 19 },
> };
>
> static const struct {
> @@ -184,32 +184,17 @@ static const struct {
>
> static void __init sam9x60_pmc_setup(struct device_node *np)
> {
> + const char *td_slck_name = "td_slck", *md_slck_name = "md_slck";
> + u8 td_slck_index = 0, md_slck_index = 1, main_xtal_index = 2;
> + struct clk_hw *hw, *main_rc_hw, *main_osc_hw;
> + const char *main_xtal_name = "main_xtal";
> struct clk_range range = CLK_RANGE(0, 0);
> - const char *td_slck_name, *md_slck_name, *mainxtal_name;
> + struct clk_parent_data parent_data[6];
> struct pmc_data *sam9x60_pmc;
> - const char *parent_names[6];
> - struct clk_hw *main_osc_hw;
> + struct clk_hw *usbck_hw;
> struct regmap *regmap;
> - struct clk_hw *hw;
> int i;
>
Please keep this starting here:
> - i = of_property_match_string(np, "clock-names", "td_slck");
> - if (i < 0)
> - return;
> -
> - td_slck_name = of_clk_get_parent_name(np, i);
> -
> - i = of_property_match_string(np, "clock-names", "md_slck");
> - if (i < 0)
> - return;
> -
> - md_slck_name = of_clk_get_parent_name(np, i);
> -
> - i = of_property_match_string(np, "clock-names", "main_xtal");
> - if (i < 0)
> - return;
> - mainxtal_name = of_clk_get_parent_name(np, i);
> -
ending here and use the retrieved name with AT91_CLK_PD_NAME()
Powered by blists - more mailing lists