From nobody Tue Oct 7 11:39:36 2025 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 960A03D6F; Thu, 10 Jul 2025 20:07:44 +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=1752178066; cv=none; b=LvoHR5eemGcwLb4AnLUilcHKvpPZ2QMybcuB4fScvnVXP+ZaNwVNVGJXiUgXYvMfZBib6ua8pt/b8Th99atVetOvtaBudZjGqu/i7l5YDvnawj7E+mNe1tGpui/ZXUyyfHjbQKElYYtsTZNjyEa2QC2wcEqbLb5Y89b2ELL7guc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752178066; c=relaxed/simple; bh=YbFiBSQEyNsg4Tz2KUNUu1qOnS5RcKyYzosOASOh0uk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SfuU78E90gvGpAiqdZsgBTtBBeBw0FEV22gbiyZIbjhXR0QDmsBYrzaS30hgzoj7DCf2czlVXh19i4UbMq15o3RTkZVkt5miZ6pFszurd8ZOlQ2Ntk2SbjsdSdkGYW7ugACuFo8Q8/dPcH0QVi7wP3xL2CbOnzfdIrsq666bMoM= 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=EEtkBRYD; 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="EEtkBRYD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1752178065; x=1783714065; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YbFiBSQEyNsg4Tz2KUNUu1qOnS5RcKyYzosOASOh0uk=; b=EEtkBRYDIEs3qQj+O7/n4eTdt161PNsAHyY2ACHqjzz54/JsVPKPLZpb HYaTdfXjbRBXsm19X7Km1TcceRJBlOBiGGNxbY5RpUKxZmE+1qozg8es9 AbCdqO1ZHnL15DYUG/5MdojUnhZIiTr29C5QzObTou4brWQYiHxj1HywJ zL8aSSm/Gsk0vLKjxThHDQm0rD3qqtITw5b/QTa1s7IiMcqhIKHqJxI8l l3ijdbPWq68FvIK5cNWrGyPbLdWDNVvQvzbbywaSIvH3u+XxeUv6i58SD CDbfFcDHeNos+nHtyx64lOvGz0K2sVy/M1Vj6Q5KDlZfS9sXlUoHbaZAl A==; X-CSE-ConnectionGUID: qOQSLemoQZOGUxBCHa7nXg== X-CSE-MsgGUID: 6pn2MI4sQe+bNBXBAvLrPw== X-IronPort-AV: E=Sophos;i="6.16,301,1744095600"; d="scan'208";a="275215673" 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-AES128-GCM-SHA256; 10 Jul 2025 13:07:37 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Thu, 10 Jul 2025 13:07:32 -0700 Received: from ryan-Precision-3630-Tower.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.44 via Frontend Transport; Thu, 10 Jul 2025 13:07:32 -0700 From: To: , , , , CC: , , , , Subject: [PATCH v3 15/32] clk: at91: clk-audio-pll: add support for parent_hw Date: Thu, 10 Jul 2025 13:07:08 -0700 Message-ID: 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 Add support for parent_hw in audio pll clock drivers. With this parent-child relation is described with pointers rather than strings making registration a bit faster. All the SoC based drivers that rely on clk-audio-pll were adapted to the new API change. The switch itself for SoCs will be done in subsequent patches. Signed-off-by: Claudiu Beznea Signed-off-by: Ryan Wanner --- drivers/clk/at91/clk-audio-pll.c | 28 ++++++++++++++++++++-------- drivers/clk/at91/dt-compat.c | 6 +++--- drivers/clk/at91/pmc.h | 6 +++--- drivers/clk/at91/sama5d2.c | 6 +++--- 4 files changed, 29 insertions(+), 17 deletions(-) diff --git a/drivers/clk/at91/clk-audio-pll.c b/drivers/clk/at91/clk-audio-= pll.c index a92da64c12e1..da9b2e699dcc 100644 --- a/drivers/clk/at91/clk-audio-pll.c +++ b/drivers/clk/at91/clk-audio-pll.c @@ -450,7 +450,8 @@ static const struct clk_ops audio_pll_pmc_ops =3D { =20 struct clk_hw * __init at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, + struct clk_parent_data *parent_data) { struct clk_audio_frac *frac_ck; struct clk_init_data init =3D {}; @@ -462,7 +463,10 @@ at91_clk_register_audio_pll_frac(struct regmap *regmap= , const char *name, =20 init.name =3D name; init.ops =3D &audio_pll_frac_ops; - init.parent_names =3D &parent_name; + if (parent_data) + init.parent_data =3D (const struct clk_parent_data *)parent_data; + else + init.parent_names =3D &parent_name; init.num_parents =3D 1; init.flags =3D CLK_SET_RATE_GATE; =20 @@ -480,10 +484,11 @@ at91_clk_register_audio_pll_frac(struct regmap *regma= p, const char *name, =20 struct clk_hw * __init at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, + struct clk_parent_data *parent_data) { struct clk_audio_pad *apad_ck; - struct clk_init_data init; + struct clk_init_data init =3D {}; int ret; =20 apad_ck =3D kzalloc(sizeof(*apad_ck), GFP_KERNEL); @@ -492,7 +497,10 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap,= const char *name, =20 init.name =3D name; init.ops =3D &audio_pll_pad_ops; - init.parent_names =3D &parent_name; + if (parent_data) + init.parent_data =3D (const struct clk_parent_data *)parent_data; + else + init.parent_names =3D &parent_name; init.num_parents =3D 1; init.flags =3D CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; @@ -511,10 +519,11 @@ at91_clk_register_audio_pll_pad(struct regmap *regmap= , const char *name, =20 struct clk_hw * __init at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, + struct clk_parent_data *parent_data) { struct clk_audio_pmc *apmc_ck; - struct clk_init_data init; + struct clk_init_data init =3D {}; int ret; =20 apmc_ck =3D kzalloc(sizeof(*apmc_ck), GFP_KERNEL); @@ -523,7 +532,10 @@ at91_clk_register_audio_pll_pmc(struct regmap *regmap,= const char *name, =20 init.name =3D name; init.ops =3D &audio_pll_pmc_ops; - init.parent_names =3D &parent_name; + if (parent_data) + init.parent_data =3D (const struct clk_parent_data *)parent_data; + else + init.parent_names =3D &parent_name; init.num_parents =3D 1; init.flags =3D CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE | CLK_SET_RATE_PARENT; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 2c5faa3b1cfd..22bcaa3b28dd 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -43,7 +43,7 @@ static void __init of_sama5d2_clk_audio_pll_frac_setup(st= ruct device_node *np) =20 parent_name =3D of_clk_get_parent_name(np, 0); =20 - hw =3D at91_clk_register_audio_pll_frac(regmap, name, parent_name); + hw =3D at91_clk_register_audio_pll_frac(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; =20 @@ -69,7 +69,7 @@ static void __init of_sama5d2_clk_audio_pll_pad_setup(str= uct device_node *np) =20 parent_name =3D of_clk_get_parent_name(np, 0); =20 - hw =3D at91_clk_register_audio_pll_pad(regmap, name, parent_name); + hw =3D at91_clk_register_audio_pll_pad(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; =20 @@ -95,7 +95,7 @@ static void __init of_sama5d2_clk_audio_pll_pmc_setup(str= uct device_node *np) =20 parent_name =3D of_clk_get_parent_name(np, 0); =20 - hw =3D at91_clk_register_audio_pll_pmc(regmap, name, parent_name); + hw =3D at91_clk_register_audio_pll_pmc(regmap, name, parent_name, NULL); if (IS_ERR(hw)) return; =20 diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 0feaf8497b60..519d71652619 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -157,15 +157,15 @@ struct clk_hw *of_clk_hw_pmc_get(struct of_phandle_ar= gs *clkspec, void *data); =20 struct clk_hw * __init at91_clk_register_audio_pll_frac(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_parent_data *parent_data); =20 struct clk_hw * __init at91_clk_register_audio_pll_pad(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_parent_data *parent_data); =20 struct clk_hw * __init at91_clk_register_audio_pll_pmc(struct regmap *regmap, const char *name, - const char *parent_name); + const char *parent_name, struct clk_parent_data *parent_data); =20 struct clk_hw * __init at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index bc62b9ed4ea0..d2af421abddc 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -227,19 +227,19 @@ static void __init sama5d2_pmc_setup(struct device_no= de *np) sama5d2_pmc->chws[PMC_PLLACK] =3D hw; =20 hw =3D at91_clk_register_audio_pll_frac(regmap, "audiopll_fracck", - "mainck"); + "mainck", NULL); if (IS_ERR(hw)) goto err_free; =20 hw =3D at91_clk_register_audio_pll_pad(regmap, "audiopll_padck", - "audiopll_fracck"); + "audiopll_fracck", NULL); if (IS_ERR(hw)) goto err_free; =20 sama5d2_pmc->chws[PMC_AUDIOPINCK] =3D hw; =20 hw =3D at91_clk_register_audio_pll_pmc(regmap, "audiopll_pmcck", - "audiopll_fracck"); + "audiopll_fracck", NULL); if (IS_ERR(hw)) goto err_free; =20 --=20 2.43.0