Page MenuHomeFreeBSD

bcm5974: fix wellspring9 pressure settings to handle force sensitivity
ClosedPublic

Authored by val_packett.cool on Mar 3 2022, 11:20 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 7:14 AM
Unknown Object (File)
Dec 19 2023, 11:56 PM
Unknown Object (File)
Nov 8 2023, 8:02 PM
Unknown Object (File)
Oct 15 2023, 1:35 AM
Unknown Object (File)
Oct 15 2023, 1:35 AM
Unknown Object (File)
Oct 7 2023, 7:00 PM
Unknown Object (File)
Jun 21 2023, 3:41 PM
Unknown Object (File)
May 3 2023, 8:50 PM

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/hid/bcm5974.c
338

last member (size) value should be 0 for pressure.

To adjust max member you may use compatibility events. When I slide index finger over Synaptics touchpad surface it reports ABS_PRESSURE varying between 80 and 90. I think Apple device should behave similarly. Also keep in mind that out-of-bounds values are generally allowed in evdev

sys/dev/hid/bcm5974.c
338

size being zero is the problem.

wellspring9 does not behave similarly, it is a real pressure sensitive touchpad, where pressure is actual physical force instead of a contact size based approximation.

And non-zero resolution is how this is indicated in evdev:

The kernel/udev set the pressure resolution to nonzero to indicate the value is in a known scale (units/g).

LGTM. But I would prefer to perform some measurements to properly scale pressure value. Or just drop it.

This revision is now accepted and ready to land.Mar 4 2022, 10:07 PM

As mentioned in the comment, around 3500 is what I measured for a really hard press, so I rounded up to the next power of two, that's why it's 4096.

I am talking about obeying of this rule[1]:

If the resolution is zero, the pressure data is in arbitrary units. If the resolution is non-zero, the pressure data is in units/gram. For example, a value of 10 with a resolution of 1 represents 10 gram, a value of 10 with a resolution of 1000 represents 10 microgram.

Just put some real known weight on touchpad surface to calculate real-weight to reported-pressure ratio and than apply it to input report handler. In that case .p = f->pressure, will change to .p = f->pressure * W2P_RATE,. Probably, we should use resolution higher than 1

[1] https://docs.kernel.org/input/event-codes.html