Skip to content

Add haptic-control functionality to Apple M2's MTP touchpad - #573

Open
Ambioid wants to merge 1 commit into
AsahiLinux:asahifrom
Ambioid:asahi-haptic-touchpad
Open

Add haptic-control functionality to Apple M2's MTP touchpad#573
Ambioid wants to merge 1 commit into
AsahiLinux:asahifrom
Ambioid:asahi-haptic-touchpad

Conversation

@Ambioid

@Ambioid Ambioid commented Aug 20, 2026

Copy link
Copy Markdown

This merge request adds a new driver into the kernel to allow for the userspace to custom control the haptic effects of the apple MTP trackpad and follows the convention for haptic touchpad functionality as specified in [1].

Set the INPUT_PROP_PRESSUREPAD property within the MTP trackpad device indicating that this device is a haptic touchpad, and set the FF_HAPTIC capability to indicate that force feedback haptic effects can be uploaded to the trackpad [2]. Userspace can thus choose to upload force feedback effects to the touchpad, which would trigger it to switch into "Host controlled" mode, where the touchpad will no longer click unless signalled to do so by userspace.

This patch uses an unconventional means of doing so, by writing a separate loadable module for the haptic actuator. This is because the haptic actuator is considered a separate device on MTP trackpads, whereas haptics for HUTRR63 (And the other kernel drivers) considers the haptic actuator and the touchpad to be the very same device. Therefore, to conform to the standardized interface in [1] this patch creates a separate driver for the separate HID device, and is designed such that commands to the actuator are sent through the touchpad.

This changeset is relevant because allowing userspace control of the haptics allows for user control of:
1. Click feedback intensity
2. Sensitivity of when clicks trigger
3. Configuring "Force Touch"-like deep click functionality

The specific hardware commands and their fields have been reverse engineered on my own machine (Macbook Pro 2023 M2 Max) using the m1n1 hypervisor. The changes have not been tested on any other machine.

[1] https://lore.kernel.org/all/20250818-support-forcepads-v3-0-e4f9ab0add84@google.com/T/#m12f9be6691015fb9b2e834248c368e5f90
[2] https://docs.kernel.org/input/event-codes.html#input-prop-pressurepad

@Ambioid
Ambioid force-pushed the asahi-haptic-touchpad branch from fc9e273 to 87b7a9a Compare August 20, 2026 14:44
Following the convention for haptic touchpad functionality as specified
in [1]:

Set the INPUT_PROP_PRESSUREPAD property within the MTP trackpad device
indicating that this device is a haptic touchpad, and set the FF_HAPTIC
capability to indicate that force feedback haptic effects can be
uploaded to the trackpad [2]. Userspace can thus choose to upload force
feedback effects to the touchpad, which would trigger it to switch into
"Host controlled" mode, where the touchpad will no longer click unless
signalled to do so by userspace.

This patch uses an unconventional means of doing so, by writing a
separate loadable module for the haptic actuator. This is because
the haptic actuator is considered a separate device on MTP trackpads,
whereas haptics for HUTRR63 (And the other kernel drivers) considers the
haptic actuator and the touchpad to be the very same device. Therefore,
to conform to the standardized interface in [1] this patch creates a
separate driver for the separate HID device, and is designed such that
commands to the actuator are sent through the touchpad.

This changeset is relevant because allowing userspace control of the
haptics allows for user control of:
    1. Click feedback intensity
    2. Sensitivity of when clicks trigger
    3. Configuring "Force Touch"-like deep click functionality

The specific hardware commands and their fields have been reverse
engineered on my own machine (Macbook Pro 2023 M2 Max) using the m1n1
hypervisor.

[1] https://lore.kernel.org/all/20250818-support-forcepads-v3-0-e4f9ab0add84@google.com/T/#m12f9be6691015fb9b2e834248c368e5f90
[2] https://docs.kernel.org/input/event-codes.html#input-prop-pressurepad

Signed-off-by: Yicong Hui <yicong@ycstuff.net>
@Ambioid
Ambioid force-pushed the asahi-haptic-touchpad branch from 87b7a9a to 3e34e34 Compare August 20, 2026 14:48
@Ambioid

Ambioid commented Aug 20, 2026

Copy link
Copy Markdown
Author

See https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1508 for an example of a userspace program that uses this functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant