---
name: "snd_soc_dai_set_tdm_slot"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/snd_soc_dai_set_tdm_slot"
---

# snd\_soc\_dai\_set\_tdm\_slot(9)

Configures a DAI for TDM operation

## NAME

snd\_soc\_dai\_set\_tdm\_slot - Configures a DAI for TDM operation

## SYNOPSIS

**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***);**

## ARGUMENTS

*dai*

The DAI to configure

*tx\_mask*

bitmask representing active TX slots.

*rx\_mask*

bitmask representing active RX slots.

*slots*

Number of slots in use.

*slot\_width*

Width in bits for each slot.

## DESCRIPTION

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.

## COPYRIGHT
