[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)) {

相关推荐
艾莉丝努力练剑17 分钟前
hixl vs NCCL:昇腾生态通信库的独特优势分析
运维·c++·人工智能·cann
我在人间贩卖青春22 分钟前
C++之new和delete
c++·delete·new
Trouvaille ~31 分钟前
TCP Socket编程实战(三):线程池优化与TCP编程最佳实践
linux·运维·服务器·网络·c++·网络协议·tcp/ip
June`40 分钟前
高并发网络框架:Reactor模式深度解析
linux·服务器·c++
小镇敲码人1 小时前
剖析CANN框架中Samples仓库:从示例到实战的AI开发指南
c++·人工智能·python·华为·acl·cann
刘琦沛在进步1 小时前
【C / C++】引用和函数重载的介绍
c语言·开发语言·c++
我在人间贩卖青春2 小时前
C++之this指针
c++·this
云姜.2 小时前
java多态
java·开发语言·c++
李堇2 小时前
android滚动列表VerticalRollingTextView
android·java
CoderCodingNo2 小时前
【GESP】C++五级练习题 luogu-P1865 A % B Problem
开发语言·c++·算法