当前位置:网站首页>usb peripheral 驱动 - cable connect/disconnect
usb peripheral 驱动 - cable connect/disconnect
2022-07-01 11:55:00 【对我好两点】
PD 在 APPS: PD ==> dwc3
PD 在 ADSP: PD ==> ucsi ==> dwc3
1. usb cable disconnect
代码流程:
== dwc3_msm_vbus_notifier();
queue_work(mdwc->dwc3_wq, &mdwc->resume_work);
== dwc3_resume_work();
== dwc3_ext_event_notify();
queue_delayed_work(mdwc->sm_usb_wq, &mdwc->sm_work, 0);
== dwc3_otg_sm_work();
== dwc3_otg_start_peripheral(mdwc, 0); // case DRD_STATE_PERIPHERA
== usb_gadget_vbus_disconnect(&dwc->gadget);
== dwc3_gadget_vbus_session();
== dwc3_gadget_run_stop(dwc, 0, false);
== dwc3_gadget_disable_irq(dwc);
== __dwc3_gadget_ep_disable();
== dwc3_stop_active_transfers(dwc);
== usb_phy_notify_disconnect();
== dwc3_usb3_phy_suspend();
== pm_runtime_put_sync_suspend(mdwc->dev);
== dwc3_msm_runtime_suspend();
== dwc3_msm_suspend();
queue_delayed_work(mdwc->sm_usb_wq, &mdwc->sm_work, 0);
== dwc3_otg_sm_work();
== dwc3_msm_gadget_vbus_draw(mdwc, 0); // case DRD_STATE_IDLE
ipc log:
console:/ #cat /sys/kernel/debug/ipc_logging/a600000.dwc3/log
[ 405.795877897 ] FF extcon idx 0 ? // extcon ctrl
[ 405.797294095 ] FF peripheral 0 ? // usb 拔出前的模式
[ 405.797326074 ] FF StrtGdgt gsync 2 ? // dwc3_otg_start_peripheral
[ 405.797381647 ] FF VbusSess 0 ?
[ 405.797398522 ] FF run_stop 0 ?
[ 405.797404512 ] FF MaskINT 0 ?
[ 405.797414199 ] dwc3_remove_requests: START for ep0out(0)
[ 405.797418209 ] dwc3_remove_requests: DONE for ep0out(0)
[ 405.797630553 ] dwc3_stop_active_transfers: DONE
[ 405.797636334 ] dwc3_gadget_run_stop: remaining EVNTCOUNT(0)=16
[ 405.797654720 ] dwc3_msm_notify_event: remaining EVNTCOUNT(1)=0
[ 405.797669928 ] FF DISCONNECT INT 0 ? // dwc3_gadget_disconnect_interrupt
[ 405.797689147 ] FF DISCONNECT 0 ?
[ 405.798761647 ] FF StopGdgt psync 1 ? // dwc3_otg_start_peripheral
[ 405.798788730 ] FF RT Sus 0 ? // dwc3_msm_runtime_suspend
[ 405.799793730 ] FF bus_vote_start 0 ?
[ 405.803440605 ] FF bus_vote_end 0 ?
[ 405.803487116 ] FF Ctl Sus 1 ? // dwc3_msm_suspend
[ 405.803566126 ] FF !BSV psync 0 ?
[ 405.803687480 ] FF idle 0 ?
[ 407.924288164 ] FF PM Sus 0 ? // dwc3_msm_pm_suspend 系统休眠调用
dmesg log:
console:/ # dmesg -c
[ 405.795638] usbpd usbpd0: USB Type-C disconnect // usb/pd/policy_engine 通知
[ 405.795898] msm-dwc3 a600000.ssusb: vbus:0 event received // dwc3_msm_vbus_notifier(vbus event表示作为peripheral)
[ 405.797144] msm-dwc3 a600000.ssusb: dwc3_resume_work: dwc3 resume work
[ 405.797167] msm-dwc3 a600000.ssusb: XCVR: ID set
[ 405.797178] msm-dwc3 a600000.ssusb: XCVR: BSV clear
[ 405.797188] msm-dwc3 a600000.ssusb: XCVR: SUSP clear
[ 405.797285] msm-dwc3 a600000.ssusb: peripheral state
[ 405.797308] msm-dwc3 a600000.ssusb: !id || !bsv
[ 405.797336] msm-dwc3 a600000.ssusb: dwc3_otg_start_peripheral: turn off gadget dwc3-gadget
[ 405.797646] msm-dwc3 a600000.ssusb: DWC3_GSI_EVT_BUF_CLEAR
[ 405.797662] msm-dwc3 a600000.ssusb: msm_dwc3_pwr_irq received
[ 405.797672] msm-dwc3 a600000.ssusb: dwc3_pwr_event_handler irq_stat=28000C
[ 405.797677] msm-dwc3 a600000.ssusb: DWC3_CONTROLLER_NOTIFY_OTG_EVENT received
[ 405.797680] msm-dwc3 a600000.ssusb: dwc3_pwr_event_handler link state = 0x0004
[ 405.797686] msm-dwc3 a600000.ssusb: dwc3_pwr_event_handler: unexpected PWR_EVNT, irq_stat=280000
[ 405.797748] diag: USB channel diag: Received Disconnect event
[ 405.798498] android_work: sent uevent USB_STATE=DISCONNECTED
[ 405.798782] msm-dwc3 a600000.ssusb: DWC3-msm runtime suspend // dwc3_msm_runtime_suspend
[ 405.799543] msm-dwc3 a600000.ssusb: dwc3_msm_suspend: power collapse
[ 405.799787] msm-dwc3 a600000.ssusb: IOMMU detached
[ 405.803477] msm-dwc3 a600000.ssusb: DWC3 in low power mode
[ 405.803594] msm-dwc3 a600000.ssusb: idle state
[ 405.803701] msm-dwc3 a600000.ssusb: Cable disconnected
边栏推荐
- 微信小程序开发 – 用户授权登陆「建议收藏」
- The Missing Semester
- Kernel synchronization mechanism
- Vscode shortcut key (the most complete) [easy to understand]
- 超详细黑苹果安装图文教程送EFI配置合集及系统
- Istio、eBPF 和 RSocket Broker:深入研究服务网格
- Understanding of MVVM and MVC
- Ultra detailed black apple installation graphic tutorial sent to EFI configuration collection and system
- Value/set in redis
- Value/string in redis
猜你喜欢

