STRUCT UCSI_OPERATIONS(9)
π struct ucsi_operations(9) π
okay bestie, welcome to the Kernel API Manual page for struct ucsi_operations β UCSI I/O operations, aka the whole little vibe committee of function pointers that a UCSI driver has to fill in π
β¨ SYNOPSIS β¨
like, here's the whole struct, exactly as it is, no cap:
struct ucsi_operations {
int (*read_version)(struct ucsi *ucsi, u16 *version);
int (*read_cci)(struct ucsi *ucsi, u32 *cci);
int (*poll_cci)(struct ucsi *ucsi, u32 *cci);
int (*read_message_in)(struct ucsi *ucsi, void *val, size_t
val_len);
int (*write_message_out)(struct ucsi *ucsi, void *data, size_t
data_len);
int (*sync_control)(struct ucsi *ucsi, u64 command, u32 *cci, void
*data, size_t size, void *msg_out, size_t msg_out_size);
int (*async_control)(struct ucsi *ucsi, u64 command);
bool (*update_altmodes)(struct ucsi *ucsi, u8 recipient, struct
ucsi_altmode *orig, struct ucsi_altmode *updated);
void (*update_connector)(struct ucsi_connector *con);
void (*connector_status)(struct ucsi_connector *con);
void (*add_partner_altmodes)(struct ucsi_connector *con);
void (*remove_partner_altmodes)(struct ucsi_connector *con);
};
she's giving very much "fill in the blanks but make it USB-C" energy π¦
πΈ MEMBERS πΈ
each one of these is a member, and yes we're going through all of them, periodt:
read_versionβ reads the implemented UCSI version β¨read_cciβ reads the CCI register πpoll_cciβ reads the CCI register while polling with notifications disabled π«read_message_inβ reads message data from UCSI πwrite_message_outβ writes message data to UCSI ποΈsync_controlβ a blocking control operation, like it will literally sit there and wait πasync_controlβ a non-blocking control operation, main character energy, no waiting around πupdate_altmodesβ squashes duplicate DP altmodes π«Άupdate_connectorβ updates connector capabilities before registering πconnector_statusβ updates connector status, and it's called holding the connector lock πadd_partner_altmodesβ starts mode selection βremove_partner_altmodesβ cleans up mode selection π§
π DESCRIPTION π
so these are the read and write routines for the UCSI interface β the little I/O plumbing crew π
bestie, listen, this part is important:sync_writemust wait for the Command Completion Event from the PPM before returning, andasync_writemust return immediately after sending the data to the PPM. no cap, that's the rule π€
π₯ SEE ALSO π₯
- Kernel file
./drivers/usb/typec/ucsi/ucsi.h ucsi_bitfield_read(9)
that's the whole page, you ate that π β¨ go forth and implement your ops, iykyk π¦
signing off from ./drivers/usb/typec/ucsi β date on the tin says October 2026, so yeah, future vibes only π
π¦ 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