[PATCH libinput] touchpad: enable clickfinger by default on chromebooks

Hans de Goede hdegoede at redhat.com
Mon May 4 00:12:20 PDT 2015


Hi,

On 04-05-15 04:11, Peter Hutterer wrote:
> This matches the vendor default.
>
> Board IDs pulled from modinfo chromeos_laptop, touchpad names from a bit of
> googling around.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> Tested-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>

LGTM: Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans

> ---
>   src/evdev-mt-touchpad-buttons.c    |  5 ++++-
>   src/evdev.c                        |  1 +
>   src/evdev.h                        |  1 +
>   udev/90-libinput-model-quirks.hwdb | 22 ++++++++++++++++++++++
>   4 files changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
> index 7f60a53..608befe 100644
> --- a/src/evdev-mt-touchpad-buttons.c
> +++ b/src/evdev-mt-touchpad-buttons.c
> @@ -646,9 +646,12 @@ tp_button_config_click_get_method(struct libinput_device *device)
>   static enum libinput_config_click_method
>   tp_click_get_default_method(struct tp_dispatch *tp)
>   {
> +	struct evdev_device *device = tp->device;
> +
>   	if (!tp->buttons.is_clickpad)
>   		return LIBINPUT_CONFIG_CLICK_METHOD_NONE;
> -	else if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE)
> +	else if (libevdev_get_id_vendor(tp->device->evdev) == VENDOR_ID_APPLE ||
> +		device->model == EVDEV_MODEL_CHROMEBOOK)
>   		return LIBINPUT_CONFIG_CLICK_METHOD_CLICKFINGER;
>   	else
>   		return LIBINPUT_CONFIG_CLICK_METHOD_BUTTON_AREAS;
> diff --git a/src/evdev.c b/src/evdev.c
> index af36127..ee8dfe6 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -1447,6 +1447,7 @@ evdev_read_model(struct evdev_device *device)
>   		enum evdev_device_model model;
>   	} model_map[] = {
>   		{ "LIBINPUT_MODEL_LENOVO_X230", EVDEV_MODEL_LENOVO_X230 },
> +		{ "LIBINPUT_MODEL_CHROMEBOOK", EVDEV_MODEL_CHROMEBOOK },
>   		{ NULL, EVDEV_MODEL_DEFAULT },
>   	};
>   	const struct model_map *m = model_map;
> diff --git a/src/evdev.h b/src/evdev.h
> index 151d103..2529c19 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -96,6 +96,7 @@ enum evdev_middlebutton_event {
>   enum evdev_device_model {
>   	EVDEV_MODEL_DEFAULT,
>   	EVDEV_MODEL_LENOVO_X230,
> +	EVDEV_MODEL_CHROMEBOOK,
>   };
>
>   struct mt_slot {
> diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb
> index 959be0f..d6a7c91 100644
> --- a/udev/90-libinput-model-quirks.hwdb
> +++ b/udev/90-libinput-model-quirks.hwdb
> @@ -16,6 +16,28 @@
>   # Sort by brand, model
>
>   ##########################################
> +# Google
> +##########################################
> +
> +# The various chromebooks, info from modinfo chromeos_laptop, touchpad names
> +# extrapolated from the chromiumos touchad-tests repo
> +# https://chromium.googlesource.com/chromiumos/platform/touchpad-tests
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*pnFalco:pvr*
> +libinput:name:SynPS/2 Synaptics TouchPad:dmi:*pn*Mario*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*pn*Butterfly*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*pn*Peppy*:
> +libinput:name:SynPS/2 Synaptics TouchPad:dmi:*pn*ZGB*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*pn*Parrot*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*bvn*coreboot*:pn*Leon*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*bvn*coreboot*:pn*Falco*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*bvn*coreboot*:pn*Wolf*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*svn*GOOGLE*:pn*Link*:
> +libinput:name:SynPS/2 Synaptics TouchPad:dmi:*pn*Alex*:
> +libinput:name:Cypress APA Trackpad (cyapa):dmi:*svn*SAMSUNG*:pn*Lumpy*:
> +libinput:name:Atmel maXTouch Touchpad:dmi:*svn*GOOGLE*:pn*Samus*:
> + LIBINPUT_MODEL_CHROMEBOOK=1
> +
> +##########################################
>   # LENOVO
>   ##########################################
>
>


More information about the wayland-devel mailing list