STRUCT SDW_SLAVE(9)
π§ struct sdw_slave(9) β the SoundWire Slave, explained π
okay so this is a page out of the Kernel API Manual (the 9 section, kernel internals, iykyk) and it's literally just β¨ the struct β¨ β one struct, struct sdw_slave, and every single field in it. let's get into it bestie π«Ά
π NAME π
struct sdw_slave β SoundWire Slave. that's it. that's the whole vibe. one struct, main character energy, representing a Slave device on the SoundWire bus π
πΈ SYNOPSIS πΈ
here's the whole thing, exactly as it lives, no edits, no cap:
struct sdw_slave {
struct sdw_slave_id id;
struct device dev;
int index;
int irq;
enum sdw_slave_status status;
struct sdw_bus *bus;
struct sdw_slave_prop prop;
#ifdef CONFIG_DEBUG_FS;
struct dentry *debugfs;
#endif;
struct list_head node;
struct completion port_ready[SDW_MAX_PORTS];
unsigned int m_port_map[SDW_MAX_PORTS];
u16 dev_num;
u16 dev_num_sticky;
bool probed;
struct completion enumeration_complete;
struct completion initialization_complete;
u32 unattach_request;
bool first_interrupt_done;
bool is_mockup_device;
struct mutex sdw_dev_lock;
struct sdca_device_data sdca_data;
};
yes bestie, that #ifdef CONFIG_DEBUG_FS; is real, that's how it's written, we don't question it, we just vibe π¦
β¨ Members β¨
field-by-field, no skips, we're doing the whole roster π
idβ the MIPI device ID. the whole identity crisis of the slave in one field.devβ the Linux device π§ the actual kernel-side device object.indexβ internal ID for this slave. it's giving "we don't talk about it, it's internal."irqβ the IRQ number. interrupts, iconic.statusβ Status reported by the Slave. yes, the slave reports it, we just read the room πbusβ Bus handle. a pointer to the bus, obviously.propβ Slave properties. all the configurational lore.debugfsβ Slave debugfs. (only exists whenCONFIG_DEBUG_FSis on, per the synopsis β keep that in mind, bestie π₯)nodeβ node for bus list. linked-list plumbing, we love astruct list_head.port_readyβ Port ready completion flag for each Slave port. it's an array ofstruct completion, one per port, up toSDW_MAX_PORTS.m_port_mapβ static Master port map for each Slave port. alsoSDW_MAX_PORTSsized, alsounsigned int.dev_numβ Current Device Number, values can be0ordev_num_sticky. those are the options, periodt.dev_num_stickyβ one-time static Device Number assigned by Bus. sticky by name, sticky by nature πprobedβ boolean tracking driver state. did the driver probe? boop,bool.enumeration_completeβ completion utility to control potential races on startup between device enumeration and read/write access to the Slave device. so like, nobody reads or writes before we're enumerated, ok? π€initialization_completeβ completion utility to control potential races on startup between device enumeration and settings being restored. same energy, different phase π§unattach_requestβ mask field to keep track why the Slave re-attached and was re-initialized. This is useful to deal with potential race conditions between the Master suspending and the codec resuming, and make sure that when the Master triggered a reset the Slave is properly enumerated and initialized. that's the whole deal, word for word, it's au32.first_interrupt_doneβ status flag tracking if the interrupt handling for a Slave happens for the first time after enumeration. first time for everything, bestie πis_mockup_deviceβ status flag used to squelch errors in the command/control protocol for SoundWire mockup devices. fake device, real flag πsdw_dev_lockβ mutex used to protect callbacks/remove races. lock it down before you wreck it πsdca_dataβ structure containing all device data for SDCA helpers. thestruct sdca_device_datapile, one-stop shop for the helpers.
ngl a lot of these fields exist purely to fight race conditions on startup and suspend/resume. SoundWire said "we will be careful" and meant it π
π SEE ALSO π
found in the kernel file ./include/linux/soundwire/sdw.h, and here's the entire friend group, all (9) entries, not one dropped π:
enum sdw_slave_status(9)enum sdw_clk_stop_type(9)enum sdw_command_response(9)enum sdw_stream_type(9)enum sdw_data_direction(9)enum sdw_port_data_mode(9)enum sdw_p15_behave(9)enum sdw_dpn_type(9)enum sdw_clk_stop_mode(9)struct sdw_dp0_prop(9)struct sdw_dpn_prop(9)struct sdw_slave_prop(9)struct sdw_master_prop(9)struct sdw_slave_id(9)struct sdw_slave_intr_status(9)enum sdw_reg_bank(9)struct sdw_prepare_ch(9)enum sdw_port_prep_ops(9)struct sdw_bus_params(9)struct sdw_slave_ops(9)struct sdw_master_device(9)struct sdw_port_params(9)struct sdw_transport_params(9)struct sdw_enable_ch(9)struct sdw_master_port_ops(9)struct sdw_defer(9)struct sdw_master_ops(9)struct sdw_port_config(9)struct sdw_stream_config(9)enum sdw_stream_state(9)struct sdw_stream_params(9)struct sdw_stream_runtime(9)struct sdw_bus(9)sdw_slave_wait_for_init(9)
and that's the page π one last lil housekeeping note so you know where this came from: it's from ./include/linux/soundwire, dated October 2026, in the Kernel API Manual β so like, when you cite it, cite it cute. mwah, go read sdw_slave_wait_for_init(9) next, bestie πβ¨
π¦ 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