[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b0635913503630a8e1880b0b9ba8656465020181.1758226719.git.Ryan.Wanner@microchip.com>
Date: Thu, 18 Sep 2025 14:15:47 -0700
From: <Ryan.Wanner@...rochip.com>
To: <mturquette@...libre.com>, <sboyd@...nel.org>,
<alexandre.belloni@...tlin.com>, <claudiu.beznea@...on.dev>,
<nicolas.ferre@...rochip.com>
CC: <linux-clk@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <varshini.rajendran@...rochip.com>
Subject: [PATCH v4 05/31] clk: at91: clk-peripheral: switch to clk_parent_data
From: Claudiu Beznea <claudiu.beznea@...on.dev>
Use struct clk_parent_data instead of parent_hw for peripheral clocks.
Signed-off-by: Claudiu Beznea <claudiu.beznea@...on.dev>
[ryan.wanner@...rochip.com: Add SAMA7D65 and SAM9X7 SoCs to the use the
structs.]
Signed-off-by: Ryan Wanner <Ryan.Wanner@...rochip.com>
---
drivers/clk/at91/clk-peripheral.c | 16 ++++++++--------
drivers/clk/at91/pmc.h | 4 ++--
drivers/clk/at91/sam9x7.c | 2 +-
drivers/clk/at91/sama7d65.c | 2 +-
drivers/clk/at91/sama7g5.c | 2 +-
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-peripheral.c
index c173a44c800a..ed97b3c0a66b 100644
--- a/drivers/clk/at91/clk-peripheral.c
+++ b/drivers/clk/at91/clk-peripheral.c
@@ -97,7 +97,7 @@ static const struct clk_ops peripheral_ops = {
struct clk_hw * __init
at91_clk_register_peripheral(struct regmap *regmap, const char *name,
- const char *parent_name, struct clk_hw *parent_hw,
+ const char *parent_name, struct clk_parent_data *parent_data,
u32 id)
{
struct clk_peripheral *periph;
@@ -105,7 +105,7 @@ at91_clk_register_peripheral(struct regmap *regmap, const char *name,
struct clk_hw *hw;
int ret;
- if (!name || !(parent_name || parent_hw) || id > PERIPHERAL_ID_MAX)
+ if (!name || !(parent_name || parent_data) || id > PERIPHERAL_ID_MAX)
return ERR_PTR(-EINVAL);
periph = kzalloc(sizeof(*periph), GFP_KERNEL);
@@ -114,8 +114,8 @@ at91_clk_register_peripheral(struct regmap *regmap, const char *name,
init.name = name;
init.ops = &peripheral_ops;
- if (parent_hw)
- init.parent_hws = (const struct clk_hw **)&parent_hw;
+ if (parent_data)
+ init.parent_data = (const struct clk_parent_data *)parent_data;
else
init.parent_names = &parent_name;
init.num_parents = 1;
@@ -448,7 +448,7 @@ struct clk_hw * __init
at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
const struct clk_pcr_layout *layout,
const char *name, const char *parent_name,
- struct clk_hw *parent_hw,
+ struct clk_parent_data *parent_data,
u32 id, const struct clk_range *range,
int chg_pid, unsigned long flags)
{
@@ -457,7 +457,7 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
struct clk_hw *hw;
int ret;
- if (!name || !(parent_name || parent_hw))
+ if (!name || !(parent_name || parent_data))
return ERR_PTR(-EINVAL);
periph = kzalloc(sizeof(*periph), GFP_KERNEL);
@@ -465,8 +465,8 @@ at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
return ERR_PTR(-ENOMEM);
init.name = name;
- if (parent_hw)
- init.parent_hws = (const struct clk_hw **)&parent_hw;
+ if (parent_data)
+ init.parent_data = (const struct clk_parent_data *)parent_data;
else
init.parent_names = &parent_name;
init.num_parents = 1;
diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h
index d3fc38cf90eb..9b0c641e747b 100644
--- a/drivers/clk/at91/pmc.h
+++ b/drivers/clk/at91/pmc.h
@@ -229,13 +229,13 @@ at91_clk_sama7g5_register_master(struct regmap *regmap,
struct clk_hw * __init
at91_clk_register_peripheral(struct regmap *regmap, const char *name,
- const char *parent_name, struct clk_hw *parent_hw,
+ const char *parent_name, struct clk_parent_data *parent_data,
u32 id);
struct clk_hw * __init
at91_clk_register_sam9x5_peripheral(struct regmap *regmap, spinlock_t *lock,
const struct clk_pcr_layout *layout,
const char *name, const char *parent_name,
- struct clk_hw *parent_hw,
+ struct clk_parent_data *parent_data,
u32 id, const struct clk_range *range,
int chg_pid, unsigned long flags);
diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
index c80306715d90..ff9dbaac5f04 100644
--- a/drivers/clk/at91/sam9x7.c
+++ b/drivers/clk/at91/sam9x7.c
@@ -925,7 +925,7 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
hw = at91_clk_register_sam9x5_peripheral(regmap, &pmc_pcr_lock,
&sam9x7_pcr_layout,
sam9x7_periphck[i].n,
- NULL, sam9x7_pmc->chws[PMC_MCK],
+ NULL, &AT91_CLK_PD_HW(sam9x7_pmc->chws[PMC_MCK]),
sam9x7_periphck[i].id,
&range, INT_MIN,
sam9x7_periphck[i].f);
diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c
index 6229b7dfbea1..6367fa7efd06 100644
--- a/drivers/clk/at91/sama7d65.c
+++ b/drivers/clk/at91/sama7d65.c
@@ -1307,7 +1307,7 @@ static void __init sama7d65_pmc_setup(struct device_node *np)
&sama7d65_pcr_layout,
sama7d65_periphck[i].n,
NULL,
- sama7d65_mckx[sama7d65_periphck[i].p].hw,
+ &AT91_CLK_PD_HW(sama7d65_mckx[sama7d65_periphck[i].p].hw),
sama7d65_periphck[i].id,
&sama7d65_periphck[i].r,
sama7d65_periphck[i].chgp ? 0 :
diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c
index 654c9f43fcf8..091845ca251c 100644
--- a/drivers/clk/at91/sama7g5.c
+++ b/drivers/clk/at91/sama7g5.c
@@ -1180,7 +1180,7 @@ static void __init sama7g5_pmc_setup(struct device_node *np)
&sama7g5_pcr_layout,
sama7g5_periphck[i].n,
NULL,
- sama7g5_mckx[sama7g5_periphck[i].p].hw,
+ &AT91_CLK_PD_HW(sama7g5_mckx[sama7g5_periphck[i].p].hw),
sama7g5_periphck[i].id,
&sama7g5_periphck[i].r,
sama7g5_periphck[i].chgp ? 0 :
--
2.43.0
Powered by blists - more mailing lists