谈思生物直播—GENOVIS张洪妍抗体特异性酶切技术助力抗体药物结构表征

Dlhsoft Kanban, Kanban component of WPF

Prepare for the Blue Bridge Cup Day10__ PWM control light brightness

二叉堆(一) - 原理与C实现

The Missing Semester

Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)

Mechanism and type of CPU context switch

Botu V15 add GSD file

Harbor webhook from principle to construction

2022/6/28学习总结
随机推荐
IPlImage的width和widthStep
Value/sortedset in redis
Value/string in redis
Impressive bug summary (continuously updated)
VScode快捷键(最全)[通俗易懂]
The developer said, "this doesn't need to be tested, just return to the normal process". What about the testers?
JS date format conversion method
陈珙:微服务,它还那么纯粹吗?
Can solo be accessed through IPv6?
Redis启动与库进入
C knowledge point form summary 2
Golang introduces the implementation method of the corresponding configuration file according to the parameters
耐克如何常年霸榜第一名?最新财报答案来了
耐克如何常年霸榜第一名?最新財報答案來了
S7-1500PLC仿真
TMUX usage
GID:旷视提出全方位的检测模型知识蒸馏 | CVPR 2021
对于mvvm和mvc的理解
Learning summary on June 30, 2022
[classic example] classic list questions @ list