STRUCT TYPEC_OPERATIONS(9)
π NAME π
struct typec_operations β USB Type-C Port Operations (yes bestie, it's the Kernel API Manual, we're in the big leagues now π)
β¨ SYNOPSIS β¨
Okay so here's the whole squad, laid out exactly as the kernel gods wrote it:
struct typec_operations {
int (*try_role)(struct typec_port *port, int role);
int (*dr_set)(struct typec_port *port, enum typec_data_role role);
int (*pr_set)(struct typec_port *port, enum typec_role role);
int (*vconn_set)(struct typec_port *port, enum typec_role role);
int (*port_type_set)(struct typec_port *port, enum typec_port_type
type);
struct usb_power_delivery **(*pd_get)(struct typec_port *port);
int (*pd_set)(struct typec_port *port, struct usb_power_delivery
*pd);
int (*default_usb_mode_set)(struct typec_port *port, enum usb_mode
mode);
int (*enter_usb_mode)(struct typec_port *port, enum usb_mode mode);
};
π«Ά Members π«Ά
Let me introduce you to every single one of these function pointers, no skips, no cap:
try_roleβ sets the data role preference for a DRP port. It's giving "what do you wanna be when you grow up" energy πdr_setβ Set Data Role. Literally just tells the port which data role it's on.pr_setβ Set Power Role. Same vibe, but for power. β‘vconn_setβ Source VCONN. Yeah, it's the VCONN sourcing hook.port_type_setβ Set port type. Slay, define yourself. π¦pd_getβ Get available USB Power Delivery Capabilities. It returns astruct usb_power_delivery **, iconic pointer-to-pointer behaviour fr fr.pd_setβ Set USB Power Delivery Capabilities. Takes astruct usb_power_delivery *pdand just... sets it. Obsessed with the simplicity. πdefault_usb_mode_setβ USB Mode to be used by default withEnter_USBMessage. The main character default vibe. πenter_usb_modeβ Change the active USB Mode. Not the default, the active one β important distinction bestie. π₯
π SEE ALSO π
- Kernel file
./include/linux/usb/typec.h struct typec_connector(9)
And that's the page, bestie! π Source lives at ./include/linux/usb, dated October 2026, and the whole thing is titled struct typec_operations(9). Go forth and Type-C responsibly π§β¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms