未验证 提交 f5e0084b 编写于 作者: C Charles Keepax 提交者: Mark Brown

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: NCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220504170905.332415-25-ckeepax@opensource.cirrus.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 80827c12
...@@ -1152,20 +1152,20 @@ static int adc3xxx_hw_params(struct snd_pcm_substream *substream, ...@@ -1152,20 +1152,20 @@ static int adc3xxx_hw_params(struct snd_pcm_substream *substream,
return i; return i;
/* select data word length */ /* select data word length */
switch (params_format(params)) { switch (params_width(params)) {
case SNDRV_PCM_FORMAT_S16_LE: case 16:
iface_len = ADC3XXX_IFACE_16BITS; iface_len = ADC3XXX_IFACE_16BITS;
width = 16; width = 16;
break; break;
case SNDRV_PCM_FORMAT_S20_3LE: case 20:
iface_len = ADC3XXX_IFACE_20BITS; iface_len = ADC3XXX_IFACE_20BITS;
width = 20; width = 20;
break; break;
case SNDRV_PCM_FORMAT_S24_LE: case 24:
iface_len = ADC3XXX_IFACE_24BITS; iface_len = ADC3XXX_IFACE_24BITS;
width = 24; width = 24;
break; break;
case SNDRV_PCM_FORMAT_S32_LE: case 32:
iface_len = ADC3XXX_IFACE_32BITS; iface_len = ADC3XXX_IFACE_32BITS;
width = 32; width = 32;
break; break;
...@@ -1335,6 +1335,7 @@ static const struct snd_soc_component_driver soc_component_dev_adc3xxx = { ...@@ -1335,6 +1335,7 @@ static const struct snd_soc_component_driver soc_component_dev_adc3xxx = {
.num_dapm_widgets = ARRAY_SIZE(adc3xxx_dapm_widgets), .num_dapm_widgets = ARRAY_SIZE(adc3xxx_dapm_widgets),
.dapm_routes = adc3xxx_intercon, .dapm_routes = adc3xxx_intercon,
.num_dapm_routes = ARRAY_SIZE(adc3xxx_intercon), .num_dapm_routes = ARRAY_SIZE(adc3xxx_intercon),
.endianness = 1,
}; };
static const struct i2c_device_id adc3xxx_i2c_id[] = { static const struct i2c_device_id adc3xxx_i2c_id[] = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册