Re: [PATCH v2] HID: magicmouse: add haptic click configuration for Magic Trackpad 2

From: Jiri Kosina

Date: Wed Jun 10 2026 - 12:44:35 EST


On Thu, 14 May 2026, Christian Fressl wrote:

> Apple Magic Trackpad 2 devices support persistent haptic feedback
> configuration through feature reports 0x22 and 0x23. Add an opt-in
> module parameter to select either the verified silent-low profile or to
> disable haptic feedback.
>
> The default remains unchanged. The report payload format is
> reverse-engineered, so keep the existing payload bytes fixed and vary
> only the known 24-bit feedback value.
>
> The USB-C Trackpad exposes multiple HID interfaces. Use the one-shot
> actuator output report 0x53 only to identify the interface that accepts
> the persistent configuration reports; do not use it for the persistent
> setting itself.
>
> Tested on Apple Magic Trackpad USB-C 05ac:0324 with Ubuntu
> 6.17.0-23-generic. Compile-tested against HID for-next.
>
> Protocol information was derived from public reverse-engineering notes,
> then independently tested with local hardware.
>
> Link: https://github.com/mwyborski/Linux-Magic-Trackpad-2-Driver/issues/28#issuecomment-451625504
> Signed-off-by: Christian Fressl <christian@xxxxxxxxx>
> ---
> Changes in v2:
> - Cache haptic_click with READ_ONCE() before applying the setting.
[ ... snip ... ]
> +static int magicmouse_apply_haptic_click(struct hid_device *hdev)
> +{
> + unsigned int click = READ_ONCE(haptic_click);

Can you please elaborate on why the READ_ONCE() is needed specifically
here? I don't get it.

Thanks,

--
Jiri Kosina
SUSE Labs