From patchwork Wed Jan 15 11:47:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Christophe PLAGNIOL-VILLARD X-Patchwork-Id: 3491381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A769CC02DC for ; Wed, 15 Jan 2014 11:47:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD16B200F2 for ; Wed, 15 Jan 2014 11:47:52 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86CD220170 for ; Wed, 15 Jan 2014 11:47:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3OwK-0005to-3g; Wed, 15 Jan 2014 11:47:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3OwB-0004aS-79; Wed, 15 Jan 2014 11:47:11 +0000 Received: from 4.mo6.mail-out.ovh.net ([87.98.184.159] helo=mo6.mail-out.ovh.net) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W3Ow5-0004ZM-3f for linux-arm-kernel@lists.infradead.org; Wed, 15 Jan 2014 11:47:06 +0000 Received: from mail440.ha.ovh.net (gw6.ovh.net [213.251.189.206]) by mo6.mail-out.ovh.net (Postfix) with SMTP id BC9D2FFAB9E for ; Wed, 15 Jan 2014 12:50:47 +0100 (CET) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 15 Jan 2014 13:52:33 +0200 Received: from ns203013.ovh.net (HELO localhost) (plagnioj%jcrosoft.com@91.121.171.124) by ns0.ovh.net with SMTP; 15 Jan 2014 13:52:31 +0200 From: 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 Message-Id: <1389786445-10598-1-git-send-email-plagnioj@jcrosoft.com> X-Mailer: git-send-email 1.8.4.4 X-Ovh-Tracer-Id: 8538543419919936509 X-Ovh-Remote: 91.121.171.124 (ns203013.ovh.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-OVH-SPAMSTATE: OK X-OVH-SPAMSCORE: -100 X-OVH-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrfeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-Spam-Check: DONE|U 0.500231/N X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeejtddrfeekucetufdoteggodetrfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140115_064705_397611_15FED447 X-CRM114-Status: GOOD ( 17.26 ) X-Spam-Score: -1.9 (-) Cc: Grant Likely , devicetree-discuss@lists.ozlabs.org, Jean-Christophe PLAGNIOL-VILLARD , Rob Herring X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Grant Likely Cc: Rob Herring --- 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);