Skip to content

Commit c81f30b

Browse files
wensbroonie
authored andcommitted
spi: sun6i: Support A523's SPI controllers
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>
1 parent e0c8755 commit c81f30b

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

drivers/spi/spi-sun6i.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,13 @@ static const struct sun6i_spi_cfg sun50i_r329_spi_cfg = {
795795
static const struct of_device_id sun6i_spi_match[] = {
796796
{ .compatible = "allwinner,sun6i-a31-spi", .data = &sun6i_a31_spi_cfg },
797797
{ .compatible = "allwinner,sun8i-h3-spi", .data = &sun8i_h3_spi_cfg },
798-
{
799-
.compatible = "allwinner,sun50i-r329-spi",
800-
.data = &sun50i_r329_spi_cfg
801-
},
798+
{ .compatible = "allwinner,sun50i-r329-spi", .data = &sun50i_r329_spi_cfg },
799+
/*
800+
* A523's SPI controller has a combined RX buffer + FIFO counter
801+
* at offset 0x400, instead of split buffer count in FIFO status
802+
* register. But in practice we only care about the FIFO level.
803+
*/
804+
{ .compatible = "allwinner,sun55i-a523-spi", .data = &sun50i_r329_spi_cfg },
802805
{}
803806
};
804807
MODULE_DEVICE_TABLE(of, sun6i_spi_match);

0 commit comments

Comments
 (0)