From: Baolin Wang <baolin.wang@linaro.org>
To: Rob Herring <robh@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Mark Rutland <mark.rutland@arm.com>,
Greg KH <gregkh@linuxfoundation.org>,
stephen lu <lumotuwe@gmail.com>,
Arvind Yadav <arvind.yadav.cs@gmail.com>,
Joseph Lo <josephl@nvidia.com>,
Kate Stewart <kstewart@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>,
Thomas Gleixner <tglx@linutronix.de>,
linux-input@vger.kernel.org, DTML <devicetree@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Mark Brown <broonie@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH v2] Input: gpio_keys: Add level trigger support for GPIO keys
Date: Wed, 21 Feb 2018 19:35:26 +0800 [thread overview]
Message-ID: <CAMz4kuL-VZ8XY5-ZLWfXLVXWb4zmxD-aaLQ-ka9M8V83y1B7Ag@mail.gmail.com> (raw)
In-Reply-To: <20180219181159.tzbhhvbvpc236qma@rob-hp-laptop>
Hi Rob,
On 20 February 2018 at 02:11, Rob Herring <robh@kernel.org> wrote:
> On Sun, Feb 11, 2018 at 02:55:04PM +0800, Baolin Wang wrote:
>> On some platforms (such as Spreadtrum platform), the GPIO keys can only
>> be triggered by level type. So this patch introduces one property to
>> indicate if the GPIO trigger type is level trigger or edge trigger.
>
> If the parent interrupt controller only supports a certain trigger, then
> it should ignore setting the trigger type.
We still need to set high level type trigger or low level type trigger
if it only supports level trigger.
>
>>
>> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
>> ---
>> Changes since v1:
>> - Diable the GPIO irq until reversing the GPIO level type.
>> ---
>> .../devicetree/bindings/input/gpio-keys.txt | 2 ++
>> drivers/input/keyboard/gpio_keys.c | 26 +++++++++++++++++++-
>> include/linux/gpio_keys.h | 1 +
>> 3 files changed, 28 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/input/gpio-keys.txt b/Documentation/devicetree/bindings/input/gpio-keys.txt
>> index a949404..e3104bd 100644
>> --- a/Documentation/devicetree/bindings/input/gpio-keys.txt
>> +++ b/Documentation/devicetree/bindings/input/gpio-keys.txt
>> @@ -29,6 +29,8 @@ Optional subnode-properties:
>> - linux,can-disable: Boolean, indicates that button is connected
>> to dedicated (not shared) interrupt which can be disabled to
>> suppress events from the button.
>> + - gpio-key,level-trigger: Boolean, indicates that button's interrupt
>> + type is level trigger. Otherwise it is edge trigger as default.
>
> No. Just use 'interrupts' instead of 'gpios' and specify the trigger
> type. Or put both if you need to read the state.
Okay, so something as below to get the level type from the
'interrupts' property.
if (fwnode_property_read_u32(child, "interrupts", &button->level_type))
button->level_type = IRQ_TYPE_NONE;
--
Baolin.wang
Best Regards
next prev parent reply other threads:[~2018-02-21 11:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-11 6:55 [PATCH v2] Input: gpio_keys: Add level trigger support for GPIO keys Baolin Wang
2018-02-19 18:11 ` Rob Herring
2018-02-21 11:35 ` Baolin Wang [this message]
2018-02-26 6:24 ` Baolin Wang
2018-02-28 12:53 ` Linus Walleij
2018-03-01 7:41 ` Baolin Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAMz4kuL-VZ8XY5-ZLWfXLVXWb4zmxD-aaLQ-ka9M8V83y1B7Ag@mail.gmail.com \
--to=baolin.wang@linaro.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=josephl@nvidia.com \
--cc=kstewart@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lumotuwe@gmail.com \
--cc=mark.rutland@arm.com \
--cc=pombredanne@nexb.com \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).