lkml.org 
[lkml]   [2022]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 1/7] spi: realteak-rtl: Add support for RTL93xx SoCs
The Realtek RTL930x and RTL931x SoCs are new generations of the
RTL838x and RTL839x Ethernet Router SoCs, providing only 2 instead
of 4 CS lines for SPI, however with quad IO capabilities instead of
merely dual IO.

We introduce device capability flags for the various SoCs stating
their number of CS lines and their multi-IO capabilities and add
compatibles for the RTL9300 and RTL9310 SoC families.

Signed-off-by: Birger Koblitz <mail@birger-koblitz.de>
---
drivers/spi/spi-realtek-rtl.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/spi-realtek-rtl.c b/drivers/spi/spi-realtek-rtl.c
index 866b0477dbd7..927bd44744a8 100644
--- a/drivers/spi/spi-realtek-rtl.c
+++ b/drivers/spi/spi-realtek-rtl.c
@@ -29,6 +29,9 @@ struct rtspi {

#define REG(x) (rtspi->base + x)

+/* SoC-specific features */
+#define SPI_CSMAX_3 0x1
+#define SPI_QUAD_SUPPORTED 0x2

static void rt_set_cs(struct spi_device *spi, bool active)
{
@@ -185,13 +188,16 @@ static int realtek_rtl_spi_probe(struct platform_device *pdev)


static const struct of_device_id realtek_rtl_spi_of_ids[] = {
- { .compatible = "realtek,rtl8380-spi" },
- { .compatible = "realtek,rtl8382-spi" },
- { .compatible = "realtek,rtl8391-spi" },
- { .compatible = "realtek,rtl8392-spi" },
- { .compatible = "realtek,rtl8393-spi" },
+ { .compatible = "realtek,rtl8380-spi", .data = (void *)SPI_CSMAX_3, },
+ { .compatible = "realtek,rtl8382-spi", .data = (void *)SPI_CSMAX_3, },
+ { .compatible = "realtek,rtl8391-spi", .data = (void *)SPI_CSMAX_3, },
+ { .compatible = "realtek,rtl8392-spi", .data = (void *)SPI_CSMAX_3, },
+ { .compatible = "realtek,rtl8393-spi", .data = (void *)SPI_CSMAX_3, },
+ { .compatible = "realtek,rtl9300-spi", .data = (void *)SPI_QUAD_SUPPORTED, },
+ { .compatible = "realtek,rtl9310-spi", .data = (void *)SPI_QUAD_SUPPORTED, },
{ /* sentinel */ }
};
+
MODULE_DEVICE_TABLE(of, realtek_rtl_spi_of_ids);

static struct platform_driver realtek_rtl_spi_driver = {
--
2.25.1
\
 
 \ /
  Last update: 2022-08-01 08:17    [W:0.045 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site