The IMU chip on the librem5-devkit is not mounted at the "natural" place
that would match normal phone orientation (see the documentation for the
details about what that is).
Since the lsm9ds1 driver supports providing a mount matrix, we can describe
the orientation on the board in the dts:
Create a right-handed coordinate system (x * -1; see the datasheet for the
axis) and rotate 180 degrees around the y axis because the device sits on
the back side from the display.
Signed-off-by: Martin Kepplinger <[email protected]>
Reviewed-by: Marco Felsch <[email protected]>
---
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
index 4cb11ed17c24..19ca3b4f802f 100644
--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
+++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
@@ -537,6 +537,9 @@
reg = <0x6a>;
vdd-supply = <®_3v3_p>;
vddio-supply = <®_3v3_p>;
+ mount-matrix = "1", "0", "0",
+ "0", "1", "0",
+ "0", "0", "-1";
};
};
--
2.20.1