Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754472AbcDFMGQ (ORCPT ); Wed, 6 Apr 2016 08:06:16 -0400 Received: from mail-sn1nam02on0060.outbound.protection.outlook.com ([104.47.36.60]:2164 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751827AbcDFMGO (ORCPT ); Wed, 6 Apr 2016 08:06:14 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; From: Nava kishore Manne To: Linus Walleij CC: Dmitry Torokhov , =?utf-8?B?QW5kZXJzc29uLCBCasO2cm4=?= , "Peng Fan" , Linux Input , "linux-kernel@vger.kernel.org" Subject: RE: [LINUX PATCH v2] gpio_keys: Added support to read the IRQ_FLAGS from devicetree Thread-Topic: [LINUX PATCH v2] gpio_keys: Added support to read the IRQ_FLAGS from devicetree Thread-Index: AQHRjlhAuUGWa1s3i02trkPBr2DnZZ95IcSAgAOurgA= Date: Wed, 6 Apr 2016 11:32:55 +0000 Message-ID: References: <1459763770-2296-1-git-send-email-navam@xilinx.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.93.193] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22242.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(189002)(199003)(13464003)(377454003)(24454002)(19580395003)(86362001)(2906002)(33656002)(1220700001)(4326007)(11100500001)(5008740100001)(102836003)(5250100002)(19580405001)(87936001)(2920100001)(92566002)(1096002)(2900100001)(189998001)(586003)(55846006)(63266004)(47776003)(54356999)(6116002)(81166005)(6806005)(110136002)(106116001)(5004730100002)(50986999)(50466002)(3846002)(2950100001)(23676002)(76176999)(5003600100002)(106466001)(107986001)(217873001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1NAM02HT091;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:sfv;MX:1;A:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: d6710e62-1566-43a8-3468-08d35e0f349e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:CY1NAM02HT091; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(13017025)(13023025)(13018025)(13024025)(13015025)(5005006)(3002001)(10201501046);SRVR:CY1NAM02HT091;BCL:0;PCL:0;RULEID:;SRVR:CY1NAM02HT091; X-Forefront-PRVS: 0904004ECB X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2016 11:32:58.5769 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT091 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u36C6Qxw002257 Content-Length: 3169 Lines: 84 Hi Linus walleij, One of Our gpio-controller was supporting only edge rising interrupts. For that reason I implementing the below logic to read the interrupt trigger level from the DT. If it is wrong could you please provide the pointer to solve this issue? Regards, Navakishore. > -----Original Message----- > From: Linus Walleij [mailto:linus.walleij@linaro.org] > Sent: Monday, April 04, 2016 4:38 PM > To: Nava kishore Manne > Cc: Dmitry Torokhov; Andersson, Björn; Nava kishore Manne; Peng Fan; > Linux Input; linux-kernel@vger.kernel.org > Subject: Re: [LINUX PATCH v2] gpio_keys: Added support to read the > IRQ_FLAGS from devicetree > > On Mon, Apr 4, 2016 at 11:56 AM, Nava kishore Manne > wrote: > > > This patch adds the support to read the IRQ_FLAGS from the device > > instead of hard code the flags in gpio_keys_setup_key(). > > NACK > > > sw14 { > > label = "sw14"; > > gpios = <&gpio0 12 1>; > > /* > > * Triggering Type: > > * > > * 1 - edge rising > > * 2 - edge falling > > * 4 - level active high > > * 8 - level active low > > * > > */ > > You are completely violating the existing GPIO flags from include/dt- > bindings/gpio/gpio.h > > As you will see, for a twocell GPIO flags are already clearly defined for 0,1,2 > and 3. (Bit 0 & 1). > > Further, these IRQ edge/level flags already exist in include/dt- > bindings/interrupt-controller/irq.h > but you should not be using those either, because they do not mix with a > GPIO specifier, it's a bit like oil and water. > > The standard GPIO bindings already has > GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW > which makes it pretty clear that a GPIO line marked as GPIO_ACTIVE_HIGH > should trigger either on rising edge or level active high and vice versa. > > The only information you could *possibly* lack is whether the IRQ should be > edge or level triggered. > > But level triggered GPIO buttons *does* *not* *make* > *sense* *at* *all*. > > Think about it: > > The IRQ line goes level high or low because a user pressed a button with > his/her thumb. Then that is wired in as a level IRQ. So what are we going to > do? Wait in the interrupt handler until the user removes his/her thumb? > > Level IRQs on GPIOs only makes sense for devices off-chip where you can > talk to the device and ACK the interrupt, and in this case "talk" does not > mean wire up a speaker telling the user to remove the thumb from the > button because we have recieved the interrupt, albeit that would be the > real-world analogy. > > Please tell us what you are actually trying to solve. One of Our gpio-controller was supporting only edge rising interrupts. For that reason I implementing the below logic to read the interrupt trigger level from the DT. If it is wrong could you please provide the pointer to solve this issue? Regards, Navakishore. > > Yours, > Linus Walleij