From 9327c1cd0853bdd2413792c0b0dbe7d1d41da650 Mon Sep 17 00:00:00 2001 From: Kai-Chuan Hsieh Date: Sat, 17 Oct 2020 10:47:21 +0800 Subject: Add touchpad EV_ABS ABS_MT_TOOL capability check (LP: #1899879) The firmware/labeling palm detection is general for mordern touchpad. And libinput requires ABS_MT_TOOL_TYPE event for supporting firmware/lebeling palm detection https://wayland.freedesktop.org/libinput/doc/latest/palm-detection_html#palm-tool Add a test job to check if the touchpad can report the event type. The 55 bit offset is obtained from kernel code ABS_MT_TOOL_TYPE 0x37 https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/input-event-codes.h#L857 --- units/touchpad/jobs.pxu | 30 ++++++++++++++++++++++++++++++ units/touchpad/test-plan.pxu | 1 + 2 files changed, 31 insertions(+) (limited to 'units') diff --git a/units/touchpad/jobs.pxu b/units/touchpad/jobs.pxu index 2fcdbc3..bb6f596 100644 --- a/units/touchpad/jobs.pxu +++ b/units/touchpad/jobs.pxu @@ -218,6 +218,36 @@ _siblings: [{ "id": "touchpad/continuous-move-after-suspend", "depends": "suspend/suspend_advanced touchpad/continuous-move" }] +unit: template +template-resource: device +template-filter: device.category == 'TOUCHPAD' +template-unit: job +plugin: shell +category_id: com.canonical.plainbox::touchpad +id: touchpad/palm-rejection-firmware-labeling_{product_slug} +requires: device.driver == 'hid-multitouch' +estimated_duration: 5.0 +command: + abs_caps=$(cat > 55)) + support=$((tool_type_bit & 1)) + if [ $support -eq 1 ]; then + exit 0 + else + echo "Touchapd info:" + cat