Skip to content

Clean up usage of the endianness flag

Charles Keepax alsa-devel chrome-platform linux-mediatek 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest38 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/38ASoC: soc-component: Add comment for the endianness flaginclude/sound/soc-component.h+9 -07 replies
2/38ASoC: atmel-pdmic: Remove endianness flag on pdmic componentsound/soc/atmel/atmel-pdmic.c+0 -10 replies
3/38ASoC: atmel-classd: Remove endianness flag on class d componentsound/soc/atmel/atmel-classd.c+0 -10 replies
4/38ASoC: cs4270: Remove redundant big endian formatssound/soc/codecs/cs4270.c+3 -120 replies
5/38ASoC: cs42l51: Remove redundant big endian formatssound/soc/codecs/cs42l51.c+2 -50 replies
6/38ASoC: cs4349: Remove redundant big endian formatssound/soc/codecs/cs4349.c+3 -60 replies
7/38ASoC: hdmi-codec: Remove redundant big endian formatssound/soc/codecs/hdmi-codec.c+5 -100 replies
8/38ASoC: sta32x: Remove redundant big endian formatssound/soc/codecs/sta32x.c+3 -60 replies
9/38ASoC: sta350: Remove redundant big endian formatssound/soc/codecs/sta350.c+3 -60 replies
10/38ASoC: hdac_hda: Add endianness flag in snd_soc_component_driversound/soc/codecs/hdac_hda.c+8 -70 replies
11/38ASoC: max98504: Add endianness flag in snd_soc_component_driversound/soc/codecs/max98504.c+1 -00 replies
12/38ASoC: adau1372: Add endianness flag in snd_soc_component_driversound/soc/codecs/adau1372.c+1 -00 replies
13/38ASoC: cs4234: Add endianness flag in snd_soc_component_driversound/soc/codecs/cs4234.c+1 -00 replies
14/38ASoC: cs35l41: Add endianness flag in snd_soc_component_driversound/soc/codecs/cs35l41.c+2 -00 replies
15/38ASoC: cx2072x: Add endianness flag in snd_soc_component_driversound/soc/codecs/cx2072x.c+1 -00 replies
16/38ASoC: lochnagar: Add endianness flag in snd_soc_component_driversound/soc/codecs/lochnagar-sc.c+3 -20 replies
17/38ASoC: mt6351: Add endianness flag in snd_soc_component_driversound/soc/codecs/mt6351.c+4 -60 replies
18/38ASoC: mt6358: Add endianness flag in snd_soc_component_driversound/soc/codecs/mt6358.c+4 -60 replies
19/38ASoC: mt6359: Add endianness flag in snd_soc_component_driversound/soc/codecs/mt6359.c+4 -60 replies
20/38ASoC: mt6660: Add endianness flag in snd_soc_component_driversound/soc/codecs/mt6660.c+1 -00 replies
21/38ASoC: pcm3060: Add endianness flag in snd_soc_component_driversound/soc/codecs/pcm3060.c+1 -00 replies
22/38ASoC: rt1019: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt1019.c+2 -10 replies
23/38ASoC: rt9120: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt9120.c+1 -00 replies
24/38ASoC: tlv320adc3xxx: Add endianness flag in snd_soc_component_driversound/soc/codecs/tlv320adc3xxx.c+6 -50 replies
25/38ASoC: tscs454: Add endianness flag in snd_soc_component_driversound/soc/codecs/tscs454.c+6 -60 replies
26/38ASoC: cros_ec_codec: Add endianness flag in i2s_rx_component_driversound/soc/codecs/cros_ec_codec.c+4 -30 replies
27/38ASoC: wcd934x: Add endianness flag in snd_soc_component_driversound/soc/codecs/wcd934x.c+1 -00 replies
28/38ASoC: wcd9335: Add endianness flag in snd_soc_component_driversound/soc/codecs/wcd9335.c+1 -00 replies
29/38ASoC: rt700: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt700.c+1 -00 replies
30/38ASoC: rt711: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt711.c+1 -00 replies
31/38ASoC: rt711-sdca: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt711-sdca.c+1 -00 replies
32/38ASoC: rt715: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt715.c+1 -00 replies
33/38ASoC: rt715-sdca: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt715-sdca.c+1 -00 replies
34/38ASoC: rt1308-sdw: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt1308-sdw.c+1 -00 replies
35/38ASoC: rt1316-sdw: Add endianness flag in snd_soc_component_driversound/soc/codecs/rt1316-sdw.c+1 -00 replies
36/38ASoC: wcd938x: Add endianness flag in snd_soc_component_driversound/soc/codecs/wcd938x.c+1 -00 replies
37/38ASoC: wsa881x: Add endianness flag in snd_soc_component_driversound/soc/codecs/wsa881x.c+1 -00 replies
38/38ASoC: sdw-mockup: Add endianness flag in snd_soc_component_driversound/soc/codecs/sdw-mockup.c+1 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/38] Clean up usage of the endianness flag

