Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp245287imm; Tue, 15 May 2018 00:43:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr5egjMQO+nXj5NaYfrPbOpcGR2kKS74eaN/7eyj9w8BVoYDErezO1qds1Lh2VWpl+sxzPS X-Received: by 2002:a63:a44a:: with SMTP id c10-v6mr11260360pgp.147.1526370205395; Tue, 15 May 2018 00:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526370205; cv=none; d=google.com; s=arc-20160816; b=rOLM2bbD17T43fowSrS5YCVNMotmIlRWQXACOws7XnQ4LxF77x4uyUw1SGQdyNAM/t 4nRlogi+npN9ihCzE/R4/MdtsSImT2zmHGvr152+fa+2JezOvisZM1jFKGJhVnbq7Zf8 RwCCrTeuAw15v81rEN0LT0UVfKoXWduqHZsANooPNEEy5HWegGRf25P4kpannRMc3YGk kT+PVaMtrHEmbcbyXaTJwDhqjRjULVolniWFFrxOYKXnsUoPew5x3btiYrsIGTwqrxNx yCRX8y4XGGIDmc5blnpYx1QXxG7/PiICrQHBigLHM411Cat2nytzkUzmwdmTY05PD3v1 j26g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organisation:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=5qkPJeKqhMBW2PPdF3GWXD2+8/1BBY88rsqJ023Sl80=; b=BlOz7U3BS7MVF5gK5G/qgcxBQ8sJXwjsh25CftMdi/q0Uh1hgA78/scmRXef2UHUY8 RqDfWSHpugkUru8CUOHySqYBJdzdL4IUmwywAjDQvN/HjM/DiWIddy9y3N+J57WqEo43 MfdjZMZTCrnjz8mcCmrWNnDJyrerXzyhgt3f/ydyPsFC4G/nsO2qf6UF2haeJZviFPsr SchHNBjwdDlBKnBmfSpeZbu6+IJwLC10fZZ9vyGDOTJ0qtDDjT7omlnZORaeMcBz9nTZ VZnbLFwRDXttKNKJAm+lP5OaAKKJ0LzTZJS4hMvAjZkKhchKrVOARg4CXYiwO5/1P4hP IFIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@verge.net.au header.s=mail header.b=ddmh4Fec; 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 bi12-v6si10879020plb.555.2018.05.15.00.43.11; Tue, 15 May 2018 00:43:25 -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; dkim=fail header.i=@verge.net.au header.s=mail header.b=ddmh4Fec; 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 S1752280AbeEOHnD (ORCPT + 99 others); Tue, 15 May 2018 03:43:03 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:33638 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbeEOHnB (ORCPT ); Tue, 15 May 2018 03:43:01 -0400 Received: from penelope.horms.nl (unknown [37.203.60.226]) by kirsty.vergenet.net (Postfix) with ESMTPA id 613EF25B7ED; Tue, 15 May 2018 17:42:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1526370179; bh=ZYDc5MKzVqMO9Qrz1AmxLpJmg/EnD2H17xcRtUtG8/0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ddmh4Fec3vZDoRWHzldOXrxhviXg6iMufBRPNnXq9ExcNqMRzDGPrbYfMHGjuQG15 ih1Yl2rXNlhl4WkrwNlOsRq0OHVBl478j9jtlwjPhl0+QfDFfArsWsnk3RgwU+w2lz 1g5XiJq6JsRXIMvt4f4rcXN4fW32jj9fPlmlbxf4= Received: by penelope.horms.nl (Postfix, from userid 7100) id 20A90E216CD; Tue, 15 May 2018 09:42:42 +0200 (CEST) Date: Tue, 15 May 2018 09:42:42 +0200 From: Simon Horman To: Phil Edworthy Cc: Andy Shevchenko , Hoan Tran , Linus Walleij , Mark Rutland , Rob Herring , Lee Jones , Michel Pollet , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] gpio: dwapb: Add support for 1 interrupt per port A GPIO Message-ID: <20180515074241.kgvjbhrgw2dbec6o@verge.net.au> References: <1526027497-32556-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: <1526027497-32556-1-git-send-email-phil.edworthy@renesas.com> Organisation: Horms Solutions BV User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 11, 2018 at 09:31:37AM +0100, Phil Edworthy wrote: > The DesignWare GPIO IP can be configured for either 1 interrupt or 1 > per GPIO in port A, but the driver currently only supports 1 interrupt. > See the DesignWare DW_apb_gpio Databook description of the > 'GPIO_INTR_IO' parameter. > > This change allows the driver to work with up to 32 interrupts, it will > get as many interrupts as specified in the DT 'interrupts' property. > It doesn't do anything clever with the different interrupts, it just calls > the same handler used for single interrupt hardware. > > Signed-off-by: Phil Edworthy > Reviewed-by: Rob Herring > Acked-by: Lee Jones > --- > One point to mention is that I have made it possible for users to have > unconnected interrupts by specifying holes in the list of interrupts. This is > done by supporting the interrupts-extended DT prop. > However, I have no use for this and had to hack some test case for this. > Perhaps the driver should support 1 interrupt or all GPIOa as interrupts? > > v6: > - Treat DT and ACPI the same as much as possible. Note that we can't use > platform_get_irq() to get the DT interrupts as they are in the port > sub-node and hence do not have an associated platform device. > v5: > - Rolled ACPI companion code provided by Hoan Tran into this patch. > v4: > - Use of_irq_get() instead of of_irq_parse_one()+irq_create_of_mapping() > v3: > - Rolled mfd: intel_quark_i2c_gpio fix into this patch to avoid bisect problems > v2: > - Replaced interrupt-mask DT prop with support for the interrupts-extended > prop. This means replacing the call to irq_of_parse_and_map() with calls > to of_irq_parse_one() and irq_create_of_mapping(). > --- > .../devicetree/bindings/gpio/snps-dwapb-gpio.txt | 9 +++- > drivers/gpio/gpio-dwapb.c | 49 +++++++++++++++------- > drivers/mfd/intel_quark_i2c_gpio.c | 3 +- > include/linux/platform_data/gpio-dwapb.h | 3 +- > 4 files changed, 45 insertions(+), 19 deletions(-) > > diff --git a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > index 4a75da7..3c1118b 100644 > --- a/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > +++ b/Documentation/devicetree/bindings/gpio/snps-dwapb-gpio.txt > @@ -26,8 +26,13 @@ controller. > the second encodes the triger flags encoded as described in > Documentation/devicetree/bindings/interrupt-controller/interrupts.txt > - interrupt-parent : The parent interrupt controller. > -- interrupts : The interrupt to the parent controller raised when GPIOs > - generate the interrupts. > +- interrupts : The interrupts to the parent controller raised when GPIOs > + generate the interrupts. If the controller provides one combined interrupt > + for all GPIOs, specify a single interrupt. If the controller provides one > + interrupt for each GPIO, provide a list of interrupts that correspond to each > + of the GPIO pins. When specifying multiple interrupts, if any are unconnected, > + use the interrupts-extended property to specify the interrupts and set the > + interrupt controller handle for unused interrupts to 0. > - snps,nr-gpios : The number of pins in the port, a single cell. > - resets : Reset line for the controller. An enhanced example might be helpful. That not withstanding: Reviewed-by: Simon Horman