Linux Input/HID development
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: "H. Nikolaus Schaller" <hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
Cc: Dmitry Torokhov
	<dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	letux-kernel-S0jZdbWzriLCfDggNXIi3w@public.gmane.org
Subject: Re: [PATCH 2/3] Input: tsc2007 - correctly report pressure and not resistance to user space
Date: Tue, 21 Feb 2017 18:13:32 +0100	[thread overview]
Message-ID: <20170221171332.w6dh7ccd2eyg5dgu@earth> (raw)
In-Reply-To: <9e249276be9e20aab1a74617373bf6587f1acd4b.1487609795.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2027 bytes --]

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-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
> ---
>  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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

We should add the same to ts200x-core.

-- Sebastian

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-02-21 17:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-20 16:56 [PATCH 0/3] Fix tsc2007 to report ABS_PRESSURE correctly H. Nikolaus Schaller
2017-02-20 16:56 ` [PATCH 1/3] Input: tsc2007 - rename function tsc2007_calculate_pressure to tsc2007_calculate_resistance because that is what it does H. Nikolaus Schaller
2017-02-23  8:45   ` Dmitry Torokhov
     [not found] ` <cover.1487609795.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2017-02-20 16:56   ` [PATCH 2/3] Input: tsc2007 - correctly report pressure and not resistance to user space H. Nikolaus Schaller
     [not found]     ` <9e249276be9e20aab1a74617373bf6587f1acd4b.1487609795.git.hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org>
2017-02-21 17:13       ` Sebastian Reichel [this message]
2017-02-23  8:45         ` Dmitry Torokhov
2017-02-20 16:56 ` [PATCH 3/3] Input: tsc2007 - add a property "ti,report-resistance" to restore the old pressure reporting state if needed H. Nikolaus Schaller
2017-02-21 11:07   ` Pavel Machek
2017-02-21 11:43     ` H. Nikolaus Schaller
2017-02-21 17:19       ` Sebastian Reichel

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=20170221171332.w6dh7ccd2eyg5dgu@earth \
    --to=sre-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=hns-xXXSsgcRVICgSpxsJD1C4w@public.gmane.org \
    --cc=jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=letux-kernel-S0jZdbWzriLCfDggNXIi3w@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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