[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <676e618850df0db8dd880c36cd9b6dcef7b17b8b.1752176711.git.Ryan.Wanner@microchip.com>
Date: Thu, 10 Jul 2025 13:07:06 -0700
From: <Ryan.Wanner@...rochip.com>
To: <mturquette@...libre.com>, <sboyd@...nel.org>,
<nicolas.ferre@...rochip.com>, <alexandre.belloni@...tlin.com>,
<claudiu.beznea@...on.dev>
CC: <varshini.rajendran@...rochip.com>, <linux-clk@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>,
<robh@...nel.org>, Ryan Wanner <Ryan.Wanner@...rochip.com>
Subject: [PATCH v3 13/32] clk: at91: sama7d65: switch to parent_hw and parent_data
From: Ryan Wanner <Ryan.Wanner@...rochip.com>
Switch the system clocks to use parent_hw and parent_data. Having this
allows the driver to conform to the new clk-system API.
The parent registration is after the USBCK registration due to one of
the system clocks being dependent on USBCK.
Signed-off-by: Ryan Wanner <Ryan.Wanner@...rochip.com>
---
drivers/clk/at91/sama7d65.c | 37 +++++++++++++++++++++++--------------
1 file changed, 23 insertions(+), 14 deletions(-)
diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
index f10faabc7ffe..1553dc3152a4 100644
--- a/drivers/clk/at91/sama7d65.c
+++ b/drivers/clk/at91/sama7d65.c
@@ -533,23 +533,23 @@ static struct {
/*
* System clock description
* @n: clock name
- * @p: clock parent name
+ * @p: clock parent hw
* @id: clock id
*/
-static const struct {
+static struct {
const char *n;
- const char *p;
+ struct clk_hw *parent_hw;
u8 id;
} sama7d65_systemck[] = {
- { .n = "uhpck", .p = "usbck", .id = 6 },
- { .n = "pck0", .p = "prog0", .id = 8, },
- { .n = "pck1", .p = "prog1", .id = 9, },
- { .n = "pck2", .p = "prog2", .id = 10, },
- { .n = "pck3", .p = "prog3", .id = 11, },
- { .n = "pck4", .p = "prog4", .id = 12, },
- { .n = "pck5", .p = "prog5", .id = 13, },
- { .n = "pck6", .p = "prog6", .id = 14, },
- { .n = "pck7", .p = "prog7", .id = 15, },
+ { .n = "uhpck", .id = 6 },
+ { .n = "pck0", .id = 8, },
+ { .n = "pck1", .id = 9, },
+ { .n = "pck2", .id = 10, },
+ { .n = "pck3", .id = 11, },
+ { .n = "pck4", .id = 12, },
+ { .n = "pck5", .id = 13, },
+ { .n = "pck6", .id = 14, },
+ { .n = "pck7", .id = 15, },
};
/* Mux table for programmable clocks. */
@@ -1283,10 +1283,19 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
sama7d65_pmc->pchws[i] = hw;
}
-
+ /* Set systemck parent hws. */
+ sama7d65_systemck[0].parent_hw = usbck_hw;
+ sama7d65_systemck[1].parent_hw = sama7d65_pmc->pchws[0];
+ sama7d65_systemck[2].parent_hw = sama7d65_pmc->pchws[1];
+ sama7d65_systemck[3].parent_hw = sama7d65_pmc->pchws[2];
+ sama7d65_systemck[4].parent_hw = sama7d65_pmc->pchws[3];
+ sama7d65_systemck[5].parent_hw = sama7d65_pmc->pchws[4];
+ sama7d65_systemck[6].parent_hw = sama7d65_pmc->pchws[5];
+ sama7d65_systemck[7].parent_hw = sama7d65_pmc->pchws[6];
+ sama7d65_systemck[8].parent_hw = sama7d65_pmc->pchws[7];
for (i = 0; i < ARRAY_SIZE(sama7d65_systemck); i++) {
hw = at91_clk_register_system(regmap, sama7d65_systemck[i].n,
- sama7d65_systemck[i].p, NULL,
+ NULL, &AT91_CLK_PD_HW(sama7d65_systemck[i].parent_hw),
sama7d65_systemck[i].id, 0);
if (IS_ERR(hw))
goto err_free;
--
2.43.0
Powered by blists - more mailing lists