From 87c7c0d90966d729ca3d39cbfca77a39a43960eb Mon Sep 17 00:00:00 2001
From: liyujie <2352380935@qq.com>
Date: Fri, 29 Aug 2025 09:04:04 +0000
Subject: [PATCH] 解决板卡插入usb摄像头上电,打不开摄像头的问题

---
 longan/device/config/chips/a133/configs/c3/kickpi-k5c.dts |   16 +++++++++++-----
 android/device/softwinner/ceres-c3/init.device.rc         |    2 ++
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/android/device/softwinner/ceres-c3/init.device.rc b/android/device/softwinner/ceres-c3/init.device.rc
index 37a13f1..913f0e3 100644
--- a/android/device/softwinner/ceres-c3/init.device.rc
+++ b/android/device/softwinner/ceres-c3/init.device.rc
@@ -59,6 +59,8 @@
 #usb hub up
     chmod 0777 /sys/class/leds/hubrst/brightness
     write /sys/class/leds/hubrst/brightness 255
+    chmod 0777 /sys/class/leds/usb_vbus/brightness
+    write /sys/class/leds/usb_vbus/brightness 0
 
 #GPIO 66 67 input
     write /sys/class/gpio/export 66
diff --git a/longan/device/config/chips/a133/configs/c3/kickpi-k5c.dts b/longan/device/config/chips/a133/configs/c3/kickpi-k5c.dts
index e64033c..c8c2b60 100755
--- a/longan/device/config/chips/a133/configs/c3/kickpi-k5c.dts
+++ b/longan/device/config/chips/a133/configs/c3/kickpi-k5c.dts
@@ -17,15 +17,15 @@
 		standby_param = &standby_param;
 	};
 
-	reg_usb1_vbus: usb1-vbus {
+ 	reg_usb1_vbus: usb1-vbus {
 		compatible = "regulator-fixed";
-		gpio = <&r_pio PL 8 1 2 0 1>;
+		//gpio = <&r_pio PL 8 1 2 0 1>;
 		regulator-name = "usb1-vbus";
 		regulator-min-microvolt = <5000000>;
 		regulator-max-microvolt = <5000000>;
 		regulator-enable-ramp-delay = <1000>;
 		enable-active-high;
-	};
+	}; 
 
 	soc: soc@03000000 {
 
@@ -924,13 +924,13 @@
 			status = "okay";
 		};
 
-		ehci1:ehci1-controller@0x05200000 {
+ 		ehci1:ehci1-controller@0x05200000 {
 			drvvbus-supply = <&reg_usb1_vbus>;
 		};
 
 		ohci1:ohci1-controller@0x05200400 {
 			drvvbus-supply = <&reg_usb1_vbus>;
-		};
+		}; 
 
 		sdc1: sdmmc@04021000 {
                         bus-width = <4>;
@@ -1340,6 +1340,12 @@
 			pinctrl-names = "default";
 			status = "okay";
 
+			usb_vbus {
+				abel = "usb_vbus";
+				gpios = <&r_pio PL 8 1 2 0 1>;
+				linux,default_trigger = "default-on";
+			};
+
 			work-led {
 				label = "work-led";
 				gpios = <&r_pio PL 10 1 0 1 0>;

--
Gitblit v1.6.2