evdev always returns fixed XY values
Marco Cavallini
info at koansoftware.com
Mon May 25 08:49:37 PDT 2015
Il 25/05/2015 13:22, Peter Korsgaard ha scritto:
>
> Hi,
>
>>> Driver claims to return X/Y in 0..4095 range.
> >>
> >> > Event: time 1432134719.652423, type 3 (EV_ABS), code 0 (ABS_X), value 7823
> >> > Event: time 1432134719.652423, type 3 (EV_ABS), code 1 (ABS_Y), value 7987
> >>
> >> But then returns values that are outside this range, confusing user space.
> >>
> >> Garbage in is garbage out.
> >>
>
> > So why ts_print is working?
>
> Presumably because it just prints the kernel events without validating
> that they are really in the min..max range.
>
>> Couldn't this be related to xinput only?
>
> No, the reason is your kernel driver. Some user space sw may be able to
> more or less work with a kernel driver that provides out of range
> events, but xinput clips them to the valid range.
>
> Once again, the fix is to correct the kernel driver.
>
> From input/drivers/touchscreen/abs7846.c I see:
>
> static int ads7846_probe(struct spi_device *spi)
> {
> ...
> input_set_abs_params(input_dev, ABS_X,
> pdata->x_min ? : 0,
> pdata->x_max ? : MAX_12BIT,
> 0, 0);
> input_set_abs_params(input_dev, ABS_Y,
> pdata->y_min ? : 0,
> pdata->y_max ? : MAX_12BIT,
> 0, 0);
>
> So presumably you just need to pass the correct x_max/y_max in your
> platform data.
>
Thank you Peter,
after your precious suggestion I discovered a problem in the values in
the Device Tree for my ADS7843 Touchscreen
ti,swap-xy = <1>;
ti,x-min = <0>;
ti,x-max = <8000>;
ti,y-min = <0>;
ti,y-max = <8000>;
Everything is working with a charm.
Thank you
Cordiali Saluti / Kindest Regards / Mit freundlichen Grüßen
--
Marco Cavallini | KOAN sas | Bergamo - Italia
embedded and real-time software engineering
Phone:+39-035-255.235 - Fax:+39-178-22.39.748
http://www.KoanSoftware.com
More information about the xorg
mailing list