lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 14 Sep 2013 14:16:47 +0200
From:	Tomasz Figa <tomasz.figa@...il.com>
To:	Benson Leung <bleung@...omium.org>
Cc:	dmitry.torokhov@...il.com, linux-kernel@...r.kernel.org,
	linux-input@...r.kernel.org, linux-gpio@...r.kernel.org,
	devicetree@...r.kernel.org, david@...tonic.nl,
	dianders@...omium.org
Subject: Re: [PATCH] Input: gpio_keys - wakeup_trigger

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@...omium.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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