From 619f0f87159c5dbd2755b1b0a0eb35784be84e7a Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 22 Mar 2024 08:09:42 +0000
Subject: [PATCH] 增加支持hp & spk 自动切换

---
 kernel/arch/arm64/boot/dts/rockchip/NK-6A13_V0A.dtsi |   37 +++++++++++++++++++------------------
 1 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/kernel/arch/arm64/boot/dts/rockchip/NK-6A13_V0A.dtsi b/kernel/arch/arm64/boot/dts/rockchip/NK-6A13_V0A.dtsi
index 3b44759..b122855 100755
--- a/kernel/arch/arm64/boot/dts/rockchip/NK-6A13_V0A.dtsi
+++ b/kernel/arch/arm64/boot/dts/rockchip/NK-6A13_V0A.dtsi
@@ -38,10 +38,10 @@
 		io-channels = <&saradc 3>;
 		io-channel-names = "adc-detect";
 		keyup-threshold-microvolt = <1800000>;
-		pinctrl-0 = <&hp_det>;
+		pinctrl-0 = <&spk_con>;
 		pinctrl-names = "default";
-		hp-det-gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
-		spk-con-gpio = <&gpio3 RK_PC3 GPIO_ACTIVE_HIGH>;
+		//hp-det-gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
+		//spk-con-gpio = <&gpio3 RK_PC3 GPIO_ACTIVE_HIGH>;
 		play-pause-key {
 			label = "playpause";
 			linux,code = <164>;
@@ -132,9 +132,10 @@
 	};
 
 	rk_headset: rk-headset {
-		status = "disabled";
+		status = "okay";
 		compatible = "rockchip_headset";
-		headset_gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
+		headset_gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
+		spk_ctl_gpio  = <&gpio3 RK_PC3 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&hp_det>;
 		io-channels = <&saradc 3>;
@@ -389,6 +390,14 @@
 &combphy0_ps {
 	status = "okay";
 };
+
+/*
+&usbdrd_dwc3_0 {
+       dr_mode = "otg";
+       extcon = <&u2phy0>;
+       status = "okay";
+};
+*/
 
 &combphy1_ps {
 	status = "okay";
@@ -901,6 +910,10 @@
 		hp_det: hp-det {
 			rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
 		};
+		
+		spk_con: spk-con {
+			rockchip,pins = <3 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
 	};
 
 	hym8563 {
@@ -1050,12 +1063,6 @@
 	vmmc-supply = <&vcc_3v3_sd_s0>;
 };
 
-&uart9 {
-	status = "okay";
-	pinctrl-names = "default";
-	pinctrl-0 = <&uart9m0_xfer &uart9m0_ctsn>;
-};
-
 &u2phy0_otg {
 	status = "okay";
 };
@@ -1099,16 +1106,10 @@
 	status = "okay";
 };
 
-&usbdrd_dwc3_0 {
-	dr_mode = "otg";
-	extcon = <&u2phy0>;
-	status = "okay";
-};
-
 &usbdrd_dwc3_1 {
 	dr_mode = "host";
 	maximum-speed = "high-speed";
-	status = "okay";
+	status = "disabled";
 };
 
 &uart1 {

--
Gitblit v1.6.2