From f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Wed, 31 Jan 2024 01:04:47 +0000
Subject: [PATCH] add driver 5G

---
 kernel/arch/arm/boot/dts/rk3288-evb-rk808-linux.dts |  216 ++++++++++++++++++++----------------------------------
 1 files changed, 80 insertions(+), 136 deletions(-)

diff --git a/kernel/arch/arm/boot/dts/rk3288-evb-rk808-linux.dts b/kernel/arch/arm/boot/dts/rk3288-evb-rk808-linux.dts
index f3d2262..69a5008 100644
--- a/kernel/arch/arm/boot/dts/rk3288-evb-rk808-linux.dts
+++ b/kernel/arch/arm/boot/dts/rk3288-evb-rk808-linux.dts
@@ -1,83 +1,11 @@
-/*
- * This file is dual-licensed: you can use it either under the terms
- * of the GPL or the X11 license, at your option. Note that this dual
- * licensing only applies to this file, and not this project as a
- * whole.
- *
- *  a) This file is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU General Public License as
- *     published by the Free Software Foundation; either version 2 of the
- *     License, or (at your option) any later version.
- *
- *     This file is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *     GNU General Public License for more details.
- *
- * Or, alternatively,
- *
- *  b) Permission is hereby granted, free of charge, to any person
- *     obtaining a copy of this software and associated documentation
- *     files (the "Software"), to deal in the Software without
- *     restriction, including without limitation the rights to use,
- *     copy, modify, merge, publish, distribute, sublicense, and/or
- *     sell copies of the Software, and to permit persons to whom the
- *     Software is furnished to do so, subject to the following
- *     conditions:
- *
- *     The above copyright notice and this permission notice shall be
- *     included in all copies or substantial portions of the Software.
- *
- *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
- *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- *     OTHER DEALINGS IN THE SOFTWARE.
- */
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
 
 /dts-v1/;
 #include "rk3288-evb.dtsi"
 #include "rk3288-linux.dtsi"
-#include "rk3288-rkisp1.dtsi"
 
 / {
 	compatible = "rockchip,rk3288-evb-rk808-linux", "rockchip,rk3288";
-
-	panel {
-		compatible = "simple-panel";
-		backlight = <&backlight>;
-		enable-gpios = <&gpio7 RK_PA4 GPIO_ACTIVE_HIGH>;
-		prepare-delay-ms = <120>;
-
-		display-timings {
-			native-mode = <&timing0>;
-
-			timing0: timing0 {
-				clock-frequency = <200000000>;
-				hactive = <1536>;
-				vactive = <2048>;
-				hfront-porch = <12>;
-				hsync-len = <16>;
-				hback-porch = <48>;
-				vfront-porch = <8>;
-				vsync-len = <4>;
-				vback-porch = <8>;
-				hsync-active = <0>;
-				vsync-active = <0>;
-				de-active = <0>;
-				pixelclk-active = <0>;
-			};
-		};
-
-		port {
-			panel_in_edp: endpoint {
-				remote-endpoint = <&edp_out_panel>;
-			};
-		};
-	};
 
 	adc-keys {
 		compatible = "adc-keys";
@@ -114,25 +42,6 @@
 			label = "Home";
 			linux,code = <KEY_HOME>;
 			press-threshold-microvolt = <1300000>;
-		};
-	};
-
-	gpio-keys {
-		compatible = "gpio-keys";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		autorepeat;
-
-		pinctrl-names = "default";
-		pinctrl-0 = <&pwrbtn>;
-
-		button@0 {
-			gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
-			linux,code = <116>;
-			label = "GPIO Key Power";
-			linux,input-type = <1>;
-			gpio-key,wakeup = <1>;
-			debounce-interval = <100>;
 		};
 	};
 
@@ -210,21 +119,6 @@
 	status = "okay";
 };
 
-&edp {
-	force-hpd;
-	status = "okay";
-
-	ports {
-		port@1 {
-			reg = <1>;
-
-			edp_out_panel: endpoint {
-				remote-endpoint = <&panel_in_edp>;
-			};
-		};
-	};
-};
-
 &edp_in_vopb {
 	status = "disabled";
 };
@@ -239,7 +133,15 @@
 };
 
 &hdmi {
-	pinctrl-0 = <&hdmi_ddc>, <&hdmi_cec>;
+	pinctrl-0 = <&hdmi_ddc>, <&hdmi_cec_c0>;
+};
+
+&hdmi_in_vopb {
+	status = "okay";
+};
+
+&hdmi_in_vopl {
+	status = "disabled";
 };
 
 &i2c0 {
@@ -330,7 +232,8 @@
 				regulator-max-microvolt = <3300000>;
 				regulator-name = "vcca_codec";
 				regulator-state-mem {
-					regulator-off-in-suspend;
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <3300000>;
 				};
 			};
 
@@ -350,10 +253,10 @@
 				regulator-always-on;
 				regulator-boot-on;
 				regulator-min-microvolt = <1800000>;
