PM8953 typec 驱动研究

备注:本文主要参考高通文档,有些也看不懂,以后慢慢研究

1、USB Type-C supports the following features on PM8953 chip:

USB Type-C Specification 1.1 for CC detection

Mode Configuration configured as a Downstream Facing Port (DFP) 

Upstream Facing Port (UFP) or a Dual Role Port (DRP)                

Host Only – DFP (Source)            //DFP应该是指主模式

Device Only – UFP (Sink)            //UFP应该是从模式

Dual Role Port – DRP

Channel Configuration (CC)

USB Port Attachment Detection

Cable Orientation Detection

Role Detection

Current Detection (Default, Medium, High)

Type-C Current Mode advertisement

VBUS Detection                                               //此处应该是VBUS电源检测

VCONN Support for Active Cables

2、引脚作用

(1)CC

用于typec正反检测,电流能力检测,以及BMC通信

(2)VCCON

VCONNis 5 V, 210mA rated power provided to USB type-C powered cables.This is generated from VBUS(USBIN) and aninternal MUX connects it to either CC1 or CC2 based on the cable insertion direction.

3、Type-C driver is present in drivers/power/qpnp-typec.c

This driver interacts with qpnp-smbcharger.c with type-c power supply nodePower supply properties:

POWER_SUPPLY_PROP_TYPE – Lets the charger driver know whether the device is in the DFP or the UFP state.

POWER_SUPPLY_PROP_CURRENT_CAPABILITY – Lets the charger driver know about the current capability of the attached DFP.

Type-C Interrupt Handlers

vrd_changed_handler – This interrupt is triggered when the current capability of the DFP changes between 500 mA,1.5 A, and 3 A. Notifies battery power supply, so that charger driver can take appropriate action.

vconn_oc_handler – Over current limit exceeded on VCONN for reasons like bad cable.

ufp_detect_handler – Device has entered UFP state, notifies Type-C state and current capability to battery power supply. Also, notifies USB SS switch to convey the cable orientation through MSM GPIO 139.

ufp_detach_handler – Device has exited UFP state due to cable removal. Notifies Type-C state and zero current capability to battery power supply. Also, notifies USB SS switch to convey the cable removal through MSM GPIO 139.

dfp_detect_handler – Device has entered DFP state, notifies Type-C state and zero current capability to battery power supply. Also, notifies USB SS switch to convey the cable orientation through MSM GPIO 139.

dfp_detach_handler - Device has exited DFP state due to cable removal. Notifies Type-C state and zero current capability to battery power supply. Also, notifies USB SS switch to convey the cable removal through MSM GPIO 139.

vbus_err_handler – VBUS not detected, initiates detach.

发布了25 篇原创文章 · 获赞 0 · 访问量 1009

猜你喜欢

转载自blog.csdn.net/jlgcumt/article/details/103817356