From nobody Tue Dec 2 02:32:04 2025 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4D9834104C; Wed, 19 Nov 2025 16:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.160.252.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763568939; cv=none; b=PKjQObZ3CtDd9kza3cfY5PPdjHxjdvzpVChjZnbtQwhf240+883e0/gl9zWdidJuzFslI1qKQEveyu9xrarsHhimbHOsl7bswR8SUH+vm/ruGopBHL7BUOYzNBOQHgkyyaEHP91KncFJqmvJ5eDOYvNrfbnuenXxE53IfouTQsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763568939; c=relaxed/simple; bh=tHlEVG8WG/LHcT9GxWsx1dYOk5lxR9LGd4fbJpSMyks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ik7TdL2Q3pkaQ4j7OOige217Cum9Up01GCelVRnq+F0XI/9pr+8CEGzVd5IjOPD9vlrtWki95XNylsJwyscsE9mDYCSNAeXxvK03W/gfhJnKVoE6m4yO2hIkH8ZZihTGTkvkyo5jVshwlgbRvFnaILbKIlMJB+Ol4WEWZwZAKbI= 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.172 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: 1wy06Y8BQFq51pVdkgru+A== X-CSE-MsgGUID: Zx19uR3aQDeA/ackjwwHbA== Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 20 Nov 2025 01:15:35 +0900 Received: from demon-pc.localdomain (unknown [10.226.92.87]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id AEE4D406C477; Thu, 20 Nov 2025 01:15:31 +0900 (JST) From: Cosmin Tanislav To: Fabrizio Castro , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Philipp Zabel Cc: linux-spi@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Cosmin Tanislav Subject: [PATCH v4 03/13] spi: rzv2h-rspi: make clocks chip-specific Date: Wed, 19 Nov 2025 18:14:24 +0200 Message-ID: <20251119161434.595677-4-cosmin-gabriel.tanislav.xa@renesas.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251119161434.595677-1-cosmin-gabriel.tanislav.xa@renesas.com> References: <20251119161434.595677-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 --- V4: * no changes V3: * no changes V2: * no changes 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.52.0