[alsa-devel] [PATCH 0/4] ASoC: Make set_tdm_slot() semantics consistent

Lars-Peter Clausen lars at metafoo.de
Sat Jan 10 11:52:33 CET 2015


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_esai.c      |  3 +++
 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 ++++++++++++++++----
 10 files changed, 33 insertions(+), 50 deletions(-)

-- 
1.8.0



More information about the Alsa-devel mailing list