]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: sun6i: Support A523's SPI controllers
authorChen-Yu Tsai <wens@kernel.org>
Sun, 21 Dec 2025 11:05:09 +0000 (19:05 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 22 Dec 2025 09:00:50 +0000 (09:00 +0000)
The A523 has four SPI controllers. One of them supports MIPI DBI mode
in addition to standard SPI.

Compared to older generations, this newer controller now has a combined
counter for the RX FIFO ad buffer levels. In older generations, the
RX buffer level was a separate bitfield in the FIFO status register.

In practice this difference is negligible. The buffer is mostly
invisible to the implementation. If programmed I/O transfers are limited
to the FIFO size, then the contents of the buffer seem to always be
flushed over to the FIFO. For DMA, the DRQ trigger levels are only tied
to the FIFO levels. In all other aspects, the controller is the same as
the one in the R329.

Support the standard SPI mode controllers using the settings for R329.
DBI is left out as there currently is no infrastructure for enabling a
DBI host controller, as was the case for the R329.

Also fold the entry for the R329 to make the style consistent.

Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://patch.msgid.link/20251221110513.1850535-3-wens@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-sun6i.c

index 871dfd3e77be281d2e25074d5ea535535c942539..d1de6c99e7622fa298b0eb3e897dba06bdedb255 100644 (file)
@@ -795,10 +795,13 @@ static const struct sun6i_spi_cfg sun50i_r329_spi_cfg = {
 static const struct of_device_id sun6i_spi_match[] = {
        { .compatible = "allwinner,sun6i-a31-spi", .data = &sun6i_a31_spi_cfg },
        { .compatible = "allwinner,sun8i-h3-spi",  .data = &sun8i_h3_spi_cfg },
-       {
-               .compatible = "allwinner,sun50i-r329-spi",
-               .data = &sun50i_r329_spi_cfg
-       },
+       { .compatible = "allwinner,sun50i-r329-spi", .data = &sun50i_r329_spi_cfg },
+       /*
+        * A523's SPI controller has a combined RX buffer + FIFO counter
+        * at offset 0x400, instead of split buffer count in FIFO status
+        * register. But in practice we only care about the FIFO level.
+        */
+       { .compatible = "allwinner,sun55i-a523-spi", .data = &sun50i_r329_spi_cfg },
        {}
 };
 MODULE_DEVICE_TABLE(of, sun6i_spi_match);