Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: tlv320adc3xxx: Add endianness flag in snd_soc_component_driver

The endianness flag is used on the CODEC side to specify an
ambivalence to endian, typically because it is lost over the hardware
link. This device receives audio over an I2S DAI and as such should
have endianness applied.

A fixup is also required to use the width directly rather than relying
on the format in hw_params, now both little and big endian would be
supported.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220504170905.332415-25-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Charles Keepax and committed by
Mark Brown
f5e0084b 80827c12

+6 -5
+6 -5
sound/soc/codecs/tlv320adc3xxx.c
··· 1152 1152 return i; 1153 1153 1154 1154 /* select data word length */ 1155 - switch (params_format(params)) { 1156 - case SNDRV_PCM_FORMAT_S16_LE: 1155 + switch (params_width(params)) { 1156 + case 16: 1157 1157 iface_len = ADC3XXX_IFACE_16BITS; 1158 1158 width = 16; 1159 1159 break; 1160 - case SNDRV_PCM_FORMAT_S20_3LE: 1160 + case 20: 1161 1161 iface_len = ADC3XXX_IFACE_20BITS; 1162 1162 width = 20; 1163 1163 break; 1164 - case SNDRV_PCM_FORMAT_S24_LE: 1164 + case 24: 1165 1165 iface_len = ADC3XXX_IFACE_24BITS; 1166 1166 width = 24; 1167 1167 break; 1168 - case SNDRV_PCM_FORMAT_S32_LE: 1168 + case 32: 1169 1169 iface_len = ADC3XXX_IFACE_32BITS; 1170 1170 width = 32; 1171 1171 break; ··· 1335 1335 .num_dapm_widgets = ARRAY_SIZE(adc3xxx_dapm_widgets), 1336 1336 .dapm_routes = adc3xxx_intercon, 1337 1337 .num_dapm_routes = ARRAY_SIZE(adc3xxx_intercon), 1338 + .endianness = 1, 1338 1339 }; 1339 1340 1340 1341 static const struct i2c_device_id adc3xxx_i2c_id[] = {