[RK3588-Android12] 关于如何取消usb-phy的充电检测

问题描述

RK3588如何取消usb-phy的充电检测


解决方案:

打上如下补丁

c 复制代码
diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index bbdcf3f..21ef614 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -1040,6 +1040,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
 			return;
 		} else if (rport->vbus_attached) {
 			dev_dbg(&rport->phy->dev, "vbus_attach\n");
+#if 0
 			switch (rphy->chg_state) {
 			case USB_CHG_STATE_UNDEFINED:
 				mutex_unlock(&rport->mutex);
@@ -1081,6 +1082,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
 			default:
 				break;
 			}
+#endif
 		} else {
 			rphy->chg_state = USB_CHG_STATE_UNDEFINED;
 			rphy->chg_type = POWER_SUPPLY_TYPE_UNKNOWN;
@@ -1158,7 +1160,7 @@ static void rockchip_usb2phy_otg_sm_work(struct work_struct *work)
 
 	mutex_unlock(&rport->mutex);
 }
-
+#if 0
 static const char *chg_to_string(enum power_supply_type chg_type)
 {
 	switch (chg_type) {
@@ -1320,6 +1322,7 @@ static void rockchip_chg_detect_work(struct work_struct *work)
 	 */
 	schedule_delayed_work(&rport->chg_work, delay);
 }
+#endif
 
 /*
  * The function manage host-phy port state and suspend/resume phy port
@@ -1803,7 +1806,7 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
 	wake_lock_init(&rport->wakelock, WAKE_LOCK_SUSPEND, "rockchip_otg");
 	INIT_DELAYED_WORK(&rport->bypass_uart_work,
 			  rockchip_usb_bypass_uart_work);
-	INIT_DELAYED_WORK(&rport->chg_work, rockchip_chg_detect_work);
+//	INIT_DELAYED_WORK(&rport->chg_work, rockchip_chg_detect_work);
 	INIT_DELAYED_WORK(&rport->otg_sm_work, rockchip_usb2phy_otg_sm_work);
 
 	if (!IS_ERR(rphy->edev)) {

相关推荐
Zender Han7 小时前
Flutter 中 AbsorbPointer 与 IgnorePointer 的区别与使用场景详解
android·flutter·ios
Bruce_kaizy7 小时前
c++图论————最短路之Floyd&Dijkstra算法
c++·算法·图论
Just_Paranoid7 小时前
【Settings】Android 常见外设检测机制
android·sd·usb·camera·keyboard·sim
WBluuue7 小时前
AtCoder Beginner Contest 437(ABCDEF)
c++·算法
郝学胜-神的一滴7 小时前
Linux 下循环创建多线程:深入解析与实践指南
linux·服务器·c++·程序人生·算法·设计模式
_李小白7 小时前
【Android FrameWork】延伸阅读:ptrace机制
android
superman超哥7 小时前
仓颉语言中异常处理入门的深度剖析与工程实践
c语言·开发语言·c++·python·仓颉
光芒Shine7 小时前
【Android-开发指南】
android
哈龙_998 小时前
Android 文件下载库ketch示例
android