include/linux/usb/pd.h
Source file repositories/reference/linux-study-clean/include/linux/usb/pd.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/pd.h- Extension
.h- Size
- 22343 bytes
- Lines
- 728
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/kernel.hlinux/types.hlinux/usb/typec.h
Detected Declarations
struct pd_chunked_ext_message_datastruct pd_messagestruct sink_caps_ext_msgstruct usb_power_deliverystruct usb_power_delivery_descstruct usb_power_delivery_capabilities_descenum pd_ctrl_msg_typeenum pd_data_msg_typeenum pd_ext_msg_typeenum pd_pdo_typeenum pd_apdo_typefunction pd_header_cntfunction pd_header_cnt_lefunction pd_header_typefunction pd_header_type_lefunction pd_header_msgidfunction pd_header_msgid_lefunction pd_header_revfunction pd_header_rev_lefunction pd_ext_header_chunk_numfunction pd_ext_header_data_sizefunction pd_ext_header_data_size_lefunction count_chunked_data_objsfunction RDO_SPR_AVS_OUT_VOLTfunction pdo_fixed_voltagefunction pdo_fixed_currentfunction pdo_min_voltagefunction pdo_max_voltagefunction pdo_max_currentfunction pdo_max_powerfunction pdo_apdo_typefunction pdo_pps_apdo_min_voltagefunction pdo_pps_apdo_max_voltagefunction pdo_pps_apdo_max_currentfunction pdo_epr_avs_apdo_src_peak_currentfunction pdo_epr_avs_apdo_min_voltage_mvfunction pdo_epr_avs_apdo_max_voltage_mvfunction pdo_epr_avs_apdo_pdp_wfunction pdo_spr_avs_apdo_src_peak_currentfunction pdo_spr_avs_apdo_9v_to_15v_max_current_mafunction pdo_spr_avs_apdo_15v_to_20v_max_current_mafunction PDO_FIXED_OP_CURRfunction rdo_op_currentfunction rdo_max_currentfunction rdo_op_powerfunction rdo_max_power
Annotated Snippet
struct pd_chunked_ext_message_data {
__le16 header;
u8 data[PD_EXT_MAX_CHUNK_DATA];
} __packed;
/**
* struct pd_message - PD message as seen on wire
* @header: PD message header
* @payload: PD message payload
* @ext_msg: PD message chunked extended message data
*/
struct pd_message {
__le16 header;
union {
__le32 payload[PD_MAX_PAYLOAD];
struct pd_chunked_ext_message_data ext_msg;
};
} __packed;
/*
* count_chunked_data_objs - Helper to calculate number of Data Objects on a 4
* byte boundary.
* @size: Size of data block for extended message. Should *not* include extended
* header size.
*/
static inline u8 count_chunked_data_objs(u32 size)
{
size += offsetof(struct pd_chunked_ext_message_data, data);
return ((size / 4) + (size % 4 ? 1 : 0));
}
/* Sink Caps Extended Data Block Version */
#define SKEDB_VER_1_0 1
/* Sink Caps Extended Sink Modes */
#define SINK_MODE_PPS BIT(0)
#define SINK_MODE_VBUS BIT(1)
#define SINK_MODE_AC_SUPPLY BIT(2)
#define SINK_MODE_BATT BIT(3)
#define SINK_MODE_BATT_UL BIT(4) /* Unlimited battery power supply */
#define SINK_MODE_AVS BIT(5)
/**
* struct sink_caps_ext_msg - Sink extended capability PD message
* @vid: Vendor ID
* @pid: Product ID
* @xid: Value assigned by USB-IF for product
* @fw: Firmware version
* @hw: Hardware version
* @skedb_ver: Sink Caps Extended Data Block (SKEDB) Version
* @load_step: Indicates the load step slew rate.
* @load_char: Sink overload characteristics
* @compliance: Types of sources the sink has been tested & certified on
* @touch_temp: Indicates the IEC standard to which the touch temperature
* conforms to (if applicable).
* @batt_info: Indicates number batteries and hot swappable ports
* @modes: Charging caps & power sources supported
* @spr_min_pdp: Sink Minimum PDP for SPR mode
* @spr_op_pdp: Sink Operational PDP for SPR mode
* @spr_max_pdp: Sink Maximum PDP for SPR mode
* @epr_min_pdp: Sink Minimum PDP for EPR mode
* @epr_op_pdp: Sink Operational PDP for EPR mode
* @epr_max_pdp: Sink Maximum PDP for EPR mode
*/
struct sink_caps_ext_msg {
__le16 vid;
__le16 pid;
__le32 xid;
u8 fw;
u8 hw;
u8 skedb_ver;
u8 load_step;
__le16 load_char;
u8 compliance;
u8 touch_temp;
u8 batt_info;
u8 modes;
u8 spr_min_pdp;
u8 spr_op_pdp;
u8 spr_max_pdp;
u8 epr_min_pdp;
u8 epr_op_pdp;
u8 epr_max_pdp;
} __packed;
/* PDO: Power Data Object */
#define PDO_MAX_OBJECTS 7
enum pd_pdo_type {
PDO_TYPE_FIXED = 0,
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/kernel.h`, `linux/types.h`, `linux/usb/typec.h`.
- Detected declarations: `struct pd_chunked_ext_message_data`, `struct pd_message`, `struct sink_caps_ext_msg`, `struct usb_power_delivery`, `struct usb_power_delivery_desc`, `struct usb_power_delivery_capabilities_desc`, `enum pd_ctrl_msg_type`, `enum pd_data_msg_type`, `enum pd_ext_msg_type`, `enum pd_pdo_type`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.