All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Add support of the PCA9555 to the CFA-10049
@ 2012-11-08 17:01 Maxime Ripard
  2012-11-08 17:01 ` [PATCH 1/3] gpio: pca953x: Register an IRQ domain Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-11-08 17:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all,

This is an attempt to add support for the PCA9555
present in the CFA-10049 board from Crystalfontz.

The driver was supporting neither irqdomains nor dt, so
the first two patches are adding them.

Thanks,
Maxime

Maxime Ripard (3):
  gpio: pca953x: Register an IRQ domain
  gpio: pca953x: Add compatible strings to gpio-pca953x driver
  ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree

 arch/arm/boot/dts/imx28-cfa10049.dts |   26 +++++++++++++++-
 drivers/gpio/gpio-pca953x.c          |   55 ++++++++++++++++++++++++++++++----
 2 files changed, 74 insertions(+), 7 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/3] gpio: pca953x: Register an IRQ domain
  2012-11-08 17:01 [PATCH 0/3] Add support of the PCA9555 to the CFA-10049 Maxime Ripard
@ 2012-11-08 17:01 ` Maxime Ripard
  2012-11-17 20:09   ` Linus Walleij
  2012-11-08 17:01 ` [PATCH 2/3] gpio: pca953x: Add compatible strings to gpio-pca953x driver Maxime Ripard
  2012-11-08 17:01 ` [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree Maxime Ripard
  2 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-11-08 17:01 UTC (permalink / raw)
  To: linux-arm-kernel

The PCA953x used to register no IRQ domain, which made it impossible to
use it as an interrupt-parent from the device tree.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/gpio/gpio-pca953x.c |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 9c693ae..5ba7e60 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -16,6 +16,7 @@
 #include <linux/gpio.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/irqdomain.h>
 #include <linux/i2c.h>
 #include <linux/i2c/pca953x.h>
 #include <linux/slab.h>
@@ -83,6 +84,7 @@ struct pca953x_chip {
 	u32 irq_trig_raise;
 	u32 irq_trig_fall;
 	int	 irq_base;
+	struct irq_domain *domain;
 #endif
 
 	struct i2c_client *client;
@@ -333,14 +335,14 @@ static void pca953x_irq_mask(struct irq_data *d)
 {
 	struct pca953x_chip *chip = irq_data_get_irq_chip_data(d);
 
-	chip->irq_mask &= ~(1 << (d->irq - chip->irq_base));
+	chip->irq_mask &= ~(1 << d->hwirq);
 }
 
 static void pca953x_irq_unmask(struct irq_data *d)
 {
 	struct pca953x_chip *chip = irq_data_get_irq_chip_data(d);
 
-	chip->irq_mask |= 1 << (d->irq - chip->irq_base);
+	chip->irq_mask |= 1 << d->hwirq;
 }
 
 static void pca953x_irq_bus_lock(struct irq_data *d)
@@ -372,8 +374,7 @@ static void pca953x_irq_bus_sync_unlock(struct irq_data *d)
 static int pca953x_irq_set_type(struct irq_data *d, unsigned int type)
 {
 	struct pca953x_chip *chip = irq_data_get_irq_chip_data(d);
-	u32 level = d->irq - chip->irq_base;
-	u32 mask = 1 << level;
+	u32 mask = 1 << d->hwirq;
 
 	if (!(type & IRQ_TYPE_EDGE_BOTH)) {
 		dev_err(&chip->client->dev, "irq %d: unsupported type %d\n",
@@ -454,7 +455,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)
 
 	do {
 		level = __ffs(pending);
-		handle_nested_irq(level + chip->irq_base);
+		handle_nested_irq(irq_find_mapping(chip->domain, level));
 
 		pending &= ~(1 << level);
 	} while (pending);
@@ -499,6 +500,17 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 		if (chip->irq_base < 0)
 			goto out_failed;
 
+		chip->domain = irq_domain_add_legacy(client->dev.of_node,
+						chip->gpio_chip.ngpio,
+						chip->irq_base,
+						0,
+						&irq_domain_simple_ops,
+						NULL);
+		if (!chip->domain) {
+			ret = -ENODEV;
+			goto out_irqdesc_free;
+		}
+
 		for (lvl = 0; lvl < chip->gpio_chip.ngpio; lvl++) {
 			int irq = lvl + chip->irq_base;
 
@@ -521,7 +533,7 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 		if (ret) {
 			dev_err(&client->dev, "failed to request irq %d\n",
 				client->irq);
-			goto out_failed;
+			goto out_irqdesc_free;
 		}
 
 		chip->gpio_chip.to_irq = pca953x_gpio_to_irq;
@@ -529,6 +541,8 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
 
 	return 0;
 
+out_irqdesc_free:
+	irq_free_descs(chip->irq_base, chip->gpio_chip.ngpio);
 out_failed:
 	chip->irq_base = -1;
 	return ret;
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/3] gpio: pca953x: Add compatible strings to gpio-pca953x driver
  2012-11-08 17:01 [PATCH 0/3] Add support of the PCA9555 to the CFA-10049 Maxime Ripard
  2012-11-08 17:01 ` [PATCH 1/3] gpio: pca953x: Register an IRQ domain Maxime Ripard
