Skip to contentSkip to conversation

arm64: dts: rockchip: Correct Device Orientation

PATCH Applied Chris Morgan 2 participants 2 messages Aug 28 – Sep 2

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

PATCH 1/1 arm64: dts: rockchip: Correct Device Orientation

From: Chris Morgan <[email protected]>

The display, touchscreen, and IMU are currently not oriented consistently. The touchscreen is 90 degrees offset and the IMU is using the default mount matrix which is 180 degrees offset.

Fix the touchscreen alignment and add a mount matrix for the IMU. When the device is held vertically relative to the display hardware, the touchscreen 0,0 position is in the top left corner of the display (next to the home button), and the IMU reads the correct orientation.

Fixes 4e946c447a04 ("arm64: dts: rockchip: Add GameForce Ace")
---
 arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/rockchip/rk3588s-gameforce-ace.dts +5 -2
index 230aac005e8f..d43eb48152e8 100644
@@ -596,6 +596,7 @@ regulator-state-mem {
 &i2c3 {
 	status = "okay";
 
+	/* Touchscreen is rotated 90 degrees with 0,0 position near home button. */
 	touchscreen@14 {
 		compatible = "goodix,gt911";
 		reg = <0x14>;
@@ -605,10 +606,8 @@ touchscreen@14 {
 		pinctrl-0 = <&touch_int>, <&touch_rst>;
 		pinctrl-names = "default";
 		reset-gpios = <&gpio1 RK_PA7 GPIO_ACTIVE_HIGH>;
-		touchscreen-inverted-x;
 		touchscreen-size-x = <1080>;
 		touchscreen-size-y = <1920>;
-		touchscreen-swapped-x-y;
 	};
 };
 
@@ -641,11 +640,15 @@ channel@7 {
 		};
 	};
 
+	/* IMU oriented relative to panel, which is rotated 90 degrees. */
 	imu@68 {
 		compatible = "invensense,mpu6880";
 		reg = <0x68>;
 		interrupt-parent = <&gpio0>;
 		interrupts = <RK_PD3 IRQ_TYPE_EDGE_RISING>;
+		mount-matrix = "-1", "0", "0",
+			       "0", "-1", "0",
+			       "0", "0", "1";
 	};
 };
 
Signature · 1 line
2.43.0
maintainer Applied
#1 lore raw
Quoted 10 lines · Chris Morgan

The display, touchscreen, and IMU are currently not oriented consistently. The touchscreen is 90 degrees offset and the IMU is using the default mount matrix which is 180 degrees offset.

Fix the touchscreen alignment and add a mount matrix for the IMU. When the device is held vertically relative to the display hardware, the touchscreen 0,0 position is in the top left corner of the display (next to the home button), and the IMU reads the correct orientation.

[...]

Applied, thanks!

[1/1] arm64: dts: rockchip: Correct Device Orientation

      commit: 0d170ee38e7a943248082cdb4b3e40b45a96e2f6

Best regards,

Signature · 6 lines
Heiko Stuebner <[email protected]>

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip