[PATCH] Input: ads7846 - don't set ABS_PRESSURE when min == max

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dmitry,

thank you for the feedback!

On Thu, 27 Jul 2023 at 22:39, Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> wrote:
> On Thu, Jul 27, 2023 at 05:19:57PM +0200, Benjamin Bara wrote:
> > From: Benjamin Bara <benjamin.bara@xxxxxxxxxxx>
> >
> > When the optional fields "pressure_min" and "pressure_max" are not set,
> > both fall back to 0, which results to the following libinput error:
> >
> > ADS7846 Touchscreen: kernel bug: device has min == max on ABS_PRESSURE
> >
> > Avoid it by only setting ABS_PRESSURE if the values differ.
>
> What is the benefit of silently continuing without reporting pressure on
> models that do support pressure readings, vs. using libinput's errors as
> signal to adjust DT?

With the current implementation, libinput rejects the device [1] when an
optional device-tree field is not set, which leads to a "non-functional" device.
But you are right, silently continuing might also not be the best option...
I could provide a v2 where the maximum is set to a fallback value (~0) and a
warning is printed that the pressure is not set and therefore a fallback value
is used, to signal the user to adjust the DT.

What do you think about that?

Best regards
Benjamin

[1] https://gitlab.freedesktop.org/libinput/libinput/-/blob/1.23.0/src/evdev.c?ref_type=tags#L1816



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux