From nobody Sun Feb 8 01:21:30 2026 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08D9F34CFA8; Fri, 16 Jan 2026 20:07:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768594046; cv=none; b=ZNU2RqKiAdIvOfS6CFHtE/+yRl9g8DIolaeqDeNHXJEUfrr5YaCqawJ037dNXPC3Jpa+JI/c8ZbTequTlhoE3mggUqxFOHpXzX/4l8ydG/D8g/jzmgvcgdxJF46LsPqa/StepjDMZNpXrPwOKLNYNmMogcod58uQG/4RrG1XFCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768594046; c=relaxed/simple; bh=i+HmjWJwmg1Ne8dMrp2TjmodU6BZus8Si32RJLHwbok=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=M/dONxs1gSVR+jVAkdsDWr9Bs04Sn/XC88ohO/NweoNIWOkWvb3HdZmafgZzxjjyjsQi0TWwI4bsZOYBaYTxsrjBilAj5wzucjwvpNCE9X4T1/V3VE3Xg0frV6b7O+7rOpJpiWSCwY+k2W+luc5BPGPiKWd+YwItfnvYBuzgywQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=0N6Yrbnh; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="0N6Yrbnh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1768594045; x=1800130045; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=i+HmjWJwmg1Ne8dMrp2TjmodU6BZus8Si32RJLHwbok=; b=0N6YrbnhurT3eh5778PONvKgPMKurF7MrolvMBbPq9PZeK/7WvMGP+vK rd2KSZ/d83KVRLGshD/awNzDOPHeINs0tCLNUfIyUl3SNudDVO2J6wDXU LefEZl6BU7xdLQkaFrNZp6P6BYnQFN9FuB9/b8i5kxX58pccO7n2CqVR/ J7iY9FJjpn20EMUbQKZlBUeEr6xzGATwpZ77wsdQC5We6k3i/uhA7Je/T uy9RLV7IH8Byqd8TBZLxFKX4JY2aXPSZjDj18RMHdlSw2JLbsZjbW65eh lEJ8mNdqpqu0wWqdt/Qcn1Rg73ieYEw9oOtGqH2VC4UM2+V2HXToAFzRk A==; X-CSE-ConnectionGUID: +9RSiAtvRY+RhxWEUm06Wg== X-CSE-MsgGUID: OLs2/IBpSlyI+ueSWyzIrg== X-IronPort-AV: E=Sophos;i="6.21,232,1763449200"; d="scan'208";a="283397049" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2026 13:07:16 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex1.mchp-main.com (10.10.87.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.2562.29; Fri, 16 Jan 2026 13:07:04 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.58 via Frontend Transport; Fri, 16 Jan 2026 13:07:04 -0700 From: To: , , , , , , , CC: , , , , Subject: [PATCH v5 08/31] clk: at91: clk-master: use clk_parent_data Date: Fri, 16 Jan 2026 13:07:01 -0700 Message-ID: <548c567b5144e3556aee5e39a9c11ed13167a14a.1768512290.git.ryan.wanner@microchip.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Claudiu Beznea Use struct clk_parent_data instead of struct parent_hw as this leads to less usage of __clk_get_hw() in SoC specific clock drivers and simpler conversion of existing SoC specific clock drivers from parent_names to modern clk_parent_data structures. __clk_get_hw will be removed in subsequent patches. Signed-off-by: Claudiu Beznea [ryan.wanner@microchip.com: Add clk-master changes to SAM9X75 and SAMA7D65 SoCs. As well as add md_slck commit message.] Signed-off-by: Ryan Wanner --- drivers/clk/at91/clk-master.c | 24 ++++++++++++------------ drivers/clk/at91/pmc.h | 6 +++--- drivers/clk/at91/sam9x7.c | 14 +++++++------- drivers/clk/at91/sama7d65.c | 17 +++++++---------- drivers/clk/at91/sama7g5.c | 17 +++++++---------- 5 files changed, 36 insertions(+), 42 deletions(-) diff --git a/drivers/clk/at91/clk-master.c b/drivers/clk/at91/clk-master.c index d5ea2069ec83..b8d000b3b180 100644 --- a/drivers/clk/at91/clk-master.c +++ b/drivers/clk/at91/clk-master.c @@ -473,7 +473,7 @@ static struct clk_hw * __init at91_clk_register_master_internal(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, - struct clk_hw **parent_hws, + struct clk_parent_data *parent_data, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, const struct clk_ops *ops, spinlock_t *lock, u32 flags) @@ -485,7 +485,7 @@ at91_clk_register_master_internal(struct regmap *regmap, unsigned long irqflags; int ret; =20 - if (!name || !num_parents || !(parent_names || parent_hws) || !lock) + if (!name || !num_parents || !(parent_names || parent_data) || !lock) return ERR_PTR(-EINVAL); =20 master =3D kzalloc(sizeof(*master), GFP_KERNEL); @@ -494,8 +494,8 @@ at91_clk_register_master_internal(struct regmap *regmap, =20 init.name =3D name; init.ops =3D ops; - if (parent_hws) - init.parent_hws =3D (const struct clk_hw **)parent_hws; + if (parent_data) + init.parent_data =3D (const struct clk_parent_data *)parent_data; else init.parent_names =3D parent_names; init.num_parents =3D num_parents; @@ -531,13 +531,13 @@ struct clk_hw * __init at91_clk_register_master_pres(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, - struct clk_hw **parent_hws, + struct clk_parent_data *parent_data, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock) { return at91_clk_register_master_internal(regmap, name, num_parents, - parent_names, parent_hws, layout, + parent_names, parent_data, layout, characteristics, &master_pres_ops, lock, CLK_SET_RATE_GATE); @@ -546,7 +546,7 @@ at91_clk_register_master_pres(struct regmap *regmap, struct clk_hw * __init at91_clk_register_master_div(struct regmap *regmap, const char *name, const char *parent_name, - struct clk_hw *parent_hw, const struct clk_master_layout *layout, + struct clk_parent_data *parent_data, const struct clk_master_layout *lay= out, const struct clk_master_characteristics *characteristics, spinlock_t *lock, u32 flags, u32 safe_div) { @@ -560,7 +560,7 @@ at91_clk_register_master_div(struct regmap *regmap, =20 hw =3D at91_clk_register_master_internal(regmap, name, 1, parent_name ? &parent_name : NULL, - parent_hw ? &parent_hw : NULL, layout, + parent_data, layout, characteristics, ops, lock, flags); =20 @@ -815,7 +815,7 @@ struct clk_hw * __init at91_clk_sama7g5_register_master(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, - struct clk_hw **parent_hws, + struct clk_parent_data *parent_data, u32 *mux_table, spinlock_t *lock, u8 id, bool critical, int chg_pid) @@ -827,7 +827,7 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, unsigned int val; int ret; =20 - if (!name || !num_parents || !(parent_names || parent_hws) || !mux_table = || + if (!name || !num_parents || !(parent_names || parent_data) || !mux_table= || !lock || id > MASTER_MAX_ID) return ERR_PTR(-EINVAL); =20 @@ -837,8 +837,8 @@ at91_clk_sama7g5_register_master(struct regmap *regmap, =20 init.name =3D name; init.ops =3D &sama7g5_master_ops; - if (parent_hws) - init.parent_hws =3D (const struct clk_hw **)parent_hws; + if (parent_data) + init.parent_data =3D (const struct clk_parent_data *)parent_data; else init.parent_names =3D parent_names; init.num_parents =3D num_parents; diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index dcb678732471..24ef879c712c 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -207,14 +207,14 @@ at91_clk_register_sam9x5_main(struct regmap *regmap, = const char *name, struct clk_hw * __init at91_clk_register_master_pres(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, - struct clk_hw **parent_hws, + struct clk_parent_data *parent_data, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock); =20 struct clk_hw * __init at91_clk_register_master_div(struct regmap *regmap, const char *name, - const char *parent_names, struct clk_hw *parent_hw, + const char *parent_names, struct clk_parent_data *parent_data, const struct clk_master_layout *layout, const struct clk_master_characteristics *characteristics, spinlock_t *lock, u32 flags, u32 safe_div); @@ -223,7 +223,7 @@ struct clk_hw * __init at91_clk_sama7g5_register_master(struct regmap *regmap, const char *name, int num_parents, const char **parent_names, - struct clk_hw **parent_hws, u32 *mux_table, + struct clk_parent_data *parent_data, u32 *mux_table, spinlock_t *lock, u8 id, bool critical, int chg_pid); =20 diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c index aee1d60492aa..e8005b727a6b 100644 --- a/drivers/clk/at91/sam9x7.c +++ b/drivers/clk/at91/sam9x7.c @@ -752,7 +752,7 @@ static void __init sam9x7_pmc_setup(struct device_node = *np) struct regmap *regmap; struct clk_hw *hw, *main_rc_hw, *main_osc_hw, *main_xtal_hw; struct clk_hw *td_slck_hw, *md_slck_hw, *usbck_hw; - struct clk_parent_data parent_data[2]; + struct clk_parent_data parent_data[9]; struct clk_hw *parent_hws[9]; int i, j; =20 @@ -862,18 +862,18 @@ static void __init sam9x7_pmc_setup(struct device_nod= e *np) } } =20 - parent_hws[0] =3D md_slck_hw; - parent_hws[1] =3D sam9x7_pmc->chws[PMC_MAIN]; - parent_hws[2] =3D sam9x7_plls[PLL_ID_PLLA][PLL_COMPID_DIV0].hw; - parent_hws[3] =3D sam9x7_plls[PLL_ID_UPLL][PLL_COMPID_DIV0].hw; + parent_data[0] =3D AT91_CLK_PD_NAME("md_slck"); + parent_data[1] =3D AT91_CLK_PD_HW(sam9x7_pmc->chws[PMC_MAIN]); + parent_data[2] =3D AT91_CLK_PD_HW(sam9x7_plls[PLL_ID_PLLA][PLL_COMPID_DIV= 0].hw); + parent_data[3] =3D AT91_CLK_PD_HW(sam9x7_plls[PLL_ID_UPLL][PLL_COMPID_DIV= 0].hw); hw =3D at91_clk_register_master_pres(regmap, "masterck_pres", 4, - NULL, parent_hws, &sam9x7_master_layout, + NULL, parent_data, &sam9x7_master_layout, &mck_characteristics, &mck_lock); if (IS_ERR(hw)) goto err_free; =20 hw =3D at91_clk_register_master_div(regmap, "masterck_div", - NULL, hw, &sam9x7_master_layout, + NULL, &AT91_CLK_PD_HW(hw), &sam9x7_master_layout, &mck_characteristics, &mck_lock, CLK_SET_RATE_GATE, 0); if (IS_ERR(hw)) diff --git a/drivers/clk/at91/sama7d65.c b/drivers/clk/at91/sama7d65.c index 94e3fe78929d..ccbc459edd31 100644 --- a/drivers/clk/at91/sama7d65.c +++ b/drivers/clk/at91/sama7d65.c @@ -1101,7 +1101,7 @@ static void __init sama7d65_pmc_setup(struct device_n= ode *np) struct regmap *regmap; struct clk_hw *hw, *main_rc_hw, *main_osc_hw, *main_xtal_hw; struct clk_hw *td_slck_hw, *md_slck_hw; - struct clk_parent_data parent_data[2]; + struct clk_parent_data parent_data[10]; struct clk_hw *parent_hws[10]; bool bypass; int i, j; @@ -1212,7 +1212,7 @@ static void __init sama7d65_pmc_setup(struct device_n= ode *np) } =20 hw =3D at91_clk_register_master_div(regmap, "mck0", NULL, - sama7d65_plls[PLL_ID_CPU][1].hw, + &AT91_CLK_PD_HW(sama7d65_plls[PLL_ID_CPU][1].hw), &mck0_layout, &mck0_characteristics, &pmc_mck0_lock, CLK_GET_RATE_NOCACHE, 5); if (IS_ERR(hw)) @@ -1221,12 +1221,11 @@ static void __init sama7d65_pmc_setup(struct device= _node *np) sama7d65_pmc->chws[PMC_MCK] =3D hw; sama7d65_mckx[PCK_PARENT_HW_MCK0].hw =3D hw; =20 - parent_hws[0] =3D md_slck_hw; - parent_hws[1] =3D td_slck_hw; - parent_hws[2] =3D sama7d65_pmc->chws[PMC_MAIN]; + parent_data[0] =3D AT91_CLK_PD_NAME("md_slck"); + parent_data[1] =3D AT91_CLK_PD_NAME("td_slck"); + parent_data[2] =3D AT91_CLK_PD_HW(sama7d65_pmc->chws[PMC_MAIN]); for (i =3D PCK_PARENT_HW_MCK1; i < ARRAY_SIZE(sama7d65_mckx); i++) { u8 num_parents =3D 3 + sama7d65_mckx[i].ep_count; - struct clk_hw *tmp_parent_hws[8]; u32 *mux_table; =20 mux_table =3D kmalloc_array(num_parents, sizeof(*mux_table), @@ -1243,13 +1242,11 @@ static void __init sama7d65_pmc_setup(struct device= _node *np) u8 pll_id =3D sama7d65_mckx[i].ep[j].pll_id; u8 pll_compid =3D sama7d65_mckx[i].ep[j].pll_compid; =20 - tmp_parent_hws[j] =3D sama7d65_plls[pll_id][pll_compid].hw; + parent_data[3 + j] =3D AT91_CLK_PD_HW(sama7d65_plls[pll_id][pll_compid]= .hw); } - PMC_FILL_TABLE(&parent_hws[3], tmp_parent_hws, - sama7d65_mckx[i].ep_count); =20 hw =3D at91_clk_sama7g5_register_master(regmap, sama7d65_mckx[i].n, - num_parents, NULL, parent_hws, + num_parents, NULL, parent_data, mux_table, &pmc_mckX_lock, sama7d65_mckx[i].id, sama7d65_mckx[i].c, diff --git a/drivers/clk/at91/sama7g5.c b/drivers/clk/at91/sama7g5.c index 058004379ce9..74cf712f2820 100644 --- a/drivers/clk/at91/sama7g5.c +++ b/drivers/clk/at91/sama7g5.c @@ -978,7 +978,7 @@ static void __init sama7g5_pmc_setup(struct device_node= *np) struct regmap *regmap; struct clk_hw *hw, *main_rc_hw, *main_osc_hw; struct clk_hw *td_slck_hw, *md_slck_hw; - struct clk_parent_data parent_data[2]; + struct clk_parent_data parent_data[10]; struct clk_hw *parent_hws[10]; bool bypass; int i, j; @@ -1094,7 +1094,7 @@ static void __init sama7g5_pmc_setup(struct device_no= de *np) } =20 hw =3D at91_clk_register_master_div(regmap, "mck0", NULL, - sama7g5_plls[PLL_ID_CPU][1].hw, + &AT91_CLK_PD_HW(sama7g5_plls[PLL_ID_CPU][1].hw), &mck0_layout, &mck0_characteristics, &pmc_mck0_lock, CLK_GET_RATE_NOCACHE, 5); if (IS_ERR(hw)) @@ -1102,12 +1102,11 @@ static void __init sama7g5_pmc_setup(struct device_= node *np) =20 sama7g5_mckx[PCK_PARENT_HW_MCK0].hw =3D sama7g5_pmc->chws[PMC_MCK] =3D hw; =20 - parent_hws[0] =3D md_slck_hw; - parent_hws[1] =3D td_slck_hw; - parent_hws[2] =3D sama7g5_pmc->chws[PMC_MAIN]; + parent_data[0] =3D AT91_CLK_PD_NAME("md_slck"); + parent_data[1] =3D AT91_CLK_PD_NAME("td_slck"); + parent_data[2] =3D AT91_CLK_PD_HW(sama7g5_pmc->chws[PMC_MAIN]); for (i =3D PCK_PARENT_HW_MCK1; i < ARRAY_SIZE(sama7g5_mckx); i++) { u8 num_parents =3D 3 + sama7g5_mckx[i].ep_count; - struct clk_hw *tmp_parent_hws[8]; u32 *mux_table; =20 mux_table =3D kmalloc_array(num_parents, sizeof(*mux_table), @@ -1122,13 +1121,11 @@ static void __init sama7g5_pmc_setup(struct device_= node *np) u8 pll_id =3D sama7g5_mckx[i].ep[j].pll_id; u8 pll_compid =3D sama7g5_mckx[i].ep[j].pll_compid; =20 - tmp_parent_hws[j] =3D sama7g5_plls[pll_id][pll_compid].hw; + parent_data[3 + j] =3D AT91_CLK_PD_HW(sama7g5_plls[pll_id][pll_compid].= hw); } - PMC_FILL_TABLE(&parent_hws[3], tmp_parent_hws, - sama7g5_mckx[i].ep_count); =20 hw =3D at91_clk_sama7g5_register_master(regmap, sama7g5_mckx[i].n, - num_parents, NULL, parent_hws, mux_table, + num_parents, NULL, parent_data, mux_table, &pmc_mckX_lock, sama7g5_mckx[i].id, sama7g5_mckx[i].c, sama7g5_mckx[i].ep_chg_id); --=20 2.43.0