teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0334-hwdb-Apply-existing-accel-orientation-quirk-to-all-C.patch

594167
From f06a6ff8b3dba8ba48ca5bb6ebaa04a86b4c06d6 Mon Sep 17 00:00:00 2001
594167
From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
594167
Date: Wed, 10 Aug 2022 22:09:32 +0300
594167
Subject: [PATCH] hwdb: Apply existing accel orientation quirk to all
594167
 Chromebooks
594167
594167
The cros-ec-accel and cros-ec-accel-legacy kernel modules internally
594167
correct for the board-specific accelerometer mounting orientations.
594167
Their sensor outputs are in a standard reference frame consistent across
594167
different boards, so the orientation matrix already added for a number
594167
of devices should apply to every device using cros-ec accelerometers.
594167
The different matrix for the 'Nocturne' board seems to be an error.
594167
594167
Replace the existing hwdb rules for select Chromebooks with generic
594167
rules that apply to all Chromebooks.
594167
594167
(cherry picked from commit 1800f7098a3e91a1d28697ef11a15e4b4193d21f)
594167
594167
Related: #2087778
594167
---
594167
 hwdb.d/60-sensor.hwdb | 22 ++++------------------
594167
 1 file changed, 4 insertions(+), 18 deletions(-)
594167
594167
diff --git a/hwdb.d/60-sensor.hwdb b/hwdb.d/60-sensor.hwdb
594167
index 1c3f6b62bb..7978675943 100644
594167
--- a/hwdb.d/60-sensor.hwdb
594167
+++ b/hwdb.d/60-sensor.hwdb
594167
@@ -406,27 +406,13 @@ sensor:modalias:acpi:KXCJ9000*:dmi:*:bvrZY-8-BI-PX4S70VTR400-X423B-005-D:*:rvnAM
594167
 #########################################
594167
 # Google Chromebooks
594167
 #########################################
594167
-sensor:modalias:platform:cros-ec-accel:dmi:*:svnGOOGLE:*
594167
- ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
594167
-
594167
-# caroline board (Samsung Chromebook Pro) reports itself as svnGoogle
594167
-sensor:modalias:platform:cros-ec-accel:dmi:*:svnGoogle:pnCaroline*:*
594167
- ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
594167
-
594167
-# Dell Inspiron Chromebook 14 2-in-1
594167
-sensor:modalias:platform:cros-ec-accel:dmi:*svnGoogle:pnVayne*:*
594167
- ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
594167
-
594167
-# nocturne board (Google Pixel Slate)
594167
-sensor:modalias:platform:cros-ec-accel:dmi:*Google_Nocturne*:*
594167
- ACCEL_MOUNT_MATRIX=1, 0, 0; 0, -1, 0; 0, 0, 1
594167
 
594167
-# rammus board (Asus Chromebook Flip C433)
594167
-sensor:modalias:platform:cros-ec-accel:dmi:*svnGoogle:pnRammus*:*
594167
+# CrOS EC & kernel drivers internally correct for per-board sensor orientations,
594167
+# but they return values in the inverse direction (Android & W3C specs vs HID).
594167
+sensor:modalias:platform:cros-ec-accel:*
594167
  ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
594167
 
594167
-# Lenovo ThinkPad C13 Yoga
594167
-sensor:modalias:platform:cros-ec-accel:dmi:*svnGoogle:pnMorphius*:*
594167
+sensor:modalias:platform:cros-ec-accel-legacy:*
594167
  ACCEL_MOUNT_MATRIX=-1, 0, 0; 0, -1, 0; 0, 0, -1
594167
 
594167
 #########################################