From f14af920963d450f1d7482a7045ba4eb51069d05 Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Thu, 10 Nov 2022 20:11:10 +0100
Subject: [PATCH 189/463] arm64: dts: sun50i-a64-pinephone: Add support for
 Pinephone 1.2 beta

Beta versions uses a different magnetometer chip.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
---
 arch/arm64/boot/dts/allwinner/Makefile        |  1 +
 .../allwinner/sun50i-a64-pinephone-1.2b.dts   | 29 +++++++++++++++++++
 .../dts/allwinner/sun50i-a64-pinephone.dtsi   | 12 --------
 3 files changed, 30 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index 0db7b60b49a19..0a0ec8a392596 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -12,6 +12,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinebook.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.0.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.1.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2.dtb
+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinephone-1.2b.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pinetab-early-adopter.dtb
 dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-sopine-baseboard.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts
new file mode 100644
index 0000000000000..bb6e075972d11
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2b.dts
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
+
+/dts-v1/;
+
+#include "sun50i-a64-pinephone-1.2.dts"
+
+/ {
+	model = "Pine64 PinePhone (1.2b)";
+	compatible = "pine64,pinephone-1.2b", "pine64,pinephone", "allwinner,sun50i-a64";
+};
+
+&lis3mdl {
+	status = "disabled";
+};
+
+&i2c1 {
+	/* Alternative magnetometer */
+	af8133j: magnetometer@1c {
+		compatible = "voltafield,af8133j";
+		reg = <0x1c>;
+		reset-gpios = <&pio 1 1 GPIO_ACTIVE_LOW>;
+		avdd-supply = <&reg_dldo1>;
+		dvdd-supply = <&reg_dldo1>;
+		mount-matrix = "0", "-1", "0",
+				"-1", "0", "0",
+				"0", "0", "-1";
+	};
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
index 9585d2ad91f43..657373db86bba 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi
@@ -624,18 +624,6 @@ &i2c1 {
 	status = "okay";
 	clock-frequency = <400000>;
 
-	/* Alternative magnetometer */
-	af8133j: magnetometer@1c {
-		compatible = "voltafield,af8133j";
-		reg = <0x1c>;
-		reset-gpios = <&pio 1 1 GPIO_ACTIVE_LOW>;
-		avdd-supply = <&reg_dldo1>;
-		dvdd-supply = <&reg_dldo1>;
-		mount-matrix = "0", "-1", "0",
-				"-1", "0", "0",
-				"0", "0", "-1";
-	};
-
 	/* Magnetometer */
 	lis3mdl: magnetometer@1e {
 		compatible = "st,lis3mdl-magn";
-- 
2.46.0

