Skip to contentSkip to conversation

arm64: dts: allwinner: sun50i-a64-pinephone: Fix mpu6050 mount matrix

PATCH Applied Ondřej Jirman 2 participants 2 messages Jul 25 – Jul 28

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: allwinner: sun50i-a64-pinephone: Fix mpu6050 mount matrix

From: Ondrej Jirman <[email protected]>

The current mount matrix for mpu6050 is wrong. The mount matrix is a simple transform from the sensor coordinate space to the device coordinate space described in DT, where, looking at the screen, X points to the right, Y to the top, and Z towards the user.

The mpu6050 is mounted like this (looking at the screen from the front; the sensor is on the near side of the PCB, so its Z axis points towards the user; o marks the pin 1 corner):

           +Xs
            ^
            |
         +------+
  +Ys <--|      |
         | o    |
         +------+

so this gives:

  Xd = -Ys  [0, -1, 0]
  Yd =  Xs  [1, 0, 0]
  Zd =  Zs  [0, 0, 1]
Fixes 2496b2aaacf1 ("arm64: dts: allwinner: pinephone: Add mount matrix to accelerometer")
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +2 -2
index 4bc6c1ef2cde..f958bdbb0d33 100644
@@ -230,8 +230,8 @@ accelerometer@68 {
 		interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
 		vdd-supply = <&reg_dldo1>;
 		vddio-supply = <&reg_dldo1>;
-		mount-matrix = "0", "1", "0",
-			       "-1", "0", "0",
+		mount-matrix = "0", "-1", "0",
+			       "1", "0", "0",
 			       "0", "0", "1";
 	};
 };
Signature · 1 line
2.54.0
maintainer Applied
#1 lore raw
Quoted 10 lines · Ondřej Jirman

The current mount matrix for mpu6050 is wrong. The mount matrix is a simple transform from the sensor coordinate space to the device coordinate space described in DT, where, looking at the screen, X points to the right, Y to the top, and Z towards the user.

The mpu6050 is mounted like this (looking at the screen from the front; the sensor is on the near side of the PCB, so its Z axis points towards the user; o marks the pin 1 corner):

[...]

Applied to sunxi/dt-for-7.3 in sunxi, thanks!

[1/1] arm64: dts: allwinner: sun50i-a64-pinephone: Fix mpu6050 mount matrix

      https://git.kernel.org/sunxi/linux/c/dfc735fd93e4

Best regards,

Signature · 1 line
Chen-Yu Tsai <[email protected]>