Skip to contentSkip to conversation

MIPS: Ci20: Enable SPI/GPIO driver

PATCH In review Mathieu Malaterre 2 participants 3 messages Jun 6, 2018 – Jul 24, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 MIPS: Ci20: Enable SPI/GPIO driver

Update the Ci20's defconfig to enable the JZ4780's SPI/GPIO driver.

---
 arch/mips/configs/ci20_defconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/mips/configs/ci20_defconfig +2 -0
index 0ddef6ad2652..0c08c7675b42 100644
@@ -93,6 +93,8 @@ CONFIG_SERIAL_OF_PLATFORM=y
 # CONFIG_HW_RANDOM is not set
 CONFIG_I2C=y
 CONFIG_I2C_JZ4780=y
+CONFIG_SPI=y
+CONFIG_SPI_GPIO=y
 CONFIG_GPIO_SYSFS=y
 CONFIG_GPIO_INGENIC=y
 # CONFIG_HWMON is not set
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 MIPS: jz4780: DTS: Probe the spi-gpio driver from devicetree

The spi-gpio driver supports jz4780.

---
 arch/mips/boot/dts/ingenic/jz4780.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/mips/boot/dts/ingenic/jz4780.dtsi +19 -0
index 809f01a62955..308079ee8dd3 100644
@@ -167,6 +167,25 @@
 		};
 	};
 
+	spi_gpio {
+		compatible = "spi-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		num-chipselects = <2>;
+
+		gpio-miso = <&gpe 14 0>;
+		gpio-sck = <&gpe 15 0>;
+		gpio-mosi = <&gpe 17 0>;
+		cs-gpios = <&gpe 16 0
+			    &gpe 18 0>;
+
+		spidev@0 {
+			compatible = "spidev";
+			reg = <0>;
+			spi-max-frequency = <1000000>;
+		};
+	};
+
 	uart0: serial@10030000 {
 		compatible = "ingenic,jz4780-uart";
 		reg = <0x10030000 0x100>;
Signature · 1 line
2.11.0