From: plagnioj@jcrosoft.com (Jean-Christophe PLAGNIOL-VILLARD)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/1] of/irq: create interrupts-extended-2 property
Date: Wed, 15 Jan 2014 12:47:25 +0100 [thread overview]
Message-ID: <1389786445-10598-1-git-send-email-plagnioj@jcrosoft.com> (raw)
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
next reply other threads:[~2014-01-15 11:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-15 11:47 Jean-Christophe PLAGNIOL-VILLARD [this message]
[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 ` [RFC PATCH 1/1] of/irq: create interrupts-extended-2 property 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 16:12 ` Mark Rutland
2014-01-15 18:08 ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-20 22:47 ` Grant Likely
2014-01-21 1:03 ` Olof Johansson
2014-01-21 8:57 ` David Gibson
2014-01-21 12:02 ` Mark Rutland
2014-01-21 12:46 ` Jean-Christophe PLAGNIOL-VILLARD
2014-01-24 17:39 ` Grant Likely
2014-01-15 14:56 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1389786445-10598-1-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).