From nobody Fri Dec 19 14:38:29 2025 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C8ECD30217B; Wed, 5 Nov 2025 09:15:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762334111; cv=none; b=YIAach3vmfOKMyzmDV5cP7JZL3TtC1/PdHGL0HHzrx42Phq94nZ6kKImqT40SSiR8nT101ZIUM9mJLitqQntu/524H4pK3ZEtzAV2hgVltCy8FXQldqzGSIdb26/TAUjCnX/4NfvPBTTgOrUm+FHbPWLQIUYJSxyOUQPnFwLuxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762334111; c=relaxed/simple; bh=sieYt+3F9Zw/H+8sIMltSZBuydLmcz7sTPKXYOu6a5I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eUVHqVFP6oIA0E/+RuahrJjarR3ZqDGgIi2fXVwFwB6feyBRDhv9Rj8oKYLNK6Tt8G8btZi3dprBxdg1kKZM3Xo99XaQHdGqTYxlZvCrnXGxudmnCpLOPi+vtwiQZZ67t7YhVMLbu8okVjD0X6fovBDi9UbTYN58jJILh1L2o3g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com; spf=pass smtp.mailfrom=renesas.com; arc=none smtp.client-ip=210.160.252.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=renesas.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=renesas.com X-CSE-ConnectionGUID: fajgRyttRDej77ibsz166Q== X-CSE-MsgGUID: q0U0OITIRASi7cJNdkVYbQ== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 05 Nov 2025 18:15:07 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.38]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 88D8341763F1; Wed, 5 Nov 2025 18:15:02 +0900 (JST) From: Cosmin Tanislav To: Cc: Fabrizio Castro , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Michael Turquette , Stephen Boyd , Philipp Zabel , linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, Cosmin Tanislav Subject: [PATCH 04/14] spi: rzv2h-rspi: make clocks chip-specific Date: Wed, 5 Nov 2025 11:13:48 +0200 Message-ID: <20251105091401.1462985-5-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20251105091401.1462985-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251105091401.1462985-1-cosmin-gabriel.tanislav.xa@renesas.com> 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" The Renesas RZ/T2H (R9A09G077) and RZ/N2H (R9A09G087) SoCs have different clocks compared to RZ/V2H. Set the number of clocks and the name of the transfer clock in the chip-specific structure to prepare for adding support for them. Signed-off-by: Cosmin Tanislav --- drivers/spi/spi-rzv2h-rspi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-rzv2h-rspi.c b/drivers/spi/spi-rzv2h-rspi.c index 7a7a576c17dd..a1f17ec8727b 100644 --- a/drivers/spi/spi-rzv2h-rspi.c +++ b/drivers/spi/spi-rzv2h-rspi.c @@ -66,10 +66,11 @@ #define RSPI_SPSRC_CLEAR 0xfd80 =20 #define RSPI_RESET_NUM 2 -#define RSPI_CLK_NUM 3 =20 struct rzv2h_rspi_info { + const char *tclk_name; unsigned int fifo_size; + unsigned int num_clks; }; =20 struct rzv2h_rspi_priv { @@ -373,11 +374,11 @@ static int rzv2h_rspi_probe(struct platform_device *p= dev) return PTR_ERR(rspi->base); =20 ret =3D devm_clk_bulk_get_all_enabled(dev, &clks); - if (ret !=3D RSPI_CLK_NUM) + if (ret !=3D rspi->info->num_clks) return dev_err_probe(dev, ret >=3D 0 ? -EINVAL : ret, "cannot get clocks\n"); - for (i =3D 0; i < RSPI_CLK_NUM; i++) { - if (!strcmp(clks[i].id, "tclk")) { + for (i =3D 0; i < rspi->info->num_clks; i++) { + if (!strcmp(clks[i].id, rspi->info->tclk_name)) { rspi->tclk =3D clks[i].clk; break; } @@ -452,7 +453,9 @@ static void rzv2h_rspi_remove(struct platform_device *p= dev) } =20 static const struct rzv2h_rspi_info rzv2h_info =3D { + .tclk_name =3D "tclk", .fifo_size =3D 16, + .num_clks =3D 3, }; =20 static const struct of_device_id rzv2h_rspi_match[] =3D { --=20 2.51.2