STRUCT I3C_MASTER_CONTROLLER_OPS(9)
π NAME π
struct i3c_master_controller_ops β the I3C master methods, aka the vibe check your controller has to pass π
β¨ SYNOPSIS β¨
okay bestie, here's the whole squad roster, copied exactly, no cap:
struct i3c_master_controller_ops {
int (*bus_init)(struct i3c_master_controller *master);
void (*bus_cleanup)(struct i3c_master_controller *master);
int (*attach_i3c_dev)(struct i3c_dev_desc *dev);
int (*reattach_i3c_dev)(struct i3c_dev_desc *dev, u8 old_dyn_addr);
void (*detach_i3c_dev)(struct i3c_dev_desc *dev);
int (*do_daa)(struct i3c_master_controller *master);
bool (*supports_ccc_cmd)(struct i3c_master_controller *master, const
struct i3c_ccc_cmd *cmd);
int (*send_ccc_cmd)(struct i3c_master_controller *master, struct
i3c_ccc_cmd *cmd);
int (*i3c_xfers)(struct i3c_dev_desc *dev, struct i3c_xfer *xfers,
int nxfers, enum i3c_xfer_mode mode);
int (*attach_i2c_dev)(struct i2c_dev_desc *dev);
void (*detach_i2c_dev)(struct i2c_dev_desc *dev);
int (*i2c_xfers)(struct i2c_dev_desc *dev, struct i2c_msg *xfers,
int nxfers);
int (*request_ibi)(struct i3c_dev_desc *dev, const struct
i3c_ibi_setup *req);
void (*free_ibi)(struct i3c_dev_desc *dev);
int (*enable_ibi)(struct i3c_dev_desc *dev);
int (*disable_ibi)(struct i3c_dev_desc *dev);
void (*recycle_ibi_slot)(struct i3c_dev_desc *dev, struct
i3c_ibi_slot *slot);
int (*enable_hotjoin)(struct i3c_master_controller *master);
int (*disable_hotjoin)(struct i3c_master_controller *master);
int (*set_speed)(struct i3c_master_controller *master, enum
i3c_open_drain_speed speed);
int (*set_dev_nack_retry)(struct i3c_master_controller *master,
unsigned int dev_nack_retry_cnt);
};
πΈ Members πΈ
buckle up, we're going through all twenty-one of these bad boys one by one π«Ά
bus_initβ the hook that's literally responsible for initializing the I3C bus. You should at least callmaster_set_infofrom in there and set the bus mode. Controller-specific init? yeah, you can absolutely drop that in here too. This method is mandatory. π₯bus_cleanupβ undoes everything you did ini3c_master_controller_ops->bus_init. This method is optional.attach_i3c_devβ called every single time an I3C device attaches to the bus. could be after a DAA, or when a device is statically declared by the FW, in which case it'll only have a static address and the dynamic address will be0. heads up: when this function gets called, device information have not been retrieved yet π. this is a great spot to attach master-controller-specific data to I3C devices. This method is optional.reattach_i3c_devβ called every time an I3C device has its addressed changed. could be because the device got powered down and lost its address, or because a device had a static address and got assigned a dynamic address withSETDASA. This method is optional.detach_i3c_devβ called when an I3C device detaches from the bus. usually this happens when the master device is unregistered. This method is optional.do_daaβ do a DAA (Dynamic Address Assignment) procedure. this procedure should send anENTDAACCC command and then add all devices discovered sure the DAA usingi3c_master_add_i3c_dev_locked. devices added withi3c_master_add_i3c_dev_lockedwill then be attached or re-attached to the controller. This method is mandatory. πsupports_ccc_cmdβ should returntrueif the CCC command is supported,falseotherwise. This method is optional β if you don't provide it, the core just assumes all CCC commands are supported. optimistic queen β¨send_ccc_cmdβ send a CCC command. This method is mandatory.i3c_xfersβ do one or several I3C SDR or HDR transfers. This method is mandatory.attach_i2c_devβ called every time an I2C device attaches to the bus. great place to attach master-controller-specific data to I2C devices. This method is optional.detach_i2c_devβ called when an I2C device detaches from the bus. usually happens when the master device is unregistered. This method is optional.i2c_xfersβ do one or several I2C transfers. β οΈ note that, unlike i3c transfers, the core does not guarantee that buffers attached to the transfers are DMA-safe. if drivers want DMA-safe buffers, they should use thei2c_get_dma_safe_msg_bufandi2c_put_dma_safe_msg_bufhelpers provided by the I2C framework. This method is mandatory.request_ibiβ attach an IBI handler to an I3C device. this implies defining an IBI handler and the constraints of the IBI (maximum payload length and number of pre-allocated slots). some controllers support less IBI-capable devices than regular devices, so this method might return-EBUSYif there's no more space for an extra IBI registration. This method is optional.free_ibiβ free an IBI previously requested with->request_ibi. the IBI should have been disabled with->disable_irqprior to that. This method is mandatory only if->request_ibiis notNULL.enable_ibiβ enable the IBI. only valid if->request_ibihas been called prior to->enable_ibi. the controller should first enable the IBI on the controller end (for example, unmask the hardware IRQ) and then send theENECCCC command (with the IBI flag set) to the I3C device. This method is mandatory only if->request_ibiis notNULL.disable_ibiβ disable an IBI. first send theDISECCCC command with the IBI flag set, and then deactivate the hardware IRQ on the controller end. This method is mandatory only if->request_ibiis notNULL.recycle_ibi_slotβ recycle an IBI slot. called every time an IBI has been processed by its handler. the IBI slot should be put back in the IBI slot pool so the controller can re-use it for a future IBI. This method is mandatory only if->request_ibiis notNULL.enable_hotjoinβ enable hot join event detect. π¦disable_hotjoinβ disable hot join event detect. πset_speedβ adjust I3C open drain mode timing.set_dev_nack_retryβ configure device NACK retry count for the master controller.
π SEE ALSO π
Kernel file ./include/linux/i3c/master.h, plus the whole friend group:
struct i3c_i2c_dev_desc(9), struct i2c_dev_boardinfo(9), struct i2c_dev_desc(9), struct i3c_ibi_slot(9), struct i3c_device_ibi_info(9), struct i3c_dev_boardinfo(9), struct i3c_dev_desc(9), struct i3c_device(9), enum i3c_bus_mode(9), enum i3c_open_drain_speed(9), enum i3c_addr_slot_status(9), struct i3c_bus(9), struct i3c_master_controller(9), i3c_bus_for_each_i2cdev(9), i3c_bus_for_each_i3cdev(9), struct i3c_dma(9), i3c_dev_get_master_data(9), i3c_dev_set_master_data(9), i2c_dev_get_master_data(9), i2c_dev_set_master_data(9), i3c_dev_get_master(9), i2c_dev_get_master(9), i3c_master_get_bus(9)
that's the whole page bestie, go forth and init your bus π
kisses from <pink>./include/linux/i3c</pink>, dated October 2026 β struct i3c_m...ntroller_ops(9), and yes the title got truncated by the renderer, not me, that's just how it ate it π periodt π
π¦ 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