mirror of https://github.com/torvalds/linux.git
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: Cosmin Tanislav <cosmin-gabriel.tanislav.xa@renesas.com> Link: https://patch.msgid.link/20251119161434.595677-4-cosmin-gabriel.tanislav.xa@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
8e89ee6cd2
commit
ebd7d6ae0d
|
|
@ -66,10 +66,11 @@
|
||||||
#define RSPI_SPSRC_CLEAR 0xfd80
|
#define RSPI_SPSRC_CLEAR 0xfd80
|
||||||
|
|
||||||
#define RSPI_RESET_NUM 2
|
#define RSPI_RESET_NUM 2
|
||||||
#define RSPI_CLK_NUM 3
|
|
||||||
|
|
||||||
struct rzv2h_rspi_info {
|
struct rzv2h_rspi_info {
|
||||||
|
const char *tclk_name;
|
||||||
unsigned int fifo_size;
|
unsigned int fifo_size;
|
||||||
|
unsigned int num_clks;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rzv2h_rspi_priv {
|
struct rzv2h_rspi_priv {
|
||||||
|
|
@ -373,11 +374,11 @@ static int rzv2h_rspi_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(rspi->base);
|
return PTR_ERR(rspi->base);
|
||||||
|
|
||||||
ret = devm_clk_bulk_get_all_enabled(dev, &clks);
|
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,
|
return dev_err_probe(dev, ret >= 0 ? -EINVAL : ret,
|
||||||
"cannot get clocks\n");
|
"cannot get clocks\n");
|
||||||
for (i = 0; i < RSPI_CLK_NUM; i++) {
|
for (i = 0; i < rspi->info->num_clks; i++) {
|
||||||
if (!strcmp(clks[i].id, "tclk")) {
|
if (!strcmp(clks[i].id, rspi->info->tclk_name)) {
|
||||||
rspi->tclk = clks[i].clk;
|
rspi->tclk = clks[i].clk;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -452,7 +453,9 @@ static void rzv2h_rspi_remove(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct rzv2h_rspi_info rzv2h_info = {
|
static const struct rzv2h_rspi_info rzv2h_info = {
|
||||||
|
.tclk_name = "tclk",
|
||||||
.fifo_size = 16,
|
.fifo_size = 16,
|
||||||
|
.num_clks = 3,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct of_device_id rzv2h_rspi_match[] = {
|
static const struct of_device_id rzv2h_rspi_match[] = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue