From: Tomasz Figa <tomasz.figa@gmail.com>
To: Benson Leung <bleung@chromium.org>
Cc: dmitry.torokhov@gmail.com, linux-kernel@vger.kernel.org,
linux-input@vger.kernel.org, linux-gpio@vger.kernel.org,
devicetree@vger.kernel.org, david@protonic.nl,
dianders@chromium.org
Subject: Re: [PATCH] Input: gpio_keys - wakeup_trigger
Date: Sat, 14 Sep 2013 14:16:47 +0200 [thread overview]
Message-ID: <106090496.3hTZTLSVzK@flatron> (raw)
In-Reply-To: <1379109160-32437-1-git-send-email-bleung@chromium.org>
Hi Benson,
On Friday 13 of September 2013 14:52:40 Benson Leung wrote:
> Allow wakeup_trigger to be defined per gpio button. Currently, all
> gpio buttons are set up as IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING.
> It may be more appropriate to only wake the system on one edge, for
> example if the gpio is for a Lid Switch.
>
> Signed-off-by: Benson Leung <bleung@chromium.org>
> ---
> .../devicetree/bindings/gpio/gpio_keys.txt | 7 +++++++
> drivers/input/keyboard/gpio_keys.c | 23
> ++++++++++++++++++++-- include/linux/gpio_keys.h
> | 3 +++
> 3 files changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/gpio_keys.txt
> b/Documentation/devicetree/bindings/gpio/gpio_keys.txt index
> 5c2c021..243f569 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio_keys.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio_keys.txt
> @@ -20,6 +20,13 @@ Optional subnode-properties:
> - debounce-interval: Debouncing interval time in milliseconds.
> If not specified defaults to 5.
> - gpio-key,wakeup: Boolean, button can wake-up the system.
> + - gpio-key,wakeup-trigger : Specifies the type of wakeup behavior.
> + <1> == Rising Edge Trigger
> + <2> == Falling Edge Trigger
> + <3> == Both Rising and Falling Edge Trigger
> + <4> == Level High Trigger
> + <8> == Level Low Trigger
> + If not specified, defaults to <3> == Both Rising and Falling.
I don't like two things in this patch.
First is that this looks completely like a configuration option, not
hardware description, so it's not something that should be put into DT.
Especially that users might want to use another wake-up trigger depending
on their use cases. I'd rather see this as a sysfs entry.
Another thing is that this driver assumes that key events are indicated by
edges on the GPIO line, so I don't think level trigger setting make any
sense here. I'd rather allow three settings here (through a sysfs knob) -
key down, key up, key down or up.
Best regards,
Tomasz
next prev parent reply other threads:[~2013-09-14 12:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-13 21:52 [PATCH] Input: gpio_keys - wakeup_trigger Benson Leung
[not found] ` <1379109160-32437-1-git-send-email-bleung-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2013-09-13 23:56 ` Doug Anderson
2013-09-14 12:16 ` Tomasz Figa [this message]
2013-09-19 20:43 ` Benson Leung
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=106090496.3hTZTLSVzK@flatron \
--to=tomasz.figa@gmail.com \
--cc=bleung@chromium.org \
--cc=david@protonic.nl \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).