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

相关推荐
呱呱巨基19 分钟前
C/C++ 内存管理
c++·笔记·学习
半桔21 分钟前
【网络编程】TCP 服务器并发编程:多进程、线程池与守护进程实践
linux·服务器·网络·c++·tcp/ip
橘子131 小时前
C++实战:搜索引擎项目(二)
开发语言·c++·搜索引擎
用户2018792831671 小时前
AMS和app通信的小秘密
android
用户2018792831671 小时前
ThreadPoolExecutor之市场雇工的故事
android
诺诺Okami1 小时前
Android Framework-Launcher-InvariantDeviceProfile
android
应用市场1 小时前
Qt C++ 图形绘制完全指南:从基础到进阶实战
开发语言·c++·qt
青草地溪水旁2 小时前
设计模式(C++)详解—单例模式(2)
c++·单例模式
bkspiderx2 小时前
C++时区操作全版本指南(含C++03/C++11-17/C++20)
linux·开发语言·c++·c++20·时区
Antonio9152 小时前
【音视频】Android NDK 与.so库适配
android·音视频