linux-stable/sound/soc/atmel
Mark Brown 795dd8d3b8
Clean up usage of the endianness flag
Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

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.
2022-05-10 12:12:50 +01:00
..
Kconfig ASoC: wm8731: Factor out the I2C and SPI bus code into separate modules 2022-04-04 08:39:32 +01:00
Makefile ASoC: atmel: mchp-pdmc: add PDMC driver 2022-03-08 13:38:59 +00:00
atmel-classd.c ASoC: atmel-classd: Remove endianness flag on class d component 2022-05-09 12:46:08 +01:00
atmel-classd.h
atmel-i2s.c ASoC: atmel: Convert to new style DAI format definitions 2021-09-16 14:11:30 +01:00
atmel-pcm-dma.c ASoC: atmel-pcm: remove unnecessary include 2020-09-30 16:12:13 +01:00
atmel-pcm-pdc.c ASoC: atmel-pdc: Use managed DMA buffer allocation 2021-01-13 11:36:15 +00:00
atmel-pcm.h ASoC: atmel: atmel-pcm-dma.c: use devm_snd_dmaengine_pcm_register() 2019-06-28 15:08:38 +01:00
atmel-pdmic.c ASoC: atmel-pdmic: Remove endianness flag on pdmic component 2022-05-09 12:46:07 +01:00
atmel-pdmic.h
atmel_ssc_dai.c ASoC: atmel_ssc_dai: Handle errors for clk_enable 2022-03-02 13:45:22 +00:00
atmel_ssc_dai.h ASoC: atmel_ssc_dai: Remove wrong spinlock usage 2019-09-18 11:12:24 +01:00
atmel_wm8904.c ASoC: atmel: Convert to new style DAI format definitions 2021-09-16 14:11:30 +01:00
mchp-i2s-mcc.c ASoC: atmel: Convert to new style DAI format definitions 2021-09-16 14:11:30 +01:00
mchp-pdmc.c ASoC: atmel: mchp-pdmc: set prepare_slave_config 2022-04-25 13:58:17 +01:00
mchp-spdifrx.c ASoC: mchp-spdifrx: fix typo 2022-03-11 13:42:28 +00:00
mchp-spdiftx.c ASoC: atmel: fix spelling mistakes 2021-07-11 23:48:33 +01:00
mikroe-proto.c ASoC: atmel: Fix error handling in snd_proto_probe 2022-03-08 12:27:51 +00:00
sam9g20_wm8731.c ASoC: sam9g20_wm8731: Use dev_err_probe() for snd_soc_register_card() 2022-05-09 19:46:35 +01:00
sam9x5_wm8731.c ASoC: atmel: Fix error handling in sam9x5_wm8731_driver_probe 2022-03-16 16:39:19 +00:00
tse850-pcm5142.c ASoC: ateml: Use dev_err_probe() helper 2021-12-20 12:47:12 +00:00