Skip to content

Commit 414d7b8

Browse files
ambarusbroonie
authored andcommitted
spi: s3c64xx: retrieve the FIFO depth from the device tree
There are SoCs that configure different FIFO depths for their instances of the SPI IP. See the fifo_lvl_mask defined for exynos4_spi_port_config for example: .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F }, The first instance of the IP is configured with 256 bytes FIFOs, whereas the last two are configured with 64 bytes FIFOs. Instead of mangling with the .fifo_lvl_mask and its dependency of the DT alias ID, allow such SoCs to determine the FIFO depth via the ``fifo-depth`` DT property. Signed-off-by: Tudor Ambarus <[email protected]> Link: https://msgid.link/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent c6e776a commit 414d7b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/spi/spi-s3c64xx.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,9 @@ static int s3c64xx_spi_probe(struct platform_device *pdev)
12631263
sdd->port_id = pdev->id;
12641264
}
12651265

1266-
sdd->fifo_depth = FIFO_DEPTH(sdd);
1266+
if (of_property_read_u32(pdev->dev.of_node, "fifo-depth",
1267+
&sdd->fifo_depth))
1268+
sdd->fifo_depth = FIFO_DEPTH(sdd);
12671269

12681270
s3c64xx_spi_set_fifomask(sdd);
12691271

0 commit comments

Comments
 (0)