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

相关推荐
低调小一几秒前
Kuikly 小白拆解系列 · 第1篇|两棵树直调(Kotlin 构建与原生承载)
android·开发语言·kotlin
郝学胜-神的一滴5 分钟前
Linux下的阻塞与非阻塞模式详解
linux·服务器·开发语言·c++·程序人生·软件工程
跟着珅聪学java16 分钟前
spring boot 整合 activiti 教程
android·java·spring
川石课堂软件测试2 小时前
全链路Controller压测负载均衡
android·运维·开发语言·python·mysql·adb·负载均衡
2501_915921432 小时前
iOS 26 电耗监测与优化,耗电问题实战 + 多工具 辅助策略
android·macos·ios·小程序·uni-app·cocoa·iphone
2501_915921432 小时前
苹果软件混淆与 iOS 应用加固白皮书,IPA 文件加密、反编译防护与无源码混淆方案全解析
android·ios·小程序·https·uni-app·iphone·webview
Samsong2 小时前
《C++ Primer Plus》读书笔记 第二章 开始学习C++
c++·后端
Rubisco..3 小时前
牛客周赛 Round 111
数据结构·c++·算法
hz_zhangrl3 小时前
CCF-GESP 等级考试 2025年9月认证C++四级真题解析
开发语言·c++·算法·程序设计·gesp·c++四级·gesp2025年9月
倔强的石头1063 小时前
【Linux指南】Linux命令行进度条实现原理解析
android·linux