[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMz4kuJjLDGrrHyd2xQ1+ojxjtbVoyX=9OA1sB9K9oVqM7D3xg@mail.gmail.com>
Date: Sun, 11 Feb 2018 09:54:51 +0800
From: Baolin Wang <baolin.wang@...aro.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stephen lu <lumotuwe@...il.com>,
Arvind Yadav <arvind.yadav.cs@...il.com>,
Joseph Lo <josephl@...dia.com>,
Kate Stewart <kstewart@...uxfoundation.org>,
Philippe Ombredanne <pombredanne@...b.com>,
Thomas Gleixner <tglx@...utronix.de>,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
DTML <devicetree@...r.kernel.org>,
lkml <linux-kernel@...r.kernel.org>,
Mark Brown <broonie@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] Input: gpio_keys: Add level trigger support for GPIO keys
On 9 February 2018 at 23:03, Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> On Fri, Feb 9, 2018 at 11:23 AM, Baolin Wang <baolin.wang@...aro.org> wrote:
>> On 9 February 2018 at 14:39, Dmitry Torokhov <dmitry.torokhov@...il.com> wrote:
>>> On Thu, Feb 8, 2018 at 10:08 PM, Baolin Wang <baolin.wang@...aro.org> 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.
Yes, you and Dmitry are right. I realized my problem. When I tested on
Spreadtrum platform, we use Spreadtrum-special EIC (external interrupt
controller) to trigger button events, if we acked the EIC irq, it will
drop the interrupt line and never trigger events until we set irq type
again. But this can not work for general GPIOs like you said.
So I think I need disable the irq until reversing the level type. Thanks.
--
Baolin.wang
Best Regards
Powered by blists - more mailing lists