From aa5497c4a6d732365f99f5363fbb84518da1c3ca Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Sun, 18 Feb 2024 17:39:58 +0100
Subject: [PATCH 314/463] arm64: dts: sun50i-a64-pinetab: Add accelerometer

Add accelerometer. Patch picked up from here:

https://github.com/dreemurrs-embedded/Pine64-Arch/blob/master/PKGBUILDS/pine64/linux-megi/pinetab-accelerometer.patch

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
index b7ab7d28914e8..8c91ed7083d7f 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts
@@ -237,7 +237,15 @@ &i2c0_pins {
 &i2c1 {
 	status = "okay";
 
-	/* TODO: add Bochs BMA223 accelerometer here */
+	bma223@18 {
+		compatible = "bosch,bma223", "bosch,bma222e";
+		reg = <0x18>;
+		interrupt-parent = <&pio>;
+		interrupts = <7 5 IRQ_TYPE_LEVEL_HIGH>; /* PH5 */
+		mount-matrix = "0", "-1", "0",
+			       "-1", "0", "0",
+			       "0", "0", "-1";
+	};
 };
 
 &lradc {
-- 
2.46.0

