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]
Message-ID: <20161103162159.GB15366@dtor-ws>
Date:   Thu, 3 Nov 2016 09:21:59 -0700
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     Paul Cercueil <paul@...pouillou.net>
Cc:     Laxman Dewangan <ldewangan@...dia.com>,
        linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Maarten ter Huurne <maarten@...ewalker.org>
Subject: Re: [PATCH 1/2] Input: gpio_keys - Also send release events for ABS
 codes

On Tue, Nov 01, 2016 at 11:25:03AM +0100, Paul Cercueil wrote:
> Right now, the gpio-keys driver is mostly used with EV_KEY event types.
> However, this driver (and its devicetree bindings) support specifying
> a different input type, like EV_ABS, even though this doesn't work in
> practice: "key pressed" events are correctly received and treated, but
> "key released" are silently ignored.
> 
> With this commit, keys configured as EV_ABS will inject an event with
> the value 0 when released.

No, this will break setups like this:

gpio0 - ABS_X - 0
gpio1 - ABS_X - 1
gpio2 - ABS_X - 2
...
gpio7 - ABS_X - 7

- something like a slider built on top of gpios.

> 
> Signed-off-by: Paul Cercueil <paul@...pouillou.net>
> ---
>  drivers/input/keyboard/gpio_keys.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
> index 2909365..7018c49 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -369,6 +369,8 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
>  	if (type == EV_ABS) {
>  		if (state)
>  			input_event(input, type, button->code, button->value);
> +		else
> +			input_event(input, type, button->code, 0);
>  	} else {
>  		input_event(input, type, button->code, !!state);
>  	}
> -- 
> 2.9.3
> 

Thanks.

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