diff mbox

Input: tsc200x-core - set INPUT_PROP_DIRECT

Message ID 20171107234000.10236-1-martink@posteo.de (mailing list archive)
State Accepted
Headers show

Commit Message

Martin Kepplinger-Novakovic Nov. 7, 2017, 11:40 p.m. UTC
If INPUT_PROP_DIRECT is set, userspace doesn't have to fall back to old
ways of identifying touchscreen devices.

In order to identify a touchscreen device, Android for example, seems to
already depend on INPUT_PROP_DIRECT to be present in drivers. udev still
checks for either BTN_TOUCH or INPUT_PROP_DIRECT. Checking for BTN_TOUCH
however can quite easily lead to false positives; it's a code that not only
touchscreen device drivers use.

According to the documentation, touchscreen drivers should have this
property set and in order to make life easy for userspace, let's set it.

Signed-off-by: Martin Kepplinger <martink@posteo.de>
---

Still, as a paranoia measure, I'd not do a bulk-patchset adding this bit
to every driver here. I'll add it to drivers I know of, by using them
myself or people that report using tslib. Who knows what devices or
usecases exist out there :)


 drivers/input/touchscreen/tsc200x-core.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Dmitry Torokhov Nov. 8, 2017, 12:21 a.m. UTC | #1
On Wed, Nov 08, 2017 at 12:40:00AM +0100, Martin Kepplinger wrote:
> If INPUT_PROP_DIRECT is set, userspace doesn't have to fall back to old
> ways of identifying touchscreen devices.
> 
> In order to identify a touchscreen device, Android for example, seems to
> already depend on INPUT_PROP_DIRECT to be present in drivers. udev still
> checks for either BTN_TOUCH or INPUT_PROP_DIRECT. Checking for BTN_TOUCH
> however can quite easily lead to false positives; it's a code that not only
> touchscreen device drivers use.
> 
> According to the documentation, touchscreen drivers should have this
> property set and in order to make life easy for userspace, let's set it.
> 
> Signed-off-by: Martin Kepplinger <martink@posteo.de>

Applied, thank you.

> ---
> 
> Still, as a paranoia measure, I'd not do a bulk-patchset adding this bit
> to every driver here. I'll add it to drivers I know of, by using them
> myself or people that report using tslib. Who knows what devices or
> usecases exist out there :)
> 
> 
>  drivers/input/touchscreen/tsc200x-core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c
> index 542db26d7fd0..e0fde590df8e 100644
> --- a/drivers/input/touchscreen/tsc200x-core.c
> +++ b/drivers/input/touchscreen/tsc200x-core.c
> @@ -531,6 +531,7 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
>  
>  	input_set_drvdata(input_dev, ts);
>  
> +	__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
>  	input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
>  
>  	input_set_abs_params(input_dev, ABS_X,
> -- 
> 2.11.0
>
diff mbox

Patch

diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c
index 542db26d7fd0..e0fde590df8e 100644
--- a/drivers/input/touchscreen/tsc200x-core.c
+++ b/drivers/input/touchscreen/tsc200x-core.c
@@ -531,6 +531,7 @@  int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id,
 
 	input_set_drvdata(input_dev, ts);
 
+	__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
 	input_set_capability(input_dev, EV_KEY, BTN_TOUCH);
 
 	input_set_abs_params(input_dev, ABS_X,