aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2015-01-12 04:27:17 -0500
committerMark Brown <broonie@kernel.org>2015-01-14 14:04:38 -0500
commitbec78c5f4ae228c4cbd432e97cadb8827fd8f1f9 (patch)
treec6ef708df0ec5c57b0f0b830ddb1f873b2b28be0
parent97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff)
ASoC: mc13783: Update set_tdm_slot() semantics
The mc13783 driver uses inverted semantics for the tx_mask and rx_mask parameter of the set_tdm_slot() callback compared to rest of ASoC. This patch updates the driver's semantics to be consistent with the rest of ASoC, i.e. a set bit means a active slot and a cleared bit means a inactive slot. This will allow us to use the set_tdm_slot() API in a more generic way. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/mc13783.c10
-rw-r--r--sound/soc/fsl/imx-mc13783.c3
2 files changed, 6 insertions, 7 deletions
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c
index c1e441c2c8af..2ffb9a0570dc 100644
--- a/sound/soc/codecs/mc13783.c
+++ b/sound/soc/codecs/mc13783.c
@@ -328,16 +328,16 @@ static int mc13783_set_tdm_slot_dac(struct snd_soc_dai *dai,
328 } 328 }
329 329
330 switch (rx_mask) { 330 switch (rx_mask) {
331 case 0xfffffffc: 331 case 0x03:
332 val |= SSI_NETWORK_DAC_RXSLOT_0_1; 332 val |= SSI_NETWORK_DAC_RXSLOT_0_1;
333 break; 333 break;
334 case 0xfffffff3: 334 case 0x0c:
335 val |= SSI_NETWORK_DAC_RXSLOT_2_3; 335 val |= SSI_NETWORK_DAC_RXSLOT_2_3;
336 break; 336 break;
337 case 0xffffffcf: 337 case 0x30:
338 val |= SSI_NETWORK_DAC_RXSLOT_4_5; 338 val |= SSI_NETWORK_DAC_RXSLOT_4_5;
339 break; 339 break;
340 case 0xffffff3f: 340 case 0xc0:
341 val |= SSI_NETWORK_DAC_RXSLOT_6_7; 341 val |= SSI_NETWORK_DAC_RXSLOT_6_7;
342 break; 342 break;
343 default: 343 default:
@@ -360,7 +360,7 @@ static int mc13783_set_tdm_slot_codec(struct snd_soc_dai *dai,
360 if (slots != 4) 360 if (slots != 4)
361 return -EINVAL; 361 return -EINVAL;
362 362
363 if (tx_mask != 0xfffffffc) 363 if (tx_mask != 0x3)
364 return -EINVAL; 364 return -EINVAL;
365 365
366 val |= (0x00 << 2); /* primary timeslot RX/TX(?) is 0 */ 366 val |= (0x00 << 2); /* primary timeslot RX/TX(?) is 0 */
diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c
index 6bf5bce01a92..9589452e995e 100644
--- a/sound/soc/fsl/imx-mc13783.c
+++ b/sound/soc/fsl/imx-mc13783.c
@@ -37,8 +37,7 @@ static int imx_mc13783_hifi_hw_params(struct snd_pcm_substream *substream,
37 struct snd_soc_dai *codec_dai = rtd->codec_dai; 37 struct snd_soc_dai *codec_dai = rtd->codec_dai;
38 int ret; 38 int ret;
39 39
40 ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xfffffffc, 0xfffffffc, 40 ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 4, 16);
41 4, 16);
42 if (ret) 41 if (ret)
43 return ret; 42 return ret;
44 43