Commit bec78c5f authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Mark Brown

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: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 97bf6af1
...@@ -328,16 +328,16 @@ static int mc13783_set_tdm_slot_dac(struct snd_soc_dai *dai, ...@@ -328,16 +328,16 @@ static int mc13783_set_tdm_slot_dac(struct snd_soc_dai *dai,
} }
switch (rx_mask) { switch (rx_mask) {
case 0xfffffffc: case 0x03:
val |= SSI_NETWORK_DAC_RXSLOT_0_1; val |= SSI_NETWORK_DAC_RXSLOT_0_1;
break; break;
case 0xfffffff3: case 0x0c:
val |= SSI_NETWORK_DAC_RXSLOT_2_3; val |= SSI_NETWORK_DAC_RXSLOT_2_3;
break; break;
case 0xffffffcf: case 0x30:
val |= SSI_NETWORK_DAC_RXSLOT_4_5; val |= SSI_NETWORK_DAC_RXSLOT_4_5;
break; break;
case 0xffffff3f: case 0xc0:
val |= SSI_NETWORK_DAC_RXSLOT_6_7; val |= SSI_NETWORK_DAC_RXSLOT_6_7;
break; break;
default: default:
...@@ -360,7 +360,7 @@ static int mc13783_set_tdm_slot_codec(struct snd_soc_dai *dai, ...@@ -360,7 +360,7 @@ static int mc13783_set_tdm_slot_codec(struct snd_soc_dai *dai,
if (slots != 4) if (slots != 4)
return -EINVAL; return -EINVAL;
if (tx_mask != 0xfffffffc) if (tx_mask != 0x3)
return -EINVAL; return -EINVAL;
val |= (0x00 << 2); /* primary timeslot RX/TX(?) is 0 */ val |= (0x00 << 2); /* primary timeslot RX/TX(?) is 0 */
......
...@@ -37,8 +37,7 @@ static int imx_mc13783_hifi_hw_params(struct snd_pcm_substream *substream, ...@@ -37,8 +37,7 @@ static int imx_mc13783_hifi_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *codec_dai = rtd->codec_dai; struct snd_soc_dai *codec_dai = rtd->codec_dai;
int ret; int ret;
ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xfffffffc, 0xfffffffc, ret = snd_soc_dai_set_tdm_slot(codec_dai, 0x3, 0x3, 4, 16);
4, 16);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment