当前位置:网站首页>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
边栏推荐
- 小米手机解BL锁教程
- Interpretation of R & D effectiveness measurement framework
- redis配置环境变量
- redis中value/hush
- On recursion and Fibonacci sequence
- Talk about biological live broadcast - genovis Zhang Hongyan antibody specific enzyme digestion technology helps to characterize the structure of antibody drugs
- Question: what professional qualities should test engineers have?
- Learning summary on June 28, 2022
- C summary of knowledge points 3
- [buuctf.reverse] 144_ [xman2018 qualifying]easyvm
猜你喜欢
Harbor webhook from principle to construction
Theoretical basis of graph
C knowledge point form summary 2
Le semester manquant
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
CAD如何設置標注小數比特
GID:旷视提出全方位的检测模型知识蒸馏 | CVPR 2021
Uniapp uses uni upgrade Center
Exploration and practice of inress in kubernetes
Redis的攻击手法
随机推荐
Kafuka learning path (I) Kafuka installation and simple use
【单片机】【数码管】数码管显示
How to understand the developed query statements
Harbor webhook from principle to construction
Compile and debug net6 source code
博途V15添加GSD文件
ES6 promise Usage Summary
Comment Cao définit la décimale de dimension
力扣首页简介动画
Xiaomi mobile phone unlocking BL tutorial
Implementation of address book management system with C language
Golang des-cbc
Extended tree (I) - concept and C implementation
Redis configuration environment variables
Mechanism and type of CPU context switch
The Missing Semester
[classic example] classic list questions @ list
activity工作流引擎
8 best practices to protect your IAC security!
Force button homepage introduction animation