mbox series

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

Message ID 20220504170905.332415-1-ckeepax@opensource.cirrus.com (mailing list archive)
Headers show
Series Clean up usage of the endianness flag | expand

Message

Charles Keepax May 4, 2022, 5:08 p.m. UTC
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(-)

Comments

Mark Brown May 10, 2022, 11:13 a.m. UTC | #1
On Wed, 4 May 2022 18:08:27 +0100, Charles Keepax wrote:
> 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.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/38] ASoC: soc-component: Add comment for the endianness flag
        commit: 5c832efdbf8651e2800a0169a870786bd85ee230
[02/38] ASoC: atmel-pdmic: Remove endianness flag on pdmic component
        commit: 52857c3baa0e5ddeba7b2c84e56bb71c9674e048
[03/38] ASoC: atmel-classd: Remove endianness flag on class d component
        commit: 0104d52a6a69b06b0e8167f7c1247e8c76aca070
[04/38] ASoC: cs4270: Remove redundant big endian formats
        commit: 99a4b91ae967d22158d3f4d4f9564ac63295930e
[05/38] ASoC: cs42l51: Remove redundant big endian formats
        commit: 2bf1e87b9338e8986f78b675a201f7f02a3c43d5
[06/38] ASoC: cs4349: Remove redundant big endian formats
        commit: 8a85e2fca6476968f8558163b95c2df38930e523
[07/38] ASoC: hdmi-codec: Remove redundant big endian formats
        commit: 6edfed8f2cce012e87277c8a1786a2de7d5cae35
[08/38] ASoC: sta32x: Remove redundant big endian formats
        commit: a9b5bef89a68ec45ec198e2d316cd8b9b9bf6655
[09/38] ASoC: sta350: Remove redundant big endian formats
        commit: 2ac5b98284b3744514dcf75909a3bb3c3d5ab7d4
[10/38] ASoC: hdac_hda: Add endianness flag in snd_soc_component_driver
        commit: 1324cd8d14f06ff933c825ca5a51139604bc6b97
[11/38] ASoC: max98504: Add endianness flag in snd_soc_component_driver
        commit: a0556e3ad0c40359d5fa3dc72de14ad2efb9dfda
[12/38] ASoC: adau1372: Add endianness flag in snd_soc_component_driver
        commit: ac6f26c18f2d231e4006b2f12e0e46aeb6430cbb
[13/38] ASoC: cs4234: Add endianness flag in snd_soc_component_driver
        commit: de88ca441a3066668cae62741a52042f0273d364
[14/38] ASoC: cs35l41: Add endianness flag in snd_soc_component_driver
        commit: f0688b567fb88ba7636e87a5daed8a175275aa2e
[15/38] ASoC: cx2072x: Add endianness flag in snd_soc_component_driver
        commit: 1c3cbc1dacecdb427b693992f1a05b5837b33a70
[16/38] ASoC: lochnagar: Add endianness flag in snd_soc_component_driver
        commit: ba7328f31cd508964cf2a0b62edfb0b8339c1e77
[17/38] ASoC: mt6351: Add endianness flag in snd_soc_component_driver
        commit: 39723d3493edd60ed41f9891391d4335b65547b9
[18/38] ASoC: mt6358: Add endianness flag in snd_soc_component_driver
        commit: a5f956e221e92a0e93f036651cdab80a2eb6bb18
[19/38] ASoC: mt6359: Add endianness flag in snd_soc_component_driver
        commit: d990af7422761fa58713e2f56664f7c8c2bf6383
[20/38] ASoC: mt6660: Add endianness flag in snd_soc_component_driver
        commit: 8044910bc28e06e0dc0194f160118e00964d8b6a
[21/38] ASoC: pcm3060: Add endianness flag in snd_soc_component_driver
        commit: f0488349c1183a3a524434958d909f38628e1d4b
[22/38] ASoC: rt1019: Add endianness flag in snd_soc_component_driver
        commit: 3816069538d54a9c45345f45b569bb2e42846561
[23/38] ASoC: rt9120: Add endianness flag in snd_soc_component_driver
        commit: 80827c123f2a5f5e0fbcc6cb33b102666acec08e
[24/38] ASoC: tlv320adc3xxx: Add endianness flag in snd_soc_component_driver
        commit: f5e0084b5beed00f11fb7cd1e90b8b91fcd06e9f
[25/38] ASoC: tscs454: Add endianness flag in snd_soc_component_driver
        commit: ff69ec96b87dccb3a29edef8cec5d4fefbbc2055
[26/38] ASoC: cros_ec_codec: Add endianness flag in i2s_rx_component_driver
        commit: cfacadbdca23f1a8d9c5db2a8f1bb3c6a1dd4dd8
[27/38] ASoC: wcd934x: Add endianness flag in snd_soc_component_driver
        commit: 6b1b1579aa9879bbf729f75c386cb3c932b1f5b3
[28/38] ASoC: wcd9335: Add endianness flag in snd_soc_component_driver
        commit: e230b1b1819f2941b8b31174a3839388641920f8
[29/38] ASoC: rt700: Add endianness flag in snd_soc_component_driver
        commit: 4982fc1def317febc74398e839dab2a4059692fa
[30/38] ASoC: rt711: Add endianness flag in snd_soc_component_driver
        commit: 33f06beac3ade10834a82ad4105dcd91d4b00d61
[31/38] ASoC: rt711-sdca: Add endianness flag in snd_soc_component_driver
        commit: 3e50a5001055d79c04ea1c79fe4b4ff937a3339c
[32/38] ASoC: rt715: Add endianness flag in snd_soc_component_driver
        commit: 1a6750123b5d2f05200fb55633b32c81c840f681
[33/38] ASoC: rt715-sdca: Add endianness flag in snd_soc_component_driver
        commit: e8f4ddcb33de9b1eaf74d150234a2cd07dddcfad
[34/38] ASoC: rt1308-sdw: Add endianness flag in snd_soc_component_driver
        commit: 9b536b34693c8ab9caf0612bf4fdbc09fd51f126
[35/38] ASoC: rt1316-sdw: Add endianness flag in snd_soc_component_driver
        commit: 7fb6f48351c896fc6c18f9d3e7b0b4fb689e73cb
[36/38] ASoC: wcd938x: Add endianness flag in snd_soc_component_driver
        commit: ff7f9aa523d1699663cbeec4b0e69aaeab5e6bba
[37/38] ASoC: wsa881x: Add endianness flag in snd_soc_component_driver
        commit: 96bc59d097047a8a013cb77b2a1215cc4877fa96
[38/38] ASoC: sdw-mockup: Add endianness flag in snd_soc_component_driver
        commit: e2d61f6255a26a09d4fe2458fa93a33a71db1024

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark