From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757292AbbBEK0f (ORCPT ); Thu, 5 Feb 2015 05:26:35 -0500 Received: from mail-bn1bon0084.outbound.protection.outlook.com ([157.56.111.84]:25900 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756973AbbBEK0c convert rfc822-to-8bit (ORCPT ); Thu, 5 Feb 2015 05:26:32 -0500 Message-ID: <1423131980.1110.11.camel@ubuntu> Subject: Re: [PATCH v8 1/2] drivers/gpio: Altera soft IP GPIO driver device tree binding From: Tien Hock Loh To: Linus Walleij CC: , Pawel Moll , Mark Rutland , Ian Campbell , "Kumar Gala" , Alexandre Courbot , "Grant Likely" , Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Joe Perches , "Mauro Carvalho Chehab" , Antti Palosaari , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-gpio@vger.kernel.org" , Dinh Nguyen Date: Thu, 5 Feb 2015 02:26:20 -0800 In-Reply-To: References: <1419409345-8297-1-git-send-email-thloh@altera.com> <1419409345-8297-2-git-send-email-thloh@altera.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-EOPAttributedMessage: 0 Authentication-Results: spf=softfail (sender IP is 66.35.236.227) smtp.mailfrom=thloh@altera.com; codeaurora.org; dkim=none (message not signed) header.d=none; X-Forefront-Antispam-Report: CIP:66.35.236.227;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(24454002)(377424004)(51704005)(377454003)(87936001)(105596002)(103116003)(19580395003)(19580405001)(86362001)(42186005)(50986999)(46102003)(6806004)(23676002)(76176999)(106466001)(50466002)(50226001)(110136001)(92566002)(33716001)(77156002)(33646002)(2950100001)(47776003)(62966003)(7099025)(99106002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR03MB356;H:sj-itexedge03.altera.priv.altera.com;FPR:;SPF:SoftFail;MLV:ovrnspm;PTR:InfoDomainNonexistent;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB356; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004);SRVR:BL2PR03MB356; X-Forefront-PRVS: 0478C23FE0 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BL2PR03MB356; X-OriginatorOrg: altera.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2015 10:26:27.5933 (UTC) X-MS-Exchange-CrossTenant-Id: fbd72e03-d4a5-4110-adce-614d51f2077a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=fbd72e03-d4a5-4110-adce-614d51f2077a;Ip=[66.35.236.227] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB356 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-01-14 at 11:01 +0100, Linus Walleij wrote: > On Wed, Dec 24, 2014 at 9:22 AM, wrote: > > > From: Tien Hock Loh > > > > Adds a new driver device tree binding for Altera soft GPIO IP > > > > Signed-off-by: Tien Hock Loh > > --- > > .../devicetree/bindings/gpio/gpio-altera.txt | 43 ++++++++++++++++++++ > > 1 files changed, 43 insertions(+), 0 deletions(-) > > create mode 100644 Documentation/devicetree/bindings/gpio/gpio-altera.txt > > > > diff --git a/Documentation/devicetree/bindings/gpio/gpio-altera.txt b/Documentation/devicetree/bindings/gpio/gpio-altera.txt > > new file mode 100644 > > index 0000000..649fa02 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/gpio/gpio-altera.txt > > @@ -0,0 +1,43 @@ > > +Altera GPIO controller bindings > > + > > +Required properties: > > +- compatible: > > + - "altr,pio-1.0" > > +- reg: Physical base address and length of the controller's registers. > > +- #gpio-cells : Should be 2 > > Yeah. > > > + - The first cell is the gpio offset number. > > + - The second cell is reserved and is currently unused. > > +- gpio-controller : Marks the device node as a GPIO controller. > > +- interrupt-controller: Mark the device node as an interrupt controller > > +- #interrupt-cells : Should be 1. The interrupt type is fixed in the hardware. > > + - The first cell is the GPIO offset number within the GPIO controller. > > +- interrupts: Specify the interrupt. > > +- altr,interrupt-trigger: Specifies the interrupt trigger type the GPIO > > + hardware is synthesized. This field is required if the Altera GPIO controller > > + used has IRQ enabled as the interrupt type is not software controlled, > > + but hardware synthesized. Required if GPIO is used as an interrupt > > + controller. The value is defined in > > + Only the following flags are supported: > > + IRQ_TYPE_EDGE_RISING > > + IRQ_TYPE_EDGE_FALLING > > + IRQ_TYPE_EDGE_BOTH > > + IRQ_TYPE_LEVEL_HIGH > > + > > +Optional properties: > > +- altr,ngpio: Width of the GPIO bank. This defines how many pins the > > + GPIO device has. Ranges between 1-32. Optional and defaults to 32 is not > > + specified. > > + > > +Example: > > + > > +gpio_altr: gpio@0xff200000 { > > + compatible = "altr,pio-1.0"; > > + reg = <0xff200000 0x10>; > > + interrupts = <0 45 4>; > > + altr,ngpio = <32>; > > + altr,interrupt_trigger = ; > > + #gpio-cells = <1>; > > So why is there one cell in the example? > > I know the second cell will describe the interrupt type that is > anyway hardcoded but yeah, I guess it is best to work > like all other controllers. > > If you actually want it onecell that is fine too. It should be set to two cells, I'll update this. > > Yours, > Linus Walleij Regards Tien Hock Loh