diff mbox

[3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree

Message ID 1352394113-19513-4-git-send-email-maxime.ripard@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maxime Ripard Nov. 8, 2012, 5:01 p.m. UTC
Add the GPIO expander found on the i2c1 bus, behind the muxer to the
device tree.

This gpio expander will be used to get tachymeters values and data ready
interruptions from the nuvoton NAU7802 ADCs.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 arch/arm/boot/dts/imx28-cfa10049.dts |   26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

Comments

Linus Walleij Nov. 17, 2012, 8:12 p.m. UTC | #1
On Thu, Nov 8, 2012 at 6:01 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

> Add the GPIO expander found on the i2c1 bus, behind the muxer to the
> device tree.
>
> This gpio expander will be used to get tachymeters values and data ready
> interruptions from the nuvoton NAU7802 ADCs.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

This does not apply to the GPIO tree, and I have no ACK from the platform
maintainer so apply it wherever you see fit.
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij
Maxime Ripard Nov. 19, 2012, 2:50 p.m. UTC | #2
Hi,

Le 17/11/2012 21:12, Linus Walleij a écrit :
> On Thu, Nov 8, 2012 at 6:01 PM, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> 
>> Add the GPIO expander found on the i2c1 bus, behind the muxer to the
>> device tree.
>>
>> This gpio expander will be used to get tachymeters values and data ready
>> interruptions from the nuvoton NAU7802 ADCs.
>>
>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> 
> This does not apply to the GPIO tree, and I have no ACK from the platform
> maintainer so apply it wherever you see fit.
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Thanks Linus.

Shawn, would you consider applying this patch for 3.8?

Thanks,
Maxime
Shawn Guo Nov. 20, 2012, 1:25 p.m. UTC | #3
On Thu, Nov 08, 2012 at 06:01:53PM +0100, Maxime Ripard wrote:
> Add the GPIO expander found on the i2c1 bus, behind the muxer to the
> device tree.
> 
> This gpio expander will be used to get tachymeters values and data ready
> interruptions from the nuvoton NAU7802 ADCs.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> ---
>  arch/arm/boot/dts/imx28-cfa10049.dts |   26 +++++++++++++++++++++++++-
>  1 file changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
> index bdc80a4..714953b 100644
> --- a/arch/arm/boot/dts/imx28-cfa10049.dts
> +++ b/arch/arm/boot/dts/imx28-cfa10049.dts
> @@ -22,8 +22,9 @@
>  	apb@80000000 {
>  		apbh@80000000 {
>  			pinctrl@80018000 {
> -				pinctrl-names = "default", "default";
> +				pinctrl-names = "default", "default", "default";
>  				pinctrl-1 = <&hog_pins_cfa10049>;
> +				pinctrl-2 = <&hog_pins_cfa10049_pullup>;

I do not think it necessarily needs to be multiple pinctrl states.
Something like the following should just work?

				pinctrl-names = "default";
				pinctrl-0 = <&hog_pins_cfa10049
					     &hog_pins_cfa10049_pullup>;

Shawn

>  
>  				hog_pins_cfa10049: hog-10049@0 {
>  					reg = <0>;
> @@ -38,6 +39,16 @@
>  					fsl,pull-up = <0>;
>  				};
>  
> +				hog_pins_cfa10049_pullup: hog-10049-pullup@0 {
> +					reg = <0>;
> +					fsl,pinmux-ids = <
> +						0x2133 /* MX28_PAD_SSP2_D3__GPIO_2_19 */
> +					>;
> +					fsl,drive-strength = <0>;
> +					fsl,voltage = <1>;
> +					fsl,pull-up = <1>;
> +				};
> +
>  				spi3_pins_cfa10049: spi3-cfa10049@0 {
>  					reg = <0>;
>  					fsl,pinmux-ids = <
> @@ -113,6 +124,19 @@
>  
>  				i2c@3 {
>  					reg = <3>;
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +
> +					pca9555: pca9555@20 {
> +						compatible = "nxp,pca9555";
> +						interrupt-parent = <&gpio2>;
> +						interrupts = <19 0x2>;
> +						gpio-controller;
> +						#gpio-cells = <2>;
> +						interrupt-controller;
> +						#interrupt-cells = <2>;
> +						reg = <0x20>;
> +					};
>  				};
>  			};
>  
> -- 
> 1.7.9.5
>
Maxime Ripard Nov. 20, 2012, 1:50 p.m. UTC | #4
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Shawn,

Le 20/11/2012 14:25, Shawn Guo a écrit :
> On Thu, Nov 08, 2012 at 06:01:53PM +0100, Maxime Ripard wrote:
>> Add the GPIO expander found on the i2c1 bus, behind the muxer to
>> the device tree.
>> 
>> This gpio expander will be used to get tachymeters values and
>> data ready interruptions from the nuvoton NAU7802 ADCs.
>> 
>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> 
>> --- arch/arm/boot/dts/imx28-cfa10049.dts |   26
>> +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1
>> deletion(-)
>> 
>> diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts
>> b/arch/arm/boot/dts/imx28-cfa10049.dts index bdc80a4..714953b
>> 100644 --- a/arch/arm/boot/dts/imx28-cfa10049.dts +++
>> b/arch/arm/boot/dts/imx28-cfa10049.dts @@ -22,8 +22,9 @@ 
>> apb@80000000 { apbh@80000000 { pinctrl@80018000 { -
>> pinctrl-names = "default", "default"; +				pinctrl-names =
>> "default", "default", "default"; pinctrl-1 =
>> <&hog_pins_cfa10049>; +				pinctrl-2 =
>> <&hog_pins_cfa10049_pullup>;
> 
> I do not think it necessarily needs to be multiple pinctrl states. 
> Something like the following should just work?
> 
> pinctrl-names = "default"; pinctrl-0 = <&hog_pins_cfa10049 
> &hog_pins_cfa10049_pullup>;

Actually, pinctrl-0 is already used by the cfa-10036, and putting also
the group hog_pins_cfa10036 in here would lead to duplication and
confusion imho, thus why I used two different states at first.

Moreover, the cfa-10036 being able to run without any expansion board,
we need to be able to have a different muxing for both.

Apart from that, I guess we could extend the pintctrl-1 property
already here to add the _pullup group.

Maxime


- -- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCriogACgkQGxsu9jQV9nas/ACfbXg9AUF17pzJls/1Sx+ldK2C
JZIAn3pHsCx4BJFQOpV4OJnG5KhuPXMw
=YGhN
-----END PGP SIGNATURE-----
Shawn Guo Nov. 20, 2012, 2:43 p.m. UTC | #5
On Tue, Nov 20, 2012 at 02:50:16PM +0100, Maxime Ripard wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Shawn,
> 
> Le 20/11/2012 14:25, Shawn Guo a écrit :
> > On Thu, Nov 08, 2012 at 06:01:53PM +0100, Maxime Ripard wrote:
> >> Add the GPIO expander found on the i2c1 bus, behind the muxer to
> >> the device tree.
> >> 
> >> This gpio expander will be used to get tachymeters values and
> >> data ready interruptions from the nuvoton NAU7802 ADCs.
> >> 
> >> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> 
> >> --- arch/arm/boot/dts/imx28-cfa10049.dts |   26
> >> +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1
> >> deletion(-)
> >> 
> >> diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts
> >> b/arch/arm/boot/dts/imx28-cfa10049.dts index bdc80a4..714953b
> >> 100644 --- a/arch/arm/boot/dts/imx28-cfa10049.dts +++
> >> b/arch/arm/boot/dts/imx28-cfa10049.dts @@ -22,8 +22,9 @@ 
> >> apb@80000000 { apbh@80000000 { pinctrl@80018000 { -
> >> pinctrl-names = "default", "default"; +				pinctrl-names =
> >> "default", "default", "default"; pinctrl-1 =
> >> <&hog_pins_cfa10049>; +				pinctrl-2 =
> >> <&hog_pins_cfa10049_pullup>;
> > 
> > I do not think it necessarily needs to be multiple pinctrl states. 
> > Something like the following should just work?
> > 
> > pinctrl-names = "default"; pinctrl-0 = <&hog_pins_cfa10049 
> > &hog_pins_cfa10049_pullup>;
> 
> Actually, pinctrl-0 is already used by the cfa-10036, and putting also
> the group hog_pins_cfa10036 in here would lead to duplication and
> confusion imho, thus why I used two different states at first.
> 
Ah, yes, I forgot the fact that imx28-cfa10049.dts includes
imx28-cfa10036.dts.

> Moreover, the cfa-10036 being able to run without any expansion board,
> we need to be able to have a different muxing for both.
> 
> Apart from that, I guess we could extend the pintctrl-1 property
> already here to add the _pullup group.
> 
Right.

Shawn
diff mbox

Patch

diff --git a/arch/arm/boot/dts/imx28-cfa10049.dts b/arch/arm/boot/dts/imx28-cfa10049.dts
index bdc80a4..714953b 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -22,8 +22,9 @@ 
 	apb@80000000 {
 		apbh@80000000 {
 			pinctrl@80018000 {
-				pinctrl-names = "default", "default";
+				pinctrl-names = "default", "default", "default";
 				pinctrl-1 = <&hog_pins_cfa10049>;
+				pinctrl-2 = <&hog_pins_cfa10049_pullup>;
 
 				hog_pins_cfa10049: hog-10049@0 {
 					reg = <0>;
@@ -38,6 +39,16 @@ 
 					fsl,pull-up = <0>;
 				};
 
+				hog_pins_cfa10049_pullup: hog-10049-pullup@0 {
+					reg = <0>;
+					fsl,pinmux-ids = <
+						0x2133 /* MX28_PAD_SSP2_D3__GPIO_2_19 */
+					>;
+					fsl,drive-strength = <0>;
+					fsl,voltage = <1>;
+					fsl,pull-up = <1>;
+				};
+
 				spi3_pins_cfa10049: spi3-cfa10049@0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -113,6 +124,19 @@ 
 
 				i2c@3 {
 					reg = <3>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					pca9555: pca9555@20 {
+						compatible = "nxp,pca9555";
+						interrupt-parent = <&gpio2>;
+						interrupts = <19 0x2>;
+						gpio-controller;
+						#gpio-cells = <2>;
+						interrupt-controller;
+						#interrupt-cells = <2>;
+						reg = <0x20>;
+					};
 				};
 			};