mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-04-18 14:20:45 +02:00
Move apple touchpad tagging to the udev rules
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
96face60c2
commit
59984fc40d
5 changed files with 15 additions and 4 deletions
|
|
@ -1157,7 +1157,7 @@ evdev_tag_touchpad(struct evdev_device *device,
|
|||
*/
|
||||
bustype = libevdev_get_id_bustype(device->evdev);
|
||||
if (bustype == BUS_USB) {
|
||||
if (libevdev_get_id_vendor(device->evdev) == VENDOR_ID_APPLE)
|
||||
if (device->model == EVDEV_MODEL_APPLE_TOUCHPAD)
|
||||
device->tags |= EVDEV_TAG_INTERNAL_TOUCHPAD;
|
||||
} else if (bustype != BUS_BLUETOOTH)
|
||||
device->tags |= EVDEV_TAG_INTERNAL_TOUCHPAD;
|
||||
|
|
@ -1412,7 +1412,7 @@ tp_init_palmdetect(struct tp_dispatch *tp,
|
|||
* Apple touchpads are always big enough to warrant palm detection */
|
||||
if (vendor_id == VENDOR_ID_WACOM) {
|
||||
return 0;
|
||||
} else if (vendor_id != VENDOR_ID_APPLE) {
|
||||
} else if (device->model != EVDEV_MODEL_APPLE_TOUCHPAD) {
|
||||
/* We don't know how big the touchpad is */
|
||||
if (device->abs.absinfo_x->resolution == 1)
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -1513,6 +1513,7 @@ evdev_read_model(struct evdev_device *device)
|
|||
{ "LIBINPUT_MODEL_SYSTEM76_GALAGO", EVDEV_MODEL_SYSTEM76_GALAGO },
|
||||
{ "LIBINPUT_MODEL_SYSTEM76_KUDU", EVDEV_MODEL_SYSTEM76_KUDU },
|
||||
{ "LIBINPUT_MODEL_CLEVO_W740SU", EVDEV_MODEL_CLEVO_W740SU },
|
||||
{ "LIBINPUT_MODEL_APPLE_TOUCHPAD", EVDEV_MODEL_APPLE_TOUCHPAD },
|
||||
{ NULL, EVDEV_MODEL_DEFAULT },
|
||||
};
|
||||
const struct model_map *m = model_map;
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ enum evdev_device_model {
|
|||
EVDEV_MODEL_SYSTEM76_GALAGO,
|
||||
EVDEV_MODEL_SYSTEM76_KUDU,
|
||||
EVDEV_MODEL_CLEVO_W740SU,
|
||||
EVDEV_MODEL_APPLE_TOUCHPAD,
|
||||
};
|
||||
|
||||
struct mt_slot {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@
|
|||
#
|
||||
# Sort by brand, model
|
||||
|
||||
##########################################
|
||||
# Apple
|
||||
##########################################
|
||||
libinput:touchpad:input:b0003v05ACp*
|
||||
libinput:touchpad:input:b0005v05ACp*
|
||||
LIBINPUT_MODEL_APPLE_TOUCHPAD=1
|
||||
|
||||
##########################################
|
||||
# Google
|
||||
##########################################
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@ KERNEL!="event*", GOTO="libinput_model_quirks_end"
|
|||
|
||||
# hwdb matches:
|
||||
#
|
||||
# libinput:<modalias>
|
||||
IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:", \
|
||||
# libinput:touchpad:<modalias>
|
||||
ENV{ID_INPUT_TOUCHPAD}=="1", \
|
||||
IMPORT{builtin}="hwdb --subsystem=input --lookup-prefix=libinput:touchpad:", \
|
||||
GOTO="libinput_model_quirks_end"
|
||||
|
||||
# libinput:name:<name>:dmi:<dmi string>
|
||||
|
|
@ -22,4 +23,5 @@ KERNELS=="input*", \
|
|||
IMPORT{builtin}="hwdb 'libinput:name:$attr{name}:$attr{[dmi/id]modalias}'", \
|
||||
GOTO="libinput_model_quirks_end"
|
||||
|
||||
|
||||
LABEL="libinput_model_quirks_end"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue