Skip to contentSkip to conversation

ARM: mxs: apf28dev: Add I2C, SPI and spidev support

PATCH New Gwenhael Goavec-Merou 3 participants 4 messages Nov 6, 2012 – Nov 7, 2012

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

PATCH 1/1 ARM: mxs: apf28dev: Add I2C, SPI and spidev support

---
 arch/arm/boot/dts/imx28-apf28dev.dts |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28-apf28dev.dts +19 -0
index 1643d25..da7013d 100644
@@ -27,6 +27,19 @@
 				status = "okay";
 			};
 
+			ssp2: ssp at 80014000 {
+				compatible = "fsl,imx28-spi";
+				pinctrl-names = "default";
+				pinctrl-0 = <&spi2_pins_a>;
+				status = "okay";
+
+				spidev: spidev at 0 {
+					compatible = "spidev";
+					spi-max-frequency = <40000000>;
+					reg = <0>;
+				};
+			};
+
 			pinctrl at 80018000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&hog_pins_apf28dev>;
@@ -74,6 +87,12 @@
 				status = "okay";
 			};
 
+			i2c0: i2c at 80058000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&i2c0_pins_a>;
+				status = "okay";
+			};
+
 			pwm: pwm at 80064000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&pwm3_pins_a &pwm4_pins_a>;
Signature · 1 line
1.7.8.6
#1 lore raw

PATCH 1/1 ARM: mxs: apf28dev: Add I2C, SPI and spidev support

Le 06/11/2012 19:16, Gwenhael Goavec-Merou a ?crit :

Quoted 16 lines
---
 arch/arm/boot/dts/imx28-apf28dev.dts |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28-apf28dev.dts +2 -0
index 1643d25..da7013d 100644
@@ -27,6 +27,19 @@
 				status = "okay";
 			};
 
+			ssp2: ssp at 80014000 {
+				compatible = "fsl,imx28-spi";

arch/arm/boot/dts/imx28-apf28dev.dts line 41

Quoted 10 lines
arch/arm/boot/dts/imx28-apf28dev.dts +10 -0
+				pinctrl-names = "default";
+				pinctrl-0 = <&spi2_pins_a>;
+				status = "okay";
+
+				spidev: spidev at 0 {
+					compatible = "spidev";
+					spi-max-frequency = <40000000>;
+					reg = <0>;
+				};
+			};

This won't work, since the compatible string is not matching in the spidev driver.

You need to add the compatible string of the spi device that you will drive with spidev in the spidev driver, and then use this string in your dts.

See
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-October/129134.html
and
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-October/129133.html

Signature · 4 lines
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#2 lore raw

PATCH 1/1 ARM: mxs: apf28dev: Add I2C, SPI and spidev support

Quoted 15 lines · On Wed, 07 Nov 2012 10:07:32 +0100 Maxime Ripard…

Le 06/11/2012 19:16, Gwenhael Goavec-Merou a ?crit :

Quoted 14 lines
---
 arch/arm/boot/dts/imx28-apf28dev.dts |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
arch/arm/boot/dts/imx28-apf28dev.dts +0 -0
index 1643d25..da7013d 100644
@@ -27,6 +27,19 @@
 				status = "okay";
 			};
 
Quoted 16 lines

arch/arm/boot/dts/imx28-apf28dev.dts line 41

Quoted 12 lines
arch/arm/boot/dts/imx28-apf28dev.dts +12 -0
+			ssp2: ssp at 80014000 {
+				compatible = "fsl,imx28-spi";
+				pinctrl-names = "default";
+				pinctrl-0 = <&spi2_pins_a>;
+				status = "okay";
+
+				spidev: spidev at 0 {
+					compatible = "spidev";
+					spi-max-frequency = <40000000>;
+					reg = <0>;
+				};
+			};

This won't work, since the compatible string is not matching in the spidev driver.

This patch has been successfully tested on the Shawn Guo's git. Spidev dt support seems to be not yet available with this git.

Quoted 10 lines

You need to add the compatible string of the spi device that you will drive with spidev in the spidev driver, and then use this string in your dts.

See
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-October/129134.html
and
http://lists.infradead.org/pipermail/linux-arm-kernel/2012-October/129133.html

The APF28dev docking board contains no spi peripheral by default. The spidev driver is used to evaluation and fast prototyping of peripherals before creating a driver. Consequently it's a bit difficult to add a compatible string... What is the solution in this situation?

Gwenhael Goavec-Merou
Armadeus Systems

#3 lore raw

PATCH 1/1 ARM: mxs: apf28dev: Add I2C, SPI and spidev support

Quoted 4 lines · gwenhael.goavec

The APF28dev docking board contains no spi peripheral by default. The spidev driver is used to evaluation and fast prototyping of peripherals before creating a driver. Consequently it's a bit difficult to add a compatible string... What is the solution in this situation?

If you're doing that sort of prototyping and development surely it's
easy to locally edit the DT and/or kernel code to register the device as
part of the development? The DT is supposed to describe the hardware so
if you're changing the hardware it seems reasonable to change the DT.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121107/24a99ccf/attachment-0001.sig>