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: <20170221171332.w6dh7ccd2eyg5dgu@earth>
Date:   Tue, 21 Feb 2017 18:13:32 +0100
From:   Sebastian Reichel <sre@...nel.org>
To:     "H. Nikolaus Schaller" <hns@...delico.com>
Cc:     Dmitry Torokhov <dmitry.torokhov@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Jonathan Cameron <jic23@...nel.org>,
        linux-input@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, letux-kernel@...nphoenux.org
Subject: Re: [PATCH 2/3] Input: tsc2007 - correctly report pressure and not
 resistance to user space

Hi,

On Mon, Feb 20, 2017 at 05:56:35PM +0100, H. Nikolaus Schaller wrote:
> previously, tsc2007 will report as ABS_PRESSURE:
> 0              for no pressure (resistance infinite)
> high value     for soft pressure (high resistance)
> low value      for firm pressure (lower resistance)
> 
> This does not matter for most applications (e.g. GUI, Menu, Scrolling
> etc.) where the ABS_PRESSURE is ignored and only BTN_TOUCH is processed
> to detect screen taps.
> 
> Only some special graphics applications read the pressure channel and
> they will be mixed up by this non-monotonic relation.
> 
> So we fix it to become:
> 0              for no pressure (resistance infinite)
> low value      for soft pressure (high resistance)
> high value     for firm pressure (lower resistance)
> 
> While this patch changes the values reported to userspace,
> ABS_PRESSURE is used rarely by userspace. Most software only
> relies on BTN_TOUCH (boolean), which is not affected by this
> patch. Some graphics software makes use of the interface and
> does not work correctly with the currently used inverted
> behaviour.
> 
> Signed-off-by: H. Nikolaus Schaller <hns@...delico.com>
> ---
>  drivers/input/touchscreen/tsc2007_core.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
> index 30b53ca..fc73849 100644
> --- a/drivers/input/touchscreen/tsc2007_core.c
> +++ b/drivers/input/touchscreen/tsc2007_core.c
> @@ -141,6 +141,8 @@ static irqreturn_t tsc2007_soft_irq(int irq, void *handle)
>  				"DOWN point(%4d,%4d), resistance (%4u)\n",
>  				tc.x, tc.y, rt);
>  
> +			rt = ts->max_rt - rt;
> +
>  			input_report_key(input, BTN_TOUCH, 1);
>  			input_report_abs(input, ABS_X, tc.x);
>  			input_report_abs(input, ABS_Y, tc.y);

Reviewed-By: Sebastian Reichel <sre@...nel.org>

We should add the same to ts200x-core.

-- Sebastian

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