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.

Dependency Surface

Detected Declarations

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

Implementation Notes