Before componentisation any part registered as a CODEC would have automatically supported both little and big endian, ie. the core would duplicate any supported LE or BE PCM format to support the other endian as well. As componentisation removed the distinction between CODEC drivers and platform drivers, a flag was added to specify if this behaviour is required for a particular component. However, as most systems tend to use little endian the absence of the flag is rarely noticed. Also the naming of the flag "endianness" is a little unobvious as to if it should be applied to a particular component.

This series adds a comment to better explain the meaning of the flag and then tidys up the usage of the flag. A couple of uses of the flag are removed where is has been used inappropriately on the CPU side of the DAI link, this is clearly not valid in the cases it has been used, and I suspect never would be valid. Then some redundant formats are removed, since they would be covered by existing endianness flags. And finally a bunch of devices that are missing the flag have it added.

It is worth noting that since componenisation there are now a couple of cases where it is not entire clear to me that the flag should be applied to all CODECs as it was before. In those cases I haven't updated the driver to add the flag and they are outlined here:

1) Build into the AP CODECs, these are actual silicon inside the main processor and they typically receive audio directly from an internal bus. It is not obvious to me that these can happily ignore endian. On the CODEC side these include: jz4725b.c, jz4760.c, jz4770.c, rk3328_codec.c, lpass-va-macro.c, lpass-rx-macro.c, lpass-tx-macro.c, lpass-wsa-macro.c. There are also some examples of this scattered around the various platform support directories in sound/soc.

2) Devices behind non-audio buses, SPI just moves bits and doesn't really define an endian for audio data on the bus. Thus it seems the CODEC probably can care about the endian. The only devices that fall into this group (mostly for AoV) are: rt5514-spi.c, rt5677-spi.c, cros_ec_codec.c (only the AoV).

3) CODECs with no DAIs, these could specify the flag and plenty of them do; CODECs from the initial conversion to componentisation. But the flag makes no difference here since there is nothing for it to apply to. This includes purely analogue CODECs: aw8738.c, ssm2305.c, tpa6130a2.c, tda7419.c, max9759.c, max9768.c, max9877.c, lm4857.c, simple-mux.c, simple-amplifier.c. And devices that only do jack
detection: ts3a227e.c, mt6359-accdet.c.

If there are any opinions on adding the flag to any of those three groups they would be greatfully received. But I am leaning towards leaving 1,2 without endianness flags since it feels inappropriate, and removing the endian flag from devices in catagory 3 that already have it. Assuming no one objects to that I will do a follow up series for that.

Thanks,
Charles

