[PATCH 1/7] spi: realteak-rtl: Add support for RTL93xx SoCs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxx>
---
 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




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux