All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 1/1] of/irq: create interrupts-extended-2 property
@ 2014-01-15 11:47 Jean-Christophe PLAGNIOL-VILLARD
       [not found] ` < 20140115121750.GE25824@e106331-lin.cambridge.arm.com>
                   ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2014-01-15 11:47 UTC (permalink / raw)
  To: linux-arm-kernel

The new interrupts-extended property, which reuses the phandle+arguments
pattern used by GPIOs and other core bindings, still have some issue.

If an SoC have already specifiy interrupt and a board want to add specific
interrupt such as GPIO (which can be optionnal) be need to re-define
interrupts-extended. So allow to have an optionnale interrupts-extended-2
property.

Today the problem is ofen solve by defining a gpio-xxx property and then do a gpio_to_irq
in the C code. *Which is wrong!!*. We need to describe the IRQ.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
---

We have the same issue on pinctrl
 .../devicetree/bindings/interrupt-controller/interrupts.txt    |  4 ++++
 drivers/of/irq.c                                               | 10 ++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
index 1486497..5d559fd 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
+++ b/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
@@ -25,8 +25,12 @@ to reference multiple interrupt parents. Each entry in this property contains
 both the parent phandle and the interrupt specifier. "interrupts-extended"
 should only be used when a device has multiple interrupt parents.
 
+The "interrupts-extended-2" allow to extend at board level node interrupt without
+having to re-define the SoC interrupts.
+
   Example:
 	interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;
+	interrupts-extended-2 = <&intc1 6 1>
 
 A device node may contain either "interrupts" or "interrupts-extended", but not
 both. If both properties are present, then the operating system should log an
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 786b0b4..bc36710 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -307,8 +307,14 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
 		/* Try the new-style interrupts-extended */
 		res = of_parse_phandle_with_args(device, "interrupts-extended",
 						"#interrupt-cells", index, out_irq);
-		if (res)
-			return -EINVAL;
+		if (res) {
+			/* Try the new-style interrupts-extended-2 */
+			res = of_parse_phandle_with_args(device, "interrupts-extended-2",
+							"#interrupt-cells", index, out_irq);
+			if (res)
+				return -EINVAL;
+		}
+
 		return of_irq_parse_raw(addr, out_irq);
 	}
 	intlen /= sizeof(*intspec);
-- 
1.8.4.3

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

end of thread, other threads:[~2014-01-24 17:39 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 11:47 [RFC PATCH 1/1] of/irq: create interrupts-extended-2 property Jean-Christophe PLAGNIOL-VILLARD
     [not found] ` < 20140115121750.GE25824@e106331-lin.cambridge.arm.com>
     [not found]   ` <20140115124041. GD9558@ns203013.ovh.net>
     [not found] ` < 20140115161224.GH25824@e106331-lin.cambridge.arm.com>
     [not found]   ` <20140120224742. EC905C40B12@trevor.secretlab.ca>
2014-01-15 12:17 ` Mark Rutland
2014-01-15 12:40   ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 13:46     ` Mark Rutland
2014-01-15 14:01       ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 15:16       ` Rob Herring
2014-01-15 15:28         ` Rob Herring
2014-01-15 15:28           ` Rob Herring
2014-01-15 16:12       ` Mark Rutland
2014-01-15 16:12         ` Mark Rutland
2014-01-15 18:08         ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-15 18:08           ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-20 22:47         ` Grant Likely
2014-01-20 22:47           ` Grant Likely
2014-01-21  1:03           ` Olof Johansson
2014-01-21  1:03             ` Olof Johansson
2014-01-21  8:57             ` David Gibson
2014-01-21  8:57               ` David Gibson
2014-01-21 12:02             ` Mark Rutland
2014-01-21 12:02               ` Mark Rutland
2014-01-21 12:46               ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-21 12:46                 ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-24 17:39             ` Grant Likely
2014-01-24 17:39               ` Grant Likely
2014-01-15 14:56   ` Grant Likely

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.