Unverified Commit ebd7d6ae authored by Cosmin Tanislav's avatar Cosmin Tanislav Committed by Mark Brown
Browse files

spi: rzv2h-rspi: make clocks chip-specific



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: default avatarCosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com>
Link: https://patch.msgid.link/20251119161434.595677-4-cosmin-gabriel.tanislav.xa@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8e89ee6c
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -66,10 +66,11 @@
#define RSPI_SPSRC_CLEAR	0xfd80

#define RSPI_RESET_NUM		2
#define RSPI_CLK_NUM		3

struct rzv2h_rspi_info {
	const char *tclk_name;
	unsigned int fifo_size;
	unsigned int num_clks;
};

struct rzv2h_rspi_priv {
@@ -373,11 +374,11 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
		return PTR_ERR(rspi->base);

	ret = devm_clk_bulk_get_all_enabled(dev, &clks);
	if (ret != RSPI_CLK_NUM)
	if (ret != rspi->info->num_clks)
		return dev_err_probe(dev, ret >= 0 ? -EINVAL : ret,
				     "cannot get clocks\n");
	for (i = 0; i < RSPI_CLK_NUM; i++) {
		if (!strcmp(clks[i].id, "tclk")) {
	for (i = 0; i < rspi->info->num_clks; i++) {
		if (!strcmp(clks[i].id, rspi->info->tclk_name)) {
			rspi->tclk = clks[i].clk;
			break;
		}
@@ -452,7 +453,9 @@ static void rzv2h_rspi_remove(struct platform_device *pdev)
}

static const struct rzv2h_rspi_info rzv2h_info = {
	.tclk_name = "tclk",
	.fifo_size = 16,
	.num_clks = 3,
};

static const struct of_device_id rzv2h_rspi_match[] = {