snd_soc_dai_set_tdm_slot(9) Configures a DAI for TDM operation


int snd_soc_dai_set_tdm_slot(struct snd_soc_dai * dai, unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width);



The DAI to configure


bitmask representing active TX slots.


bitmask representing active RX slots.


Number of slots in use.


Width in bits for each slot.


This function configures the specified DAI for TDM operation. slot contains the total number of slots of the TDM stream and slot_with the width of each slot in bit clock cycles. tx_mask and rx_mask are bitmasks specifying the active slots of the TDM stream for the specified DAI, i.e. which slots the DAI should write to or read from. If a bit is set the corresponding slot is active, if a bit is cleared the corresponding slot is inactive. Bit 0 maps to the first slot, bit 1 to the second slot and so on. The first active slot maps to the first channel of the DAI, the second active slot to the second channel and so on.

TDM mode can be disabled by passing 0 for slots. In this case tx_mask, rx_mask and slot_width will be ignored.

Returns 0 on success, a negative error code otherwise.