···112112int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt);113113114114int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,115115- unsigned int mask, int slots);115115+ unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width);116116117117int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate);118118···146146 */147147 int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt);148148 int (*set_tdm_slot)(struct snd_soc_dai *dai,149149- unsigned int mask, int slots);149149+ unsigned int tx_mask, unsigned int rx_mask,150150+ int slots, int slot_width);150151 int (*set_tristate)(struct snd_soc_dai *dai, int tristate);151152152153 /*
+3-2
sound/soc/codecs/wm9081.c
···11491149 return 0;11501150}1151115111521152+/* FIXME: Needs to handle slot_width */11521153static int wm9081_set_tdm_slot(struct snd_soc_dai *dai,11531153- unsigned int mask, int slots)11541154+ unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)11541155{11551156 struct snd_soc_codec *codec = dai->codec;11561157 unsigned int aif1 = snd_soc_read(codec, WM9081_AUDIO_INTERFACE_1);···1163116211641163 aif1 |= (slots - 1) << WM9081_AIFDAC_TDM_MODE_SHIFT;1165116411661166- switch (mask) {11651165+ switch (rx_mask) {11671166 case 1:11681167 break;11691168 case 2:
+1-1
sound/soc/pxa/magician.c
···190190 if (ret < 0)191191 return ret;192192193193- ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 1);193193+ ret = snd_soc_dai_set_tdm_slot(cpu_dai, 1, 0, 1, width);194194 if (ret < 0)195195 return ret;196196
+20-7
sound/soc/pxa/pxa-ssp.c
···375375 * Set the active slots in TDM/Network mode376376 */377377static int pxa_ssp_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,378378- unsigned int mask, int slots)378378+ unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)379379{380380 struct ssp_priv *priv = cpu_dai->private_data;381381 struct ssp_device *ssp = priv->dev.ssp;382382 u32 sscr0;383383384384- sscr0 = ssp_read_reg(ssp, SSCR0) & ~SSCR0_SlotsPerFrm(7);384384+ sscr0 = ssp_read_reg(ssp, SSCR0);385385+ sscr0 &= ~(SSCR0_MOD | SSCR0_SlotsPerFrm(8) | SSCR0_EDSS | SSCR0_DSS);385386386386- /* set number of active slots */387387- sscr0 |= SSCR0_SlotsPerFrm(slots);387387+ /* set slot width */388388+ if (slot_width > 16)389389+ sscr0 |= SSCR0_EDSS | SSCR0_DataSize(slot_width - 16);390390+ else391391+ sscr0 |= SSCR0_DataSize(slot_width);392392+393393+ if (slots > 1) {394394+ /* enable network mode */395395+ sscr0 |= SSCR0_MOD;396396+397397+ /* set number of active slots */398398+ sscr0 |= SSCR0_SlotsPerFrm(slots);399399+400400+ /* set active slot mask */401401+ ssp_write_reg(ssp, SSTSA, tx_mask);402402+ ssp_write_reg(ssp, SSRSA, rx_mask);403403+ }388404 ssp_write_reg(ssp, SSCR0, sscr0);389405390390- /* set active slot mask */391391- ssp_write_reg(ssp, SSTSA, mask);392392- ssp_write_reg(ssp, SSRSA, mask);393406 return 0;394407}395408
+6-3
sound/soc/soc-core.c
···22232223/**22242224 * snd_soc_dai_set_tdm_slot - configure DAI TDM.22252225 * @dai: DAI22262226- * @mask: DAI specific mask representing used slots.22262226+ * @tx_mask: bitmask representing active TX slots.22272227+ * @rx_mask: bitmask representing active RX slots.22272228 * @slots: Number of slots in use.22292229+ * @slot_width: Width in bits for each slot.22282230 *22292231 * Configures a DAI for TDM operation. Both mask and slots are codec and DAI22302232 * specific.22312233 */22322234int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai,22332233- unsigned int mask, int slots)22352235+ unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)22342236{22352237 if (dai->ops && dai->ops->set_tdm_slot)22362236- return dai->ops->set_tdm_slot(dai, mask, slots);22382238+ return dai->ops->set_tdm_slot(dai, tx_mask, rx_mask,22392239+ slots, slot_width);22372240 else22382241 return -EINVAL;22392242}