From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ARC-Seal: i=1; a=rsa-sha256; t=1518188635; cv=none; d=google.com; s=arc-20160816; b=LP00TYjMJr61wlzyOI9YHxk/BWYkD32MVPXPaNbbyV09zgjWY+a13CHBEM6lu+w219 HuO23zLkpScBGtGZpPNNlWL+fa614SkYS5IFeht1hGQV25PMEmRgbnLn4c9aLaCPpL9u Ba4uPb4XIkRk+2+goI/KSvnd/IIgsfnoF6I8dYBp8Q1YpOVxBFJkSVlZOV+QdE7aDIyF LFtZ5Q68fw4VD9LdrUKTFe0I+mguGLgOyoJdfMAN+9iHp3qjlIXawoRe1AlDiq03A9NO KaZKBKilBTGwGs4fPfBhuA/tNDyeYueqqJMPwOahFUmaIHsL4o2hoOefZF10HQqOCU7L gpzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:dkim-signature:arc-authentication-results; bh=ysRx6sK941MISEW19RNANLKTUh28TEmCSo/sBE3n+MM=; b=E8kcSnPMhyAfYMuO3KHE2nIlFmNqR2ZPpbKHzy/9/KhZa58PZJyzNOMvLVOsFASY5h minuaT4cR66tYLZdZqNIfbh1/qrH947lMMhkmRlBh/AokinFcFHVY6+yQftpvIJwFaNC 0DtYvwzLnLTuXIiGwJpJszHzj2Lo+Nix60S9w9ndAYEUpbd69E0KtgbakcJCdvCs2nz5 z3BWUSa34QcgYK6eRljTsXiVMKqY/00YRdKM7B8roabaybb6YgBadBnK7Stl74bX5l9H KkJ6YsjPvCLlqzhfM+QxWwAnGR/C5q4E4nczbe1NbMqL6YIn3Z7fZEm01O0aE+h8TNep tyiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yzoh5g6c; spf=pass (google.com: domain of andy.shevchenko@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andy.shevchenko@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yzoh5g6c; spf=pass (google.com: domain of andy.shevchenko@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=andy.shevchenko@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Google-Smtp-Source: AH8x224x/Rpfoi3bB0Wq63uXBuFdDva/Ahbbf3vGr6N4HVMgnUR9tCzAZcFbBUH50f7yvHQUzjL4rLhBFjojytR32Ao= MIME-Version: 1.0 In-Reply-To: References: <6c53b9ccfd4a56fc1b00e243bb9e7cae9e124932.1518155780.git.baolin.wang@linaro.org> From: Andy Shevchenko Date: Fri, 9 Feb 2018 17:03:54 +0200 Message-ID: Subject: Re: [PATCH] Input: gpio_keys: Add level trigger support for GPIO keys To: Baolin Wang Cc: Dmitry Torokhov , Rob Herring , Mark Rutland , Greg Kroah-Hartman , stephen lu , Arvind Yadav , Joseph Lo , Kate Stewart , Philippe Ombredanne , Thomas Gleixner , "linux-input@vger.kernel.org" , DTML , lkml , Mark Brown , Linus Walleij Content-Type: text/plain; charset="UTF-8" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1591902511604872416?= X-GMAIL-MSGID: =?utf-8?q?1591936166629840017?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: On Fri, Feb 9, 2018 at 11:23 AM, Baolin Wang wrote: > On 9 February 2018 at 14:39, Dmitry Torokhov wrote: >> On Thu, Feb 8, 2018 at 10:08 PM, Baolin Wang wrote: >>> On some platforms (such as Spreadtrum platform), the GPIO keys can only >>> be triggered by level type. >> >> How do you stop the interrupt from re-triggering as long as the key >> stays pressed? > > We will set the level type irq handler as handle_level_irq(), in this > function, it will mask and ack the irq firstly. Wouldn't be ambiguous? 1. User presses the key -> a) we got edge followed by level signaling; b) IRQ core masks line, calls handler, ACKs, unmasks; c) somewhere here Press Event is sent; d) we still have level... We get IRQ fired again? But see 1. It obviously not the case. 2. User releases the key -> ... So, the main question if I understood Dmitry correctly is the period in time where IRQ line should be masked on one hand, and on the other it will guarantee that user didn't release-press cylcle. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Subject: Re: [PATCH] Input: gpio_keys: Add level trigger support for GPIO keys Date: Fri, 9 Feb 2018 17:03:54 +0200 Message-ID: References: <6c53b9ccfd4a56fc1b00e243bb9e7cae9e124932.1518155780.git.baolin.wang@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Baolin Wang Cc: Dmitry Torokhov , Rob Herring , Mark Rutland , Greg Kroah-Hartman , stephen lu , Arvind Yadav , Joseph Lo , Kate Stewart , Philippe Ombredanne , Thomas Gleixner , "linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , DTML , lkml , Mark Brown , Linus Walleij List-Id: devicetree@vger.kernel.org On Fri, Feb 9, 2018 at 11:23 AM, Baolin Wang wrote: > On 9 February 2018 at 14:39, Dmitry Torokhov wrote: >> On Thu, Feb 8, 2018 at 10:08 PM, Baolin Wang wrote: >>> On some platforms (such as Spreadtrum platform), the GPIO keys can only >>> be triggered by level type. >> >> How do you stop the interrupt from re-triggering as long as the key >> stays pressed? > > We will set the level type irq handler as handle_level_irq(), in this > function, it will mask and ack the irq firstly. Wouldn't be ambiguous? 1. User presses the key -> a) we got edge followed by level signaling; b) IRQ core masks line, calls handler, ACKs, unmasks; c) somewhere here Press Event is sent; d) we still have level... We get IRQ fired again? But see 1. It obviously not the case. 2. User releases the key -> ... So, the main question if I understood Dmitry correctly is the period in time where IRQ line should be masked on one hand, and on the other it will guarantee that user didn't release-press cylcle. -- With Best Regards, Andy Shevchenko -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html