-				regulator-max-microvolt = <3300000>;
+				regulator-max-microvolt = <1800000>;
 				regulator-name = "vcc_wl";
 				regulator-state-mem {
-					regulator-off-in-suspend;
+					regulator-on-in-suspend;
 				};
 			};
 
@@ -364,8 +267,7 @@
 				regulator-max-microvolt = <3300000>;
 				regulator-name = "vccio_sd";
 				regulator-state-mem {
-					regulator-on-in-suspend;
-					regulator-suspend-microvolt = <3300000>;
+					regulator-off-in-suspend;
 				};
 			};
 
@@ -408,7 +310,7 @@
 				regulator-boot-on;
 				regulator-name = "vcc_sd";
 				regulator-state-mem {
-					regulator-on-in-suspend;
+					regulator-off-in-suspend;
 				};
 			};
 
@@ -463,7 +365,7 @@
 		mpu-debug = <1>;
 	};
 
-	ak8963:compass@0d{
+	ak8963: compass@d{
 		compatible = "mpu_ak8963";
 		reg = <0x0d>;
 		compass-bus = <0>;
@@ -496,29 +398,50 @@
 
 	ov13850: ov13850@10 {
 		compatible = "ovti,ov13850";
-		status = "okay";
 		reg = <0x10>;
 		clocks = <&cru SCLK_VIP_OUT>;
 		clock-names = "xvclk";
-
-		reset-gpios = <&gpio7 21 GPIO_ACTIVE_HIGH>;
-		pwdn-gpios = <&gpio2 15 GPIO_ACTIVE_HIGH>;
-
+		/* avdd-supply = <>; */
+		/* dvdd-supply = <>; */
+		/* dovdd-supply = <>; */
+		/* reset-gpios = <>; */
+		pinctrl-names = "rockchip,camera_default";
+		pinctrl-0 = <&isp_mipi>;
+		power-gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
+		reset-gpio = <&gpio7 RK_PC5 GPIO_ACTIVE_HIGH>;
+		pwdn-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
+		rockchip,camera-module-index = <0>;
+		rockchip,camera-module-facing = "back";
+		rockchip,camera-module-name = "CMK-CT0116";
+		rockchip,camera-module-lens-name = "Largan-50013A1";
 		port {
-			cam_out: endpoint {
-				remote-endpoint = <&mipi_in_cam>;
+			ov13850_out: endpoint {
+				remote-endpoint = <&mipi_in_ucam0>;
 				data-lanes = <1 2>;
 			};
 		};
 	};
-};
 
-&isp {
-	status = "okay";
-
-	port {
-		isp_mipi_in: endpoint {
-			remote-endpoint = <&dphy_rx0_out>;
+	gc8034: gc8034@37 {
+		compatible = "galaxycore,gc8034";
+		status = "okay";
+		reg = <0x37>;
+		clocks = <&cru SCLK_VIP_OUT>;
+		clock-names = "xvclk";
+		pinctrl-names = "rockchip,camera_default";
+		pinctrl-0 = <&isp_mipi>;
+		power-gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&gpio7 RK_PC5 GPIO_ACTIVE_LOW>;
+		pwdn-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_LOW>;
+		rockchip,camera-module-index = <0>;
+		rockchip,camera-module-facing = "back";
+		rockchip,camera-module-name = "LH-RK-8034-v1.0";
+		rockchip,camera-module-lens-name = "CK8401";
+		port {
+			gc8034_out: endpoint {
+				remote-endpoint = <&mipi_in_gc8034>;
+				data-lanes = <1 2 3 4>;
+			};
 		};
 	};
 };
@@ -536,20 +459,45 @@
 
 		port@0 {
 			reg = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
 
-			mipi_in_cam: endpoint {
-				remote-endpoint = <&cam_out>;
+			mipi_in_ucam0: endpoint@1 {
+				reg = <1>;
+				remote-endpoint = <&ov13850_out>;
 				data-lanes = <1 2>;
+			};
+			mipi_in_gc8034: endpoint@0 {
+				reg = <0>;
+				remote-endpoint = <&gc8034_out>;
+				data-lanes = <1 2 3 4>;
 			};
 		};
 
 		port@1 {
 			reg = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
 
-			dphy_rx0_out: endpoint {
+			dphy_rx_out: endpoint@0 {
+				reg = <0>;
 				remote-endpoint = <&isp_mipi_in>;
 			};
 		};
+	};
+};
+
+&rkisp1 {
+	status = "okay";
+	port {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		isp_mipi_in: endpoint@0 {
+			reg = <0>;
+			remote-endpoint = <&dphy_rx_out>;
+		};
+
 	};
 };
 
@@ -562,10 +510,6 @@
 };
 
 &route_hdmi {
-	status = "okay";
-};
-
-&sound {
 	status = "okay";
 };
 

--
Gitblit v1.6.2