Received: by 10.192.165.148 with SMTP id m20csp4933931imm; Tue, 1 May 2018 06:30:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqujmVKRy4tQ7i4FMnB3vgzO3rdC4xZJomClDOZPrmU4ZP0EwHzBfZje0Tr7DwCDFr0VpEL X-Received: by 2002:a17:902:6a89:: with SMTP id n9-v6mr6554817plk.41.1525181419542; Tue, 01 May 2018 06:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525181419; cv=none; d=google.com; s=arc-20160816; b=o7Tv7nRElrWABxaf/tsXS1T01wvQhxlVNvR51n2fTJQEDRSgKub0x84ga09jAqSTHO HuwZPI43Ld8zGk3kyPkgLpyOXK11NJAyVII1POro2YZDVq/wRHtBaqKGK8X6AsDgTfm+ Q3WVLVsIgeflo3G0KJzbrzPGAAixjuUjNrVmDGeYiEbiX2IWV9MWEi8HTdGKn7D43u+K 22HtPdd6XNGeTjkuAsXSQPa5gfdl2i3VorFsyFMHcihIs4fJ9HoRePde8xeePE9u1Qin eozvI5saw13WL+QAcXtymeQwnek9qwUj75R3JKeGvflR0UWkQIQCPKQLOmN3fei9FU6M 8zMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=b5yS26a5g4xoKHOZNYBQib4nr3onALY6Fl5StghShm8=; b=q0pjjwKxf8rNCxAibJznSnHHQVy9RHynWRmYtmVqy9ARp83/moOnZ9IaTFNe+ihKHA TpR62czdAAWNqf0Mj/HeJbHq5MORt205GtKJcOuKz74LME4IO/woyH1V5QTvRCqkeRDk 2X/re8RxTUblu8KF6due+36Aft2+mMLptAdIAm7c26Piija7Lm/3Kypb1FU/DWLIq8Wa PhM9oPQkbvOokzbu6M4QTN3ZgMvAqDs3mFMBhWscfeivxKKw50yfXKEGPrUmBbJCWSKJ wX24dukRKf+fCMP4G6hfF5T1gkQ2sS7usWb3USigdaOFSaBlEkmfstbPLxhBHVtO4yNp +Oww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si9352511plg.236.2018.05.01.06.30.04; Tue, 01 May 2018 06:30:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755241AbeEAN2t (ORCPT + 99 others); Tue, 1 May 2018 09:28:49 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:40499 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753856AbeEAN2q (ORCPT ); Tue, 1 May 2018 09:28:46 -0400 Received: by mail-oi0-f65.google.com with SMTP id c203-v6so10057478oib.7; Tue, 01 May 2018 06:28:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=b5yS26a5g4xoKHOZNYBQib4nr3onALY6Fl5StghShm8=; b=IpbtK/TjuuLGF0oAsUZ2ab6wnFKrDlhyq2BGMskwA2tEeHwX0eLJICeWl4Q/0AJ55y 92tzUgdrgSC26tyFfu6CSSZpRkW8NHrMufHwpbmMsA9YzPW5BRQmMGRF9U6xHw702j/L wAdzcDLcwwhiFOIToeJg5D6nPSpEN5bJHa9plhjPg5j/LAeRUd9OePEUIDfx7ntKSqyE 4rfdUJ1+gD3Yq8fX7Q+sBXT9xcQAk/FnAv+Cs8kFMWw/fT7yAQhOElRCLkXfQTuG4m3U bkflI1DpDiiJYTAKcedp/W8ZAfUPCrP97InZbQrKznpLvyU0SGbP2z48LxZHMqCjPUWB S2eQ== X-Gm-Message-State: ALQs6tC1xcoq7l0YLbhF0YKWvOujEfZXgddUtHkVcTMH8xaDh/3ikh2C 0PDkMOYm6r5etapqyudqVsj7LVA= X-Received: by 2002:aca:e2cf:: with SMTP id z198-v6mr4657025oig.187.1525181325742; Tue, 01 May 2018 06:28:45 -0700 (PDT) Received: from localhost (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.gmail.com with ESMTPSA id c24-v6sm6434762otd.36.2018.05.01.06.28.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 May 2018 06:28:45 -0700 (PDT) Date: Tue, 1 May 2018 08:28:44 -0500 From: Rob Herring To: Phil Edworthy Cc: Marc Zyngier , Mark Rutland , Thomas Gleixner , Jason Cooper , devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] irqchip: Add support for Renesas RZ/N1 GPIO interrupt multiplexer Message-ID: <20180501132844.GA8298@rob-hp-laptop> References: <1524490386-1544-1-git-send-email-phil.edworthy@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524490386-1544-1-git-send-email-phil.edworthy@renesas.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 23, 2018 at 02:33:06PM +0100, Phil Edworthy wrote: > On RZ/N1 devices, there are 3 Synopsys DesignWare GPIO blocks each > configured to have 32 interrupt outputs, so we have a total of 96 GPIO > interrupts. All of these are passed to the GPIO IRQ Muxer, which selects > 8 of the GPIO interrupts to pass onto the GIC. The interrupt signals > aren't latched, so there is nothing to do in this driver when an interrupt > is received, other than tell the corresponding GPIO block. > > Signed-off-by: Phil Edworthy > --- > .../interrupt-controller/renesas,rzn1-mux.txt | 85 ++++++++++ Please split bindings to a separate patch. > drivers/irqchip/Kconfig | 10 ++ > drivers/irqchip/Makefile | 1 + > drivers/irqchip/irq-rzn1-irq-mux.c | 178 +++++++++++++++++++++ > 4 files changed, 274 insertions(+) > create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1-mux.txt > create mode 100644 drivers/irqchip/irq-rzn1-irq-mux.c > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1-mux.txt b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1-mux.txt > new file mode 100644 > index 0000000..f28a365 > --- /dev/null > +++ b/Documentation/devicetree/bindings/interrupt-controller/renesas,rzn1-mux.txt > @@ -0,0 +1,85 @@ > +* Renesas RZ/N1 GPIO Interrupt Multiplexer > + > +On Renesas RZ/N1 devices, there are 3 Synopsys DesignWare GPIO blocks each > +configured to have 32 interrupt outputs, so we have a total of 96 GPIO > +interrupts. All of these are passed to the GPIO IRQ Muxer, which selects > +8 of the GPIO interrupts to pass onto the GIC. > + > +A single node in the device tree is used to describe the GPIO IRQ Muxer. > + > +Required properties: > +- compatible: the SoC specific name, i.e. "renesas,r9a06g032-gpioirq" > + or "renesas,r9a06g033-gpioirq" followed by the SoC family name, i.e. > + "renesas,rzn1-gpioirq". > +- interrupt-controller: Identifies the node as an interrupt controller. > +- #interrupt-cells: should be <1>. The meaning of the cells is the input > + interrupt index, 0 to 95. > +- reg: Base address and size of GPIO IRQ Muxer registers. > +- interrupts: The list of interrupts generated by the muxer which are then > + connected to a parent interrupt controller. The format of the interrupt > + specifier depends in the interrupt parent controller. > +- gpioirq-#N: One property for each interrupt output from the GPIO IRQ Muxer > + that specifies the input interrupt to use, #N is from 0 to 7. Why do you need this in DT? Can't the driver handle this dynamically? When you request an interrupt on a GPIO line, then connect that GPIO line to a free IRQ line. If you really need this in DT, then interrupt-map can be used here. > + > +Optional properties: > +- interrupt-parent: pHandle of the parent interrupt controller, if not > + inherited from the parent node. > + > + > +Example: > + > + The following is an example for the RZ/N1D SoC. > + > + gpioirq: gpioirq@51000480 { > + compatible = "renesas,r9a06g032-gpioirq", > + "renesas,rzn1-gpioirq"; > + reg = <0x51000480 0x20>; > + interrupts = > + , > + , > + , > + , > + , > + , > + , > + ; > + interrupt-controller; > + #interrupt-cells = <1>; > + status = "disabled"; Don't show status in examples. > + }; > + > + gpio0: gpio@5000b000 { > + compatible = "snps,dw-apb-gpio"; > + reg = <0x5000b000 0x80>; > + #address-cells = <1>; > + #size-cells = <0>; > + clock-names = "bus"; > + clocks = <&hclk_gpio0>; > + status = "disabled"; > + > + gpio0a: gpio-controller@0 { > + compatible = "snps,dw-apb-gpio-port"; > + bank-name = "gpio0a"; > + gpio-controller; > + #gpio-cells = <2>; > + snps,nr-gpios = <32>; > + reg = <0>; > + > + interrupt-controller; > + interrupt-parent = <&gpioirq>; > + interrupts = < 0 1 2 3 4 5 6 7 > + 8 9 10 11 12 13 14 15 > + 16 17 18 19 20 21 22 23 > + 24 25 26 27 28 29 30 31 >; > + #interrupt-cells = <2>; > + }; > + }; > + > + > + The following is an example for a board using this. Don't show the soc/board split. This is convention, but not part of the binding. > + > + &gpioirq { > + status = "okay"; > + gpioirq-0 = <24>; /* gpio0a 24 */ > + gpioirq-4 = <3>; /* gpio0a 3 */ > + };