aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-core.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 985052b3fbed..64e047dc7cdf 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -2119,15 +2119,27 @@ static int snd_soc_xlate_tdm_slot_mask(unsigned int slots,
2119} 2119}
2120 2120
2121/** 2121/**
2122 * snd_soc_dai_set_tdm_slot - configure DAI TDM. 2122 * snd_soc_dai_set_tdm_slot() - Configures a DAI for TDM operation
2123 * @dai: DAI 2123 * @dai: The DAI to configure
2124 * @tx_mask: bitmask representing active TX slots. 2124 * @tx_mask: bitmask representing active TX slots.
2125 * @rx_mask: bitmask representing active RX slots. 2125 * @rx_mask: bitmask representing active RX slots.
2126 * @slots: Number of slots in use. 2126 * @slots: Number of slots in use.
2127 * @slot_width: Width in bits for each slot. 2127 * @slot_width: Width in bits for each slot.
2128 * 2128 *
2129 * Configures a DAI for TDM operation. Both mask and slots are codec and DAI 2129 * This function configures the specified DAI for TDM operation. @slot contains
2130 * specific. 2130 * the total number of slots of the TDM stream and @slot_with the width of each
2131 * slot in bit clock cycles. @tx_mask and @rx_mask are bitmasks specifying the
2132 * active slots of the TDM stream for the specified DAI, i.e. which slots the
2133 * DAI should write to or read from. If a bit is set the corresponding slot is
2134 * active, if a bit is cleared the corresponding slot is inactive. Bit 0 maps to
2135 * the first slot, bit 1 to the second slot and so on. The first active slot
2136 * maps to the first channel of the DAI, the second active slot to the second
2137 * channel and so on.
2138 *
2139 * TDM mode can be disabled by passing 0 for @slots. In this case @tx_mask,
2140 * @rx_mask and @slot_width will be ignored.
2141 *
2142 * Returns 0 on success, a negative error code otherwise.
2131 */ 2143 */
2132int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, 2144int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,
2133 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width) 2145 unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)