From nobody Tue Oct 7 11:52:00 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 6AAE22FD88B; Thu, 10 Jul 2025 20:07:46 +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=1752178068; cv=none; b=CBQR82VOMzR9tZFeyntpJdptw32z9t1vGOeKjH8EUXPh6MHXDV1w4hyDVk+yPNYHN60Gbdcm9FxHNSdTXUnDyFgrgBIhUpAvlilBmURU5OZIEHSyMjLL5SHXQLiL91XaZfcEUkDDEU4D8GSrWJX0qEULP7JXclCIe7VuHdKMe5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752178068; c=relaxed/simple; bh=5GOJ0lQW0KWwyWnns1RuluAx7md4noju2lvnqWM+LjM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H/k36YTYqK1gX3g7pAKtyXFGKS0MyT00gHNLkPQAsGIqmc4lxSHn8td9aoYYkDL6X4ACTV/aEyh098qxB/E91Wr6u7/k7/19k6mOdcA4F6Yp4SfdB+fnCW2awbvzChy6Vh1tez+CvrnMtqAOQS1dLZGJekU3+N/kamz2ngNU/pA= 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=IWedvZ0/; 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="IWedvZ0/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1752178067; x=1783714067; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5GOJ0lQW0KWwyWnns1RuluAx7md4noju2lvnqWM+LjM=; b=IWedvZ0/Bx+BAEtNWaAcM+kcV9ctD/H7k5aTFqHHAChV8tS0YlRIDOHo uRyH4+8N8dJCKSVYG1EHt/CcL/G/aKPiXyiD33eU8gNRNuxSITY78+D2P jxgM+SG+9XOtnX+CQdXmL23JBYHzmAfNvnVrwgu4N7WrekQ/leEoO/0H0 o6Jw7gVXHA2OE8aOuF21s1Etc0yfWllhq4HwaBaEkXW+lz8v+LGy7G4k0 GrOkS61QYIcC5swENAtF7+LB+zc4edoim7FAlDcU/iy4Ase37wS73YtlJ pZSvgNd+dNzGODMszJSaFxijuqcUfgpguwNxWWPWqYSS9WWpTvPhqFOyH A==; X-CSE-ConnectionGUID: qOQSLemoQZOGUxBCHa7nXg== X-CSE-MsgGUID: eykw9YHwTYKA9zPCKBrXmg== X-IronPort-AV: E=Sophos;i="6.16,301,1744095600"; d="scan'208";a="275215674" 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 16/32] clk: at91: clk-plldiv: add support for parent_hw Date: Thu, 10 Jul 2025 13:07:09 -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 plldiv clock driver. 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-plldiv 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/at91sam9g45.c | 2 +- drivers/clk/at91/at91sam9n12.c | 2 +- drivers/clk/at91/at91sam9x5.c | 2 +- drivers/clk/at91/clk-plldiv.c | 11 +++++++---- drivers/clk/at91/dt-compat.c | 2 +- drivers/clk/at91/pmc.h | 2 +- drivers/clk/at91/sama5d2.c | 2 +- drivers/clk/at91/sama5d3.c | 2 +- drivers/clk/at91/sama5d4.c | 2 +- 9 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/clk/at91/at91sam9g45.c b/drivers/clk/at91/at91sam9g45.c index 3436a09a6e8a..cb98d22c2e30 100644 --- a/drivers/clk/at91/at91sam9g45.c +++ b/drivers/clk/at91/at91sam9g45.c @@ -139,7 +139,7 @@ static void __init at91sam9g45_pmc_setup(struct device_= node *np) if (IS_ERR(hw)) goto err_free; =20 - hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; =20 diff --git a/drivers/clk/at91/at91sam9n12.c b/drivers/clk/at91/at91sam9n12.c index 80ccd4a49df3..34dd7645f964 100644 --- a/drivers/clk/at91/at91sam9n12.c +++ b/drivers/clk/at91/at91sam9n12.c @@ -165,7 +165,7 @@ static void __init at91sam9n12_pmc_setup(struct device_= node *np) if (IS_ERR(hw)) goto err_free; =20 - hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; =20 diff --git a/drivers/clk/at91/at91sam9x5.c b/drivers/clk/at91/at91sam9x5.c index 6b8c755fefdf..37280852f086 100644 --- a/drivers/clk/at91/at91sam9x5.c +++ b/drivers/clk/at91/at91sam9x5.c @@ -187,7 +187,7 @@ static void __init at91sam9x5_pmc_setup(struct device_n= ode *np, if (IS_ERR(hw)) goto err_free; =20 - hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; =20 diff --git a/drivers/clk/at91/clk-plldiv.c b/drivers/clk/at91/clk-plldiv.c index ba3a1839a96d..c5d0c6e27397 100644 --- a/drivers/clk/at91/clk-plldiv.c +++ b/drivers/clk/at91/clk-plldiv.c @@ -72,11 +72,11 @@ static const struct clk_ops plldiv_ops =3D { =20 struct clk_hw * __init at91_clk_register_plldiv(struct regmap *regmap, const char *name, - const char *parent_name) + const char *parent_name, struct clk_parent_data *parent_data) { struct clk_plldiv *plldiv; struct clk_hw *hw; - struct clk_init_data init; + struct clk_init_data init =3D {}; int ret; =20 plldiv =3D kzalloc(sizeof(*plldiv), GFP_KERNEL); @@ -85,8 +85,11 @@ at91_clk_register_plldiv(struct regmap *regmap, const ch= ar *name, =20 init.name =3D name; init.ops =3D &plldiv_ops; - init.parent_names =3D parent_name ? &parent_name : NULL; - init.num_parents =3D parent_name ? 1 : 0; + 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 plldiv->hw.init =3D &init; diff --git a/drivers/clk/at91/dt-compat.c b/drivers/clk/at91/dt-compat.c index 22bcaa3b28dd..3285e3110b58 100644 --- a/drivers/clk/at91/dt-compat.c +++ b/drivers/clk/at91/dt-compat.c @@ -724,7 +724,7 @@ of_at91sam9x5_clk_plldiv_setup(struct device_node *np) if (IS_ERR(regmap)) return; =20 - hw =3D at91_clk_register_plldiv(regmap, name, parent_name); + hw =3D at91_clk_register_plldiv(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 519d71652619..df2deb134a8d 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -243,7 +243,7 @@ at91_clk_register_pll(struct regmap *regmap, const char= *name, const struct clk_pll_characteristics *characteristics); struct clk_hw * __init at91_clk_register_plldiv(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 sam9x60_clk_register_div_pll(struct regmap *regmap, spinlock_t *lock, diff --git a/drivers/clk/at91/sama5d2.c b/drivers/clk/at91/sama5d2.c index d2af421abddc..7904f2122ed7 100644 --- a/drivers/clk/at91/sama5d2.c +++ b/drivers/clk/at91/sama5d2.c @@ -220,7 +220,7 @@ static void __init sama5d2_pmc_setup(struct device_node= *np) if (IS_ERR(hw)) goto err_free; =20 - hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; =20 diff --git a/drivers/clk/at91/sama5d3.c b/drivers/clk/at91/sama5d3.c index 9d86c350a1e7..7f2ac8f648dd 100644 --- a/drivers/clk/at91/sama5d3.c +++ b/drivers/clk/at91/sama5d3.c @@ -166,7 +166,7 @@ static void __init sama5d3_pmc_setup(struct device_node= *np) if (IS_ERR(hw)) goto err_free; =20 - hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; =20 diff --git a/drivers/clk/at91/sama5d4.c b/drivers/clk/at91/sama5d4.c index 8491b1e0391d..7cda8032653e 100644 --- a/drivers/clk/at91/sama5d4.c +++ b/drivers/clk/at91/sama5d4.c @@ -181,7 +181,7 @@ static void __init sama5d4_pmc_setup(struct device_node= *np) if (IS_ERR(hw)) goto err_free; =20 - hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack"); + hw =3D at91_clk_register_plldiv(regmap, "plladivck", "pllack", NULL); if (IS_ERR(hw)) goto err_free; =20 --=20 2.43.0