Charles Keepax (38):
ASoC: soc-component: Add comment for the endianness flag
ASoC: atmel-pdmic: Remove endianness flag on pdmic component
ASoC: atmel-classd: Remove endianness flag on class d component
ASoC: cs4270: Remove redundant big endian formats
ASoC: cs42l51: Remove redundant big endian formats
ASoC: cs4349: Remove redundant big endian formats
ASoC: hdmi-codec: Remove redundant big endian formats
ASoC: sta32x: Remove redundant big endian formats
ASoC: sta350: Remove redundant big endian formats
ASoC: hdac_hda: Add endianness flag in snd_soc_component_driver
ASoC: max98504: Add endianness flag in snd_soc_component_driver
ASoC: adau1372: Add endianness flag in snd_soc_component_driver
ASoC: cs4234: Add endianness flag in snd_soc_component_driver
ASoC: cs35l41: Add endianness flag in snd_soc_component_driver
ASoC: cx2072x: Add endianness flag in snd_soc_component_driver
ASoC: lochnagar: Add endianness flag in snd_soc_component_driver
ASoC: mt6351: Add endianness flag in snd_soc_component_driver
ASoC: mt6358: Add endianness flag in snd_soc_component_driver
ASoC: mt6359: Add endianness flag in snd_soc_component_driver
ASoC: mt6660: Add endianness flag in snd_soc_component_driver
ASoC: pcm3060: Add endianness flag in snd_soc_component_driver
ASoC: rt1019: Add endianness flag in snd_soc_component_driver
ASoC: rt9120: Add endianness flag in snd_soc_component_driver
ASoC: tlv320adc3xxx: Add endianness flag in snd_soc_component_driver
ASoC: tscs454: Add endianness flag in snd_soc_component_driver
ASoC: cros_ec_codec: Add endianness flag in i2s_rx_component_driver
ASoC: wcd934x: Add endianness flag in snd_soc_component_driver
ASoC: wcd9335: Add endianness flag in snd_soc_component_driver
ASoC: rt700: Add endianness flag in snd_soc_component_driver
ASoC: rt711: Add endianness flag in snd_soc_component_driver
ASoC: rt711-sdca: Add endianness flag in snd_soc_component_driver
ASoC: rt715: Add endianness flag in snd_soc_component_driver
ASoC: rt715-sdca: Add endianness flag in snd_soc_component_driver
ASoC: rt1308-sdw: Add endianness flag in snd_soc_component_driver
ASoC: rt1316-sdw: Add endianness flag in snd_soc_component_driver
ASoC: wcd938x: Add endianness flag in snd_soc_component_driver
ASoC: wsa881x: Add endianness flag in snd_soc_component_driver
ASoC: sdw-mockup: Add endianness flag in snd_soc_component_driver

 include/sound/soc-component.h    |  9 +++++++++
 sound/soc/atmel/atmel-classd.c   |  1 -
 sound/soc/atmel/atmel-pdmic.c    |  1 -
 sound/soc/codecs/adau1372.c      |  1 +
 sound/soc/codecs/cros_ec_codec.c |  7 ++++---
 sound/soc/codecs/cs35l41.c       |  2 ++
 sound/soc/codecs/cs4234.c        |  1 +
 sound/soc/codecs/cs4270.c        | 15 +++------------
 sound/soc/codecs/cs42l51.c       |  7 ++-----
 sound/soc/codecs/cs4349.c        |  9 +++------
 sound/soc/codecs/cx2072x.c       |  1 +
 sound/soc/codecs/hdac_hda.c      | 15 ++++++++-------
 sound/soc/codecs/hdmi-codec.c    | 15 +++++----------
 sound/soc/codecs/lochnagar-sc.c  |  5 +++--
 sound/soc/codecs/max98504.c      |  1 +
 sound/soc/codecs/mt6351.c        | 10 ++++------
 sound/soc/codecs/mt6358.c        | 10 ++++------
 sound/soc/codecs/mt6359.c        | 10 ++++------
 sound/soc/codecs/mt6660.c        |  1 +
 sound/soc/codecs/pcm3060.c       |  1 +
 sound/soc/codecs/rt1019.c        |  3 ++-
 sound/soc/codecs/rt1308-sdw.c    |  1 +
 sound/soc/codecs/rt1316-sdw.c    |  1 +
 sound/soc/codecs/rt700.c         |  1 +
 sound/soc/codecs/rt711-sdca.c    |  1 +
 sound/soc/codecs/rt711.c         |  1 +
 sound/soc/codecs/rt715-sdca.c    |  1 +
 sound/soc/codecs/rt715.c         |  1 +
 sound/soc/codecs/rt9120.c        |  1 +
 sound/soc/codecs/sdw-mockup.c    |  1 +
 sound/soc/codecs/sta32x.c        |  9 +++------
 sound/soc/codecs/sta350.c        |  9 +++------
 sound/soc/codecs/tlv320adc3xxx.c | 11 ++++++-----
 sound/soc/codecs/tscs454.c       | 12 ++++++------
 sound/soc/codecs/wcd9335.c       |  1 +
 sound/soc/codecs/wcd934x.c       |  1 +
 sound/soc/codecs/wcd938x.c       |  1 +
 sound/soc/codecs/wsa881x.c       |  1 +
 38 files changed, 90 insertions(+), 89 deletions(-)
Signature · 1 line
2.30.2