@ 2012-11-08 17:01 ` Maxime Ripard
  2012-11-17 20:10   ` Linus Walleij
  2012-11-08 17:01 ` [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree Maxime Ripard
  2 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-11-08 17:01 UTC (permalink / raw)
  To: linux-arm-kernel

Even though the device tree binding code was already written, the
compatible strings were not yet in the driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/gpio/gpio-pca953x.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index 5ba7e60..0c5eaf5 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -765,9 +765,38 @@ static int pca953x_remove(struct i2c_client *client)
 	return 0;
 }
 
+static const struct of_device_id pca953x_dt_ids[] = {
+	{ .compatible = "nxp,pca9534", },
+	{ .compatible = "nxp,pca9535", },
+	{ .compatible = "nxp,pca9536", },
+	{ .compatible = "nxp,pca9537", },
+	{ .compatible = "nxp,pca9538", },
+	{ .compatible = "nxp,pca9539", },
+	{ .compatible = "nxp,pca9554", },
+	{ .compatible = "nxp,pca9555", },
+	{ .compatible = "nxp,pca9556", },
+	{ .compatible = "nxp,pca9557", },
+	{ .compatible = "nxp,pca9574", },
+	{ .compatible = "nxp,pca9575", },
+
+	{ .compatible = "maxim,max7310", },
+	{ .compatible = "maxim,max7312", },
+	{ .compatible = "maxim,max7313", },
+	{ .compatible = "maxim,max7315", },
+
+	{ .compatible = "ti,pca6107", },
+	{ .compatible = "ti,tca6408", },
+	{ .compatible = "ti,tca6416", },
+	{ .compatible = "ti,tca6424", },
+	{ }
+};
+
+MODULE_DEVICE_TABLE(of, pca953x_dt_ids);
+
 static struct i2c_driver pca953x_driver = {
 	.driver = {
 		.name	= "pca953x",
+		.of_match_table = pca953x_dt_ids,
 	},
 	.probe		= pca953x_probe,
 	.remove		= pca953x_remove,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-08 17:01 [PATCH 0/3] Add support of the PCA9555 to the CFA-10049 Maxime Ripard
  2012-11-08 17:01 ` [PATCH 1/3] gpio: pca953x: Register an IRQ domain Maxime Ripard
  2012-11-08 17:01 ` [PATCH 2/3] gpio: pca953x: Add compatible strings to gpio-pca953x driver Maxime Ripard
@ 2012-11-08 17:01 ` Maxime Ripard
  2012-11-17 20:12   ` Linus Walleij
  2012-11-20 13:25   ` Shawn Guo
  2 siblings, 2 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-11-08 17:01 UTC (permalink / raw)
  To: linux-arm-kernel

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 at 80000000 {
 		apbh at 80000000 {
 			pinctrl at 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 at 0 {
 					reg = <0>;
@@ -38,6 +39,16 @@
 					fsl,pull-up = <0>;
 				};
 
+				hog_pins_cfa10049_pullup: hog-10049-pullup at 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 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -113,6 +124,19 @@
 
 				i2c@3 {
 					reg = <3>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					pca9555: pca9555 at 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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 1/3] gpio: pca953x: Register an IRQ domain
  2012-11-08 17:01 ` [PATCH 1/3] gpio: pca953x: Register an IRQ domain Maxime Ripard
@ 2012-11-17 20:09   ` Linus Walleij
  0 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2012-11-17 20:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 8, 2012 at 6:01 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

> The PCA953x used to register no IRQ domain, which made it impossible to
> use it as an interrupt-parent from the device tree.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Hmmmmm will look over the use of the irqdomain but it's better
with this than without it so patch applied, thanks.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 2/3] gpio: pca953x: Add compatible strings to gpio-pca953x driver
  2012-11-08 17:01 ` [PATCH 2/3] gpio: pca953x: Add compatible strings to gpio-pca953x driver Maxime Ripard
@ 2012-11-17 20:10   ` Linus Walleij
  0 siblings, 0 replies; 17+ messages in thread
From: Linus Walleij @ 2012-11-17 20:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 8, 2012 at 6:01 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

> Even though the device tree binding code was already written, the
> compatible strings were not yet in the driver.
>
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Applied, thanks!
Linus Walleij

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-08 17:01 ` [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree Maxime Ripard
@ 2012-11-17 20:12   ` Linus Walleij
  2012-11-19 14:50     ` Maxime Ripard
  2012-11-20 13:25   ` Shawn Guo
  1 sibling, 1 reply; 17+ messages in thread
From: Linus Walleij @ 2012-11-17 20:12 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-17 20:12   ` Linus Walleij
@ 2012-11-19 14:50     ` Maxime Ripard
  0 siblings, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-11-19 14:50 UTC (permalink / raw)
  To: linux-arm-kernel

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

-- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-08 17:01 ` [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree Maxime Ripard
  2012-11-17 20:12   ` Linus Walleij
@ 2012-11-20 13:25   ` Shawn Guo
  2012-11-20 13:50     ` Maxime Ripard
  1 sibling, 1 reply; 17+ messages in thread
From: Shawn Guo @ 2012-11-20 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

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 at 80000000 {
>  		apbh at 80000000 {
>  			pinctrl at 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 at 0 {
>  					reg = <0>;
> @@ -38,6 +39,16 @@
>  					fsl,pull-up = <0>;
>  				};
>  
> +				hog_pins_cfa10049_pullup: hog-10049-pullup at 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 at 0 {
>  					reg = <0>;
>  					fsl,pinmux-ids = <
> @@ -113,6 +124,19 @@
>  
>  				i2c at 3 {
>  					reg = <3>;
> +					#address-cells = <1>;
> +					#size-cells = <0>;
> +
> +					pca9555: pca9555 at 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
> 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-20 13:25   ` Shawn Guo
@ 2012-11-20 13:50     ` Maxime Ripard
  2012-11-20 14:43       ` Shawn Guo
  0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-11-20 13:50 UTC (permalink / raw)
  To: linux-arm-kernel

-----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 at 80000000 { apbh at 80000000 { pinctrl at 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-----

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCHv2] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-20 14:43       ` Shawn Guo
@ 2012-11-20 14:33         ` Maxime Ripard
  2012-11-22 10:45           ` Maxime Ripard
  2012-11-23 10:17           ` Maxime Ripard
  0 siblings, 2 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-11-20 14:33 UTC (permalink / raw)
  To: linux-arm-kernel

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..7890acc 100644
--- a/arch/arm/boot/dts/imx28-cfa10049.dts
+++ b/arch/arm/boot/dts/imx28-cfa10049.dts
@@ -23,7 +23,8 @@
 		apbh at 80000000 {
 			pinctrl at 80018000 {
 				pinctrl-names = "default", "default";
-				pinctrl-1 = <&hog_pins_cfa10049>;
+				pinctrl-1 = <&hog_pins_cfa10049
+					&hog_pins_cfa10049_pullup>;
 
 				hog_pins_cfa10049: hog-10049 at 0 {
 					reg = <0>;
@@ -38,6 +39,16 @@
 					fsl,pull-up = <0>;
 				};
 
+				hog_pins_cfa10049_pullup: hog-10049-pullup at 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 at 0 {
 					reg = <0>;
 					fsl,pinmux-ids = <
@@ -113,6 +124,19 @@
 
 				i2c@3 {
 					reg = <3>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					pca9555: pca9555 at 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

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-20 13:50     ` Maxime Ripard
@ 2012-11-20 14:43       ` Shawn Guo
  2012-11-20 14:33         ` [PATCHv2] " Maxime Ripard
  0 siblings, 1 reply; 17+ messages in thread
From: Shawn Guo @ 2012-11-20 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

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 at 80000000 { apbh at 80000000 { pinctrl at 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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCHv2] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-20 14:33         ` [PATCHv2] " Maxime Ripard
@ 2012-11-22 10:45           ` Maxime Ripard
  2012-11-22 11:24             ` Shawn Guo
  2012-11-23 10:17           ` Maxime Ripard
  1 sibling, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-11-22 10:45 UTC (permalink / raw)
  To: linux-arm-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Shawn,

Le 20/11/2012 15:33, Maxime Ripard a ?crit :
> 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.

If you're ok with it, I'd really like for that patch to be in 3.8.
Is this version ok, or do you have any additional comments I could
address?

Thanks,
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/

iEYEARECAAYFAlCuAjsACgkQGxsu9jQV9naCFwCfXjxLa0qLRx2ThFDFLSC8bKAk
hHsAnjYIC7xtbHzZW27GGy3TdfZO5O5M
=0dLl
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCHv2] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-22 10:45           ` Maxime Ripard
@ 2012-11-22 11:24             ` Shawn Guo
  2012-12-27 22:00               ` Maxime Ripard
  0 siblings, 1 reply; 17+ messages in thread
From: Shawn Guo @ 2012-11-22 11:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Nov 22, 2012 at 11:45:17AM +0100, Maxime Ripard wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Shawn,
> 
> Le 20/11/2012 15:33, Maxime Ripard a ?crit :
> > 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.
> 
> If you're ok with it, I'd really like for that patch to be in 3.8.
> Is this version ok, or do you have any additional comments I could
> address?
> 
The patch is ok now.  But I have problem to apply it because its
prerequisite has been applied on i2c tree, as I did not plan a second
pull request for 3.8 at all.

I hope it's fine to apply the patch on top of v3.8-rc1, or you can
try to ask Wolfram to have this patch go via his tree too.

Shawn

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCHv2] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-20 14:33         ` [PATCHv2] " Maxime Ripard
  2012-11-22 10:45           ` Maxime Ripard
@ 2012-11-23 10:17           ` Maxime Ripard
  1 sibling, 0 replies; 17+ messages in thread
From: Maxime Ripard @ 2012-11-23 10:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Wolfram,

Le 20/11/2012 15:33, Maxime Ripard a ?crit :
> 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.

Since this patch depends on the I2C muxer patches you applied, can you
take it to push it for 3.8? Shawn Guo is ok with it, but it doesn't
apply in his tree.

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCHv2] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-11-22 11:24             ` Shawn Guo
@ 2012-12-27 22:00               ` Maxime Ripard
  2012-12-28 11:03                 ` Shawn Guo
  0 siblings, 1 reply; 17+ messages in thread
From: Maxime Ripard @ 2012-12-27 22:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Shawn,

Le 22/11/2012 12:24, Shawn Guo a ?crit :
> On Thu, Nov 22, 2012 at 11:45:17AM +0100, Maxime Ripard wrote:
> The patch is ok now.  But I have problem to apply it because its
> prerequisite has been applied on i2c tree, as I did not plan a second
> pull request for 3.8 at all.
> 
> I hope it's fine to apply the patch on top of v3.8-rc1, or you can
> try to ask Wolfram to have this patch go via his tree too.

Are you still ok to apply it on top of 3.8-rc1 and send it for -rc2? Or
to queue it up for 3.9?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCHv2] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree
  2012-12-27 22:00               ` Maxime Ripard
@ 2012-12-28 11:03                 ` Shawn Guo
  0 siblings, 0 replies; 17+ messages in thread
From: Shawn Guo @ 2012-12-28 11:03 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 27, 2012 at 11:00:51PM +0100, Maxime Ripard wrote:
> Are you still ok to apply it on top of 3.8-rc1 and send it for -rc2? Or
> to queue it up for 3.9?
> 
Since it's not really a bug fix, I will have to queue it up for 3.9.

Shawn

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-12-28 11:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-08 17:01 [PATCH 0/3] Add support of the PCA9555 to the CFA-10049 Maxime Ripard
2012-11-08 17:01 ` [PATCH 1/3] gpio: pca953x: Register an IRQ domain Maxime Ripard
2012-11-17 20:09   ` Linus Walleij
2012-11-08 17:01 ` [PATCH 2/3] gpio: pca953x: Add compatible strings to gpio-pca953x driver Maxime Ripard
2012-11-17 20:10   ` Linus Walleij
2012-11-08 17:01 ` [PATCH 3/3] ARM: dts: cfa10049: Add PCA9555 GPIO expander to the device tree Maxime Ripard
2012-11-17 20:12   ` Linus Walleij
2012-11-19 14:50     ` Maxime Ripard
2012-11-20 13:25   ` Shawn Guo
2012-11-20 13:50     ` Maxime Ripard
2012-11-20 14:43       ` Shawn Guo
2012-11-20 14:33         ` [PATCHv2] " Maxime Ripard
2012-11-22 10:45           ` Maxime Ripard
2012-11-22 11:24             ` Shawn Guo
2012-12-27 22:00               ` Maxime Ripard
2012-12-28 11:03                 ` Shawn Guo
2012-11-23 10:17           ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.