hwdb: Apply existing accel orientation quirk to all Chromebooks#24276
hwdb: Apply existing accel orientation quirk to all Chromebooks#24276yuwata merged 1 commit intosystemd:mainfrom
Conversation
|
Thank you, @alpernebbi! This PR will ensure Gnome Desktop Environment and other iio-sensor-proxy dependent software will work correctly out-of-the-box on Chromebooks. |
I can confirm this is the correct transform matrix for all chromebooks and that this matrix is also consistent across chromebooks. See W3C and Android docs for more details on this. Note: the one nautilus board before this patch was probably wrong, it should have been the same as the rest.
@gwendalcr might be into this patch, he's the person that taught me all about sensors for chromebooks. |
|
lgtm, but could you add a comment to the entry explaining why such a broad match makes sense here (i.e. say what you wrote above there in terse words) |
The cros-ec-accel and cros-ec-accel-legacy kernel modules internally correct for the board-specific accelerometer mounting orientations. Their sensor outputs are in a standard reference frame consistent across different boards, so the orientation matrix already added for a number of devices should apply to every device using cros-ec accelerometers. The different matrix for the 'Nocturne' board seems to be an error. Replace the existing hwdb rules for select Chromebooks with generic rules that apply to all Chromebooks.
bb41faa to
42fe124
Compare
|
Rebased and added this comment, hope it's good enough: +# CrOS EC & kernel drivers internally correct for per-board sensor orientations,
+# but they return values in the inverse direction (Android & W3C specs vs HID). |
|
The patch is correct for the lid accel (label:accel-display) (the one that matters for rotation). For the base accelerometer, the mount matrix is I don't know how to reference the iio |
I see this is the case with
I might be wrong, but it looks like what we can match in systemd/rules.d/60-sensor.rules Lines 5 to 8 in b1358f0 And maybe we can add the But I don't know what happens when it finds no value for other devices. I'm assuming adding an extra |
|
I got something that works, but not sure what's the best rule here. This one also works, without the hwdb entries: |
|
I do not have affected laptops, so I cannot follow the discussions. But feel free to open any follow-up PRs. Thank you. |
|
Filed #24353 as a follow-up. |
The cros-ec-accel and cros-ec-accel-legacy kernel modules internally correct for the board-specific accelerometer mounting orientations. Their sensor outputs are in a standard reference frame consistent across different boards, so the orientation matrix already added for a number of devices should apply to every device using cros-ec accelerometers. The different matrix for the 'Nocturne' board seems to be an error.
This replaces the existing hwdb rules for select Chromebooks with generic rules that apply to all Chromebooks.
Also see #24232. I only tested the first fragment in
/etc/udev/hwdb.d, and only on one the board that I have.