diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2015-01-12 04:27:18 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-14 14:04:47 -0500 |
commit | d0077aaf2206f3c3524d71a9f38b408dca63852f (patch) | |
tree | ed555df8340cc4e329afd36570e7aa0ba91a5c8a /sound/soc/fsl | |
parent | bec78c5f4ae228c4cbd432e97cadb8827fd8f1f9 (diff) |
ASoC: fsl: Update set_tdm_slot() semantics
The fsl-ssi and imx-ssi drivers use 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>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/eukrea-tlv320.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 4 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_utils.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/imx-mc13783.c | 2 | ||||
-rw-r--r-- | sound/soc/fsl/imx-ssi.c | 4 | ||||
-rw-r--r-- | sound/soc/fsl/wm1133-ev1.c | 4 |
6 files changed, 11 insertions, 11 deletions
diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index 9ce70fc67b09..0d0203b34d8b 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c | |||
@@ -69,7 +69,7 @@ static int eukrea_tlv320_hw_params(struct snd_pcm_substream *substream, | |||
69 | return ret; | 69 | return ret; |
70 | } | 70 | } |
71 | 71 | ||
72 | snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0); | 72 | snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 0); |
73 | 73 | ||
74 | ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, | 74 | ret = snd_soc_dai_set_sysclk(cpu_dai, IMX_SSP_SYS_CLK, 0, |
75 | SND_SOC_CLOCK_IN); | 75 | SND_SOC_CLOCK_IN); |
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index a65f17d57ffb..8841e59a9869 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -992,8 +992,8 @@ static int fsl_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask, | |||
992 | regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_SSIEN, | 992 | regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_SSIEN, |
993 | CCSR_SSI_SCR_SSIEN); | 993 | CCSR_SSI_SCR_SSIEN); |
994 | 994 | ||
995 | regmap_write(regs, CCSR_SSI_STMSK, tx_mask); | 995 | regmap_write(regs, CCSR_SSI_STMSK, ~tx_mask); |
996 | regmap_write(regs, CCSR_SSI_SRMSK, rx_mask); | 996 | regmap_write(regs, CCSR_SSI_SRMSK, ~rx_mask); |
997 | 997 | ||
998 | regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_SSIEN, val); | 998 | regmap_update_bits(regs, CCSR_SSI_SCR, CCSR_SSI_SCR_SSIEN, val); |
999 | 999 | ||
diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c index 2ac7755da876..5fd4463dbf05 100644 --- a/sound/soc/fsl/fsl_utils.c +++ b/sound/soc/fsl/fsl_utils.c | |||
@@ -94,7 +94,7 @@ EXPORT_SYMBOL(fsl_asoc_get_dma_channel); | |||
94 | * @rx_mask: bitmask representing active RX slots. | 94 | * @rx_mask: bitmask representing active RX slots. |
95 | * | 95 | * |
96 | * This function used to generate the TDM slot TX/RX mask. And the TX/RX | 96 | * This function used to generate the TDM slot TX/RX mask. And the TX/RX |
97 | * mask will use a 0 bit for an active slot as default, and the default | 97 | * mask will use a 1 bit for an active slot as default, and the default |
98 | * active bits are at the LSB of the mask value. | 98 | * active bits are at the LSB of the mask value. |
99 | */ | 99 | */ |
100 | int fsl_asoc_xlate_tdm_slot_mask(unsigned int slots, | 100 | int fsl_asoc_xlate_tdm_slot_mask(unsigned int slots, |
@@ -105,9 +105,9 @@ int fsl_asoc_xlate_tdm_slot_mask(unsigned int slots, | |||
105 | return -EINVAL; | 105 | return -EINVAL; |
106 | 106 | ||
107 | if (tx_mask) | 107 | if (tx_mask) |
108 | *tx_mask = ~((1 << slots) - 1); | 108 | *tx_mask = ((1 << slots) - 1); |
109 | if (rx_mask) | 109 | if (rx_mask) |
110 | *rx_mask = ~((1 << slots) - 1); | 110 | *rx_mask = ((1 << slots) - 1); |
111 | 111 | ||
112 | return 0; | 112 | return 0; |
113 | } | 113 | } |
diff --git a/sound/soc/fsl/imx-mc13783.c b/sound/soc/fsl/imx-mc13783.c index 9589452e995e..9e6493d4e7ff 100644 --- a/sound/soc/fsl/imx-mc13783.c +++ b/sound/soc/fsl/imx-mc13783.c | |||
@@ -45,7 +45,7 @@ static int imx_mc13783_hifi_hw_params(struct snd_pcm_substream *substream, | |||
45 | if (ret) | 45 | if (ret) |
46 | return ret; | 46 | return ret; |
47 | 47 | ||
48 | ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x0, 0xfffffffc, 2, 16); | 48 | ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 16); |
49 | if (ret) | 49 | if (ret) |
50 | return ret; | 50 | return ret; |
51 | 51 | ||
diff --git a/sound/soc/fsl/imx-ssi.c b/sound/soc/fsl/imx-ssi.c index fa801e17c51e..6aeaac33871a 100644 --- a/sound/soc/fsl/imx-ssi.c +++ b/sound/soc/fsl/imx-ssi.c | |||
@@ -74,8 +74,8 @@ static int imx_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, | |||
74 | sccr |= SSI_STCCR_DC(slots - 1); | 74 | sccr |= SSI_STCCR_DC(slots - 1); |
75 | writel(sccr, ssi->base + SSI_SRCCR); | 75 | writel(sccr, ssi->base + SSI_SRCCR); |
76 | 76 | ||
77 | writel(tx_mask, ssi->base + SSI_STMSK); | 77 | writel(~tx_mask, ssi->base + SSI_STMSK); |
78 | writel(rx_mask, ssi->base + SSI_SRMSK); | 78 | writel(~rx_mask, ssi->base + SSI_SRMSK); |
79 | 79 | ||
80 | return 0; | 80 | return 0; |
81 | } | 81 | } |
diff --git a/sound/soc/fsl/wm1133-ev1.c b/sound/soc/fsl/wm1133-ev1.c index 804749a6c61e..ca7b774b13ee 100644 --- a/sound/soc/fsl/wm1133-ev1.c +++ b/sound/soc/fsl/wm1133-ev1.c | |||
@@ -116,10 +116,10 @@ static int wm1133_ev1_hw_params(struct snd_pcm_substream *substream, | |||
116 | /* TODO: The SSI driver should figure this out for us */ | 116 | /* TODO: The SSI driver should figure this out for us */ |
117 | switch (channels) { | 117 | switch (channels) { |
118 | case 2: | 118 | case 2: |
119 | snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffc, 0xffffffc, 2, 0); | 119 | snd_soc_dai_set_tdm_slot(cpu_dai, 0x3, 0x3, 2, 0); |
120 | break; | 120 | break; |
121 | case 1: | 121 | case 1: |
122 | snd_soc_dai_set_tdm_slot(cpu_dai, 0xffffffe, 0xffffffe, 1, 0); | 122 | snd_soc_dai_set_tdm_slot(cpu_dai, 0x1, 0x1, 1, 0); |
123 | break; | 123 | break; |
124 | default: | 124 | default: |
125 | return -EINVAL; | 125 | return -EINVAL; |