[PATCH libevdev 5/5] Increase MAX_SLOTS to 60

Benjamin Tissoires benjamin.tissoires at gmail.com
Thu Feb 27 07:38:49 PST 2014


On Thu, Feb 27, 2014 at 1:27 AM, Peter Hutterer
<peter.hutterer at who-t.net> wrote:
> As seen on 3M devices, which seems to be the maximum seen so far. Some Stantum
> devices report 255 touches but are only capable of 10, so the are not affected

Just nitpicking here:
When I said Stantum report 255 touches but are only capable of 10,
That' s actually fixed in the kernel. In this particular case, we
consider that the maximum realistic value is 250 (which is kind of
big, but is not 0xff), and we assigned the contact max to 10. So
hopefully, the max slot exported by the device are all correct.

Acked-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>

Cheers,
Benjamin

> by our limits.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> ---
>  libevdev/libevdev-int.h     | 2 +-
>  libevdev/libevdev.h         | 2 +-
>  test/test-libevdev-events.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libevdev/libevdev-int.h b/libevdev/libevdev-int.h
> index 42141ca..2bc8750 100644
> --- a/libevdev/libevdev-int.h
> +++ b/libevdev/libevdev-int.h
> @@ -34,7 +34,7 @@
>  #define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
>  #define ARRAY_LENGTH(a) (sizeof(a) / (sizeof((a)[0])))
>  #define MAX_NAME 256
> -#define MAX_SLOTS 32
> +#define MAX_SLOTS 60
>  #define ABS_MT_MIN ABS_MT_SLOT
>  #define ABS_MT_MAX ABS_MT_TOOL_Y
>  #define ABS_MT_CNT (ABS_MT_MAX - ABS_MT_MIN + 1)
> diff --git a/libevdev/libevdev.h b/libevdev/libevdev.h
> index 06d2dfa..f975e42 100644
> --- a/libevdev/libevdev.h
> +++ b/libevdev/libevdev.h
> @@ -695,7 +695,7 @@ enum libevdev_read_status {
>   * have been synced.
>   * @note The implementation of libevdev limits the maximum number of slots
>   * that can be synched. If your device exceeds the number of slots
> - * (currently 32), slot indices equal and above this maximum are ignored and
> + * (currently 60), slot indices equal and above this maximum are ignored and
>   * their value will not update until the next event in that slot.
>   *
>   * If a device needs to be synced by the caller but the caller does not call
> diff --git a/test/test-libevdev-events.c b/test/test-libevdev-events.c
> index 87e5238..ae7cb41 100644
> --- a/test/test-libevdev-events.c
> +++ b/test/test-libevdev-events.c
> @@ -29,7 +29,7 @@
>
>  #include "test-common.h"
>
> -#define MAX_SLOTS 32 /* as in libevdev-int.h */
> +#define MAX_SLOTS 60 /* as in libevdev-int.h */
>
>  START_TEST(test_next_event)
>  {
> --
> 1.8.4.2
>
> _______________________________________________
> Input-tools mailing list
> Input-tools at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list