include/linux/usb/typec.h
Source file repositories/reference/linux-study-clean/include/linux/usb/typec.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/typec.h- Extension
.h- Size
- 13146 bytes
- Lines
- 417
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct typec_partnerstruct typec_cablestruct typec_plugstruct typec_portstruct typec_altmode_opsstruct typec_cable_opsstruct bus_typestruct fwnode_handlestruct devicestruct usb_power_deliverystruct usb_power_delivery_descstruct enter_usb_datastruct usb_pd_identitystruct typec_altmode_descstruct typec_plug_descstruct typec_cable_descstruct typec_partner_descstruct typec_operationsstruct typec_capabilitystruct typec_connectorenum typec_port_typeenum typec_port_dataenum typec_plug_typeenum typec_data_roleenum typec_roleenum typec_pwr_opmodeenum typec_accessoryenum typec_orientationenum usb_modeenum typec_plug_indexenum usb_pd_svdm_verfunction is_sinkfunction is_sourcefunction typec_attachfunction typec_deattach
Annotated Snippet
struct bus_type;
struct fwnode_handle;
struct device;
struct usb_power_delivery;
struct usb_power_delivery_desc;
extern const struct bus_type typec_bus;
enum typec_port_type {
TYPEC_PORT_SRC,
TYPEC_PORT_SNK,
TYPEC_PORT_DRP,
};
enum typec_port_data {
TYPEC_PORT_DFP,
TYPEC_PORT_UFP,
TYPEC_PORT_DRD,
};
enum typec_plug_type {
USB_PLUG_NONE,
USB_PLUG_TYPE_A,
USB_PLUG_TYPE_B,
USB_PLUG_TYPE_C,
USB_PLUG_CAPTIVE,
};
enum typec_data_role {
TYPEC_DEVICE,
TYPEC_HOST,
};
enum typec_role {
TYPEC_SINK,
TYPEC_SOURCE,
};
static inline int is_sink(enum typec_role role)
{
return role == TYPEC_SINK;
}
static inline int is_source(enum typec_role role)
{
return role == TYPEC_SOURCE;
}
enum typec_pwr_opmode {
TYPEC_PWR_MODE_USB,
TYPEC_PWR_MODE_1_5A,
TYPEC_PWR_MODE_3_0A,
TYPEC_PWR_MODE_PD,
};
enum typec_accessory {
TYPEC_ACCESSORY_NONE,
TYPEC_ACCESSORY_AUDIO,
TYPEC_ACCESSORY_DEBUG,
};
#define TYPEC_MAX_ACCESSORY 3
enum typec_orientation {
TYPEC_ORIENTATION_NONE,
TYPEC_ORIENTATION_NORMAL,
TYPEC_ORIENTATION_REVERSE,
};
enum usb_mode {
USB_MODE_NONE,
USB_MODE_USB2,
USB_MODE_USB3,
USB_MODE_USB4
};
#define USB_CAPABILITY_USB2 BIT(0)
#define USB_CAPABILITY_USB3 BIT(1)
#define USB_CAPABILITY_USB4 BIT(2)
/*
* struct enter_usb_data - Enter_USB Message details
* @eudo: Enter_USB Data Object
* @active_link_training: Active Cable Plug Link Training
*
* @active_link_training is a flag that should be set with uni-directional SBRX
* communication, and left 0 with passive cables and with bi-directional SBRX
* communication.
*/
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct typec_partner`, `struct typec_cable`, `struct typec_plug`, `struct typec_port`, `struct typec_altmode_ops`, `struct typec_cable_ops`, `struct bus_type`, `struct fwnode_handle`, `struct device`, `struct usb_power_delivery`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern 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.