Skip to content

ASoC: Make set_tdm_slot() semantics consistent

Lars-Peter Clausen alsa-devel 1 version Applied

Status from this message: Applied all, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesApplied

Changes since v1 from the cover letter

* Don't modify the fsl-esai driver as it already uses the non-inverted semantics

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/4ASoC: mc13783: Update set_tdm_slot() semanticssound/soc/codecs/mc13783.c sound/soc/fsl/imx-mc13783.c+6 -70 replies
2/4ASoC: fsl: Update set_tdm_slot() semanticssound/soc/fsl/eukrea-tlv320.c sound/soc/fsl/fsl_ssi.c sound/soc/fsl/fsl_utils.c +3 more+11 -111 reply
3/4ASoC: fsl: Remove fsl_asoc_xlate_tdm_slot_mask()sound/soc/fsl/fsl_utils.c sound/soc/fsl/fsl_utils.h sound/soc/fsl/imx-ssi.c+0 -310 replies
4/4ASoC: Update snd_soc_dai_set_tdm_slot() documentationsound/soc/soc-core.c+16 -40 replies

Reviews trailers per patch

1 of 4 patches has a Reviewed-by or Acked-by.

PatchNicolin Chen
1/4
2/4A-b
3/4
4/4

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] ASoC: Make set_tdm_slot() semantics consistent

Changes since v1:
* Don't modify the fsl-esai driver as it already uses the non-inverted semantics

Original cover letter below:

This is something we shortly discussed during the ALSA mini conference in Duesseldorf last year. We want to do more useful stuff with the snd_soc_set_tdm_slot() API and build generic infrastructure on top of it. But there are currently two different incompatible semantics of how the tx_mask and rx_mask parameters of snd_soc_dai_set_tdm_slot() are used. If we want to be able to use the API in a generic way we need to fix this inconsistency. Both interpretations agree that the slot masks should be represented as bitmasks which bit 0 representing the first slot, bit 1 the second slot and so on. But where they differ is in the meaning of value of the bit. Some implementations assume that if a bit is set the channel is enabled and if the bit is cleared the channel is disabled, others have inverse semantics, they assume that if a bit is cleared the channel is enabled and if the bit is set the channel is disabled.

The former is used by most drivers and later is only used by some the Freescale DAI drivers and the MC13783 CODEC driver. This appears to be a result of Freescale DAI drivers directly passing the masks through to the registers which expect the inverted semantics. And the MC13783 appears to have picked up the same meaning since it is used on a board which has a Freescale DAI on the CPU side of the DAI link.

This series updates the MC13783 and Freescale DAI drivers to use the same semantics as other drivers and also updates the documentation of the snd_soc_dai_set_tdm_slot() function to be more specific on the intended semantics.

- Lars

Lars-Peter Clausen (4):
ASoC: mc13783: Update set_tdm_slot() semantics
ASoC: fsl: Update set_tdm_slot() semantics
ASoC: fsl: Remove fsl_asoc_xlate_tdm_slot_mask()
ASoC: Update snd_soc_dai_set_tdm_slot() documentation

 sound/soc/codecs/mc13783.c    | 10 +++++-----
 sound/soc/fsl/eukrea-tlv320.c |  2 +-
 sound/soc/fsl/fsl_ssi.c       |  4 ++--
 sound/soc/fsl/fsl_utils.c     | 27 ---------------------------
 sound/soc/fsl/fsl_utils.h     |  3 ---
 sound/soc/fsl/imx-mc13783.c   |  5 ++---
 sound/soc/fsl/imx-ssi.c       |  5 ++---
 sound/soc/fsl/wm1133-ev1.c    |  4 ++--
 sound/soc/soc-core.c          | 20 ++++++++++++++++----
 9 files changed, 30 insertions(+), 50 deletions(-)
Signature · 1 line
1.8.0