[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fac4b0b0-3aa1-4a7a-b578-2406bee5b4a9@tuxon.dev>
Date: Sat, 31 Jan 2026 17:45:05 +0200
From: Claudiu Beznea <claudiu.beznea@...on.dev>
To: Alexander Dahl <ada@...rsis.com>
Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Ryan Wanner <ryan.wanner@...rochip.com>,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-clk@...r.kernel.org,
Michael Turquette <mturquette@...libre.com>, Stephen Boyd
<sboyd@...nel.org>, Cristian Birsan <cristian.birsan@...rochip.com>
Subject: Re: [PATCH v3 05/19] clk: at91: sama7d65: Use highest PMC definition
as max index
On 1/20/26 16:37, Alexander Dahl wrote:
> Consistent with all the other at91 clock drivers now, which also use the
> highest PMC definition as max value, and no extra number.
>
> Signed-off-by: Alexander Dahl <ada@...rsis.com>
> ---
>
> Notes:
> v3:
> - new patch, not present in v2
>
> drivers/clk/at91/sama7d65.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
> index f6f86261ceefd..4ccffa8db43a5 100644
> --- a/drivers/clk/at91/sama7d65.c
> +++ b/drivers/clk/at91/sama7d65.c
> @@ -19,8 +19,6 @@ static DEFINE_SPINLOCK(pmc_pll_lock);
> static DEFINE_SPINLOCK(pmc_mck0_lock);
> static DEFINE_SPINLOCK(pmc_mckX_lock);
>
> -#define PMC_INDEX_MAX 25
That's not the right approach.
You should identify all the core clocks as described in the HW manual and
allocate the ncore section of sama7d65_pmc[] to have all those fit in there.
This driver would have to work with old and new device trees and thus, if you
shrink it now you wouldn't satisfy this rule in the future.
> -
> /*
> * PLL clocks identifiers
> * @PLL_ID_CPU: CPU PLL identifier
> @@ -1120,7 +1118,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
> if (IS_ERR(regmap))
> return;
>
> - sama7d65_pmc = pmc_data_allocate(PMC_INDEX_MAX,
> + sama7d65_pmc = pmc_data_allocate(SAMA7D65_PMC_MCK5 + 1,
> nck(sama7d65_systemck),
> nck(sama7d65_periphck),
> nck(sama7d65_gck), 8);
Powered by blists - more mailing lists