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] [day] [month] [year] [list]
Date:   Sat, 19 Nov 2016 10:12:29 -0800
From:   Dmitry Torokhov <dmitry.torokhov@...il.com>
To:     "H. Nikolaus Schaller" <hns@...delico.com>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Benoît Cousson <bcousson@...libre.com>,
        Tony Lindgren <tony@...mide.com>,
        Russell King <linux@...linux.org.uk>,
        Arnd Bergmann <arnd@...db.de>,
        Michael Welling <mwelling@...e.org>,
        Mika Penttilä <mika.penttila@...tfour.com>,
        Javier Martinez Canillas <javier@....samsung.com>,
        Igor Grinberg <grinberg@...pulab.co.il>,
        Sebastian Reichel <sre@...nel.org>,
        "Andrew F. Davis" <afd@...com>, Mark Brown <broonie@...nel.org>,
        Jonathan Cameron <jic23@...nel.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Sangwon Jee <jeesw@...fas.com>, linux-input@...r.kernel.org,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-omap@...r.kernel.org, letux-kernel@...nphoenux.org,
        linux-iio@...r.kernel.org, kernel@...a-handheld.com
Subject: Re: [PATCH v6 2/8] drivers:input:tsc2007: send pendown and penup
 only once like ads7846(+tsc2046) driver does

On Thu, Oct 27, 2016 at 10:44:15AM +0200, H. Nikolaus Schaller wrote:
> this should reduce unnecessary input events.

The duplicates will be filtered out by the input core anyway. I like to
keep the drivers simple.

Thanks.

> 
> Signed-off-by: H. Nikolaus Schaller <hns@...delico.com>
> ---
>  drivers/input/touchscreen/tsc2007.c | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c
> index c1d9593..e9d5086 100644
> --- a/drivers/input/touchscreen/tsc2007.c
> +++ b/drivers/input/touchscreen/tsc2007.c
> @@ -94,6 +94,7 @@ struct tsc2007 {
>  
>  	wait_queue_head_t	wait;
>  	bool			stopped;
> +	bool			pendown;
>  
>  	int			(*get_pendown_state)(struct device *);
>  	void			(*clear_penirq)(void);
> @@ -227,7 +228,11 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
>  				sx, sy, rt);
>  
>  			/* report event */
> -			input_report_key(input, BTN_TOUCH, 1);
> +			if (!ts->pendown) {
> +				input_report_key(input, BTN_TOUCH, 1);
> +				ts->pendown = true;
> +			}
> +
>  			touchscreen_report_pos(ts->input, &ts->prop,
>  						(unsigned int) sx,
>  						(unsigned int) sy,
> @@ -250,9 +255,13 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
>  
>  	dev_dbg(&ts->client->dev, "UP\n");
>  
> -	input_report_key(input, BTN_TOUCH, 0);
> -	input_report_abs(input, ABS_PRESSURE, 0);
> -	input_sync(input);
> +	if (ts->pendown) {
> +		input_report_key(input, BTN_TOUCH, 0);
> +		input_report_abs(input, ABS_PRESSURE, 0);
> +		input_sync(input);
> +
> +		ts->pendown = false;
> +	}
>  
>  	if (ts->clear_penirq)
>  		ts->clear_penirq();
> -- 
> 2.7.3
> 

-- 
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