diff mbox

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

Message ID 1352225793-93208-1-git-send-email-gwenhael.goavec-merou@armadeus.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gwenhael Goavec-Merou Nov. 6, 2012, 6:16 p.m. UTC
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
---
 arch/arm/boot/dts/imx28-apf28dev.dts |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

Comments

Maxime Ripard Nov. 7, 2012, 9:07 a.m. UTC | #1
Le 06/11/2012 19:16, Gwenhael Goavec-Merou a écrit :
> 
> Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
> ---
>  arch/arm/boot/dts/imx28-apf28dev.dts |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
> index 1643d25..da7013d 100644
> --- a/arch/arm/boot/dts/imx28-apf28dev.dts
> +++ b/arch/arm/boot/dts/imx28-apf28dev.dts
> @@ -27,6 +27,19 @@
>  				status = "okay";
>  			};
>  
> +			ssp2: ssp@80014000 {
> +				compatible = "fsl,imx28-spi";
> +				pinctrl-names = "default";
> +				pinctrl-0 = <&spi2_pins_a>;
> +				status = "okay";
> +
> +				spidev: spidev@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
Gwenhael Goavec-Merou Nov. 7, 2012, 2:20 p.m. UTC | #2
On Wed, 07 Nov 2012 10:07:32 +0100
Maxime Ripard <maxime.ripard@free-electrons.com> wrote:

> Le 06/11/2012 19:16, Gwenhael Goavec-Merou a écrit :
> > 
> > Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@armadeus.com>
> > ---
> >  arch/arm/boot/dts/imx28-apf28dev.dts |   19 +++++++++++++++++++
> >  1 files changed, 19 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
> > index 1643d25..da7013d 100644
> > --- a/arch/arm/boot/dts/imx28-apf28dev.dts
> > +++ b/arch/arm/boot/dts/imx28-apf28dev.dts
> > @@ -27,6 +27,19 @@
> >  				status = "okay";
> >  			};
> >  
> > +			ssp2: ssp@80014000 {
> > +				compatible = "fsl,imx28-spi";
> > +				pinctrl-names = "default";
> > +				pinctrl-0 = <&spi2_pins_a>;
> > +				status = "okay";
> > +
> > +				spidev: spidev@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.
>
> 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
Mark Brown Nov. 7, 2012, 2:22 p.m. UTC | #3
On Wed, Nov 07, 2012 at 03:20:05PM +0100, gwenhael.goavec wrote:

> 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.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/imx28-apf28dev.dts b/arch/arm/boot/dts/imx28-apf28dev.dts
index 1643d25..da7013d 100644
--- a/arch/arm/boot/dts/imx28-apf28dev.dts
+++ b/arch/arm/boot/dts/imx28-apf28dev.dts
@@ -27,6 +27,19 @@ 
 				status = "okay";
 			};
 
+			ssp2: ssp@80014000 {
+				compatible = "fsl,imx28-spi";
+				pinctrl-names = "default";
+				pinctrl-0 = <&spi2_pins_a>;
+				status = "okay";
+
+				spidev: spidev@0 {
+					compatible = "spidev";
+					spi-max-frequency = <40000000>;
+					reg = <0>;
+				};
+			};
+
 			pinctrl@80018000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&hog_pins_apf28dev>;
@@ -74,6 +87,12 @@ 
 				status = "okay";
 			};
 
+			i2c0: i2c@80058000 {
+				pinctrl-names = "default";
+				pinctrl-0 = <&i2c0_pins_a>;
+				status = "okay";
+			};
+
 			pwm: pwm@80064000 {
 				pinctrl-names = "default";
 				pinctrl-0 = <&pwm3_pins_a &pwm4_pins_a>;