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.
This commit is contained in:
commit
795dd8d3b8
|
@ -169,6 +169,15 @@ struct snd_soc_component_driver {
|
|||
unsigned int idle_bias_on:1;
|
||||
unsigned int suspend_bias_off:1;
|
||||
unsigned int use_pmdown_time:1; /* care pmdown_time at stop */
|
||||
/*
|
||||
* Indicates that the component does not care about the endianness of
|
||||
* PCM audio data and the core will ensure that both LE and BE variants
|
||||
* of each used format are present. Typically this is because the
|
||||
* component sits behind a bus that abstracts away the endian of the
|
||||
* original data, ie. one for which the transmission endian is defined
|
||||
* (I2S/SLIMbus/SoundWire), or the concept of endian doesn't exist (PDM,
|
||||
* analogue).
|
||||
*/
|
||||
unsigned int endianness:1;
|
||||
unsigned int non_legacy_dai_naming:1;
|
||||
|
||||
|
|
|
@ -458,7 +458,6 @@ static const struct snd_soc_component_driver atmel_classd_cpu_dai_component = {
|
|||
.num_controls = ARRAY_SIZE(atmel_classd_snd_controls),
|
||||
.idle_bias_on = 1,
|
||||
.use_pmdown_time = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/* ASoC sound card */
|
||||
|
|
|
@ -481,7 +481,6 @@ static const struct snd_soc_component_driver atmel_pdmic_cpu_dai_component = {
|
|||
.num_controls = ARRAY_SIZE(atmel_pdmic_snd_controls),
|
||||
.idle_bias_on = 1,
|
||||
.use_pmdown_time = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/* ASoC sound card */
|
||||
|
|
|
@ -859,6 +859,7 @@ static const struct snd_soc_component_driver adau1372_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(adau1372_dapm_widgets),
|
||||
.dapm_routes = adau1372_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(adau1372_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct snd_soc_dai_ops adau1372_dai_ops = {
|
||||
|
|
|
@ -232,11 +232,11 @@ static int i2s_rx_hw_params(struct snd_pcm_substream *substream,
|
|||
if (params_rate(params) != 48000)
|
||||
return -EINVAL;
|
||||
|
||||
switch (params_format(params)) {
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
switch (params_width(params)) {
|
||||
case 16:
|
||||
depth = EC_CODEC_I2S_RX_SAMPLE_DEPTH_16;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case 24:
|
||||
depth = EC_CODEC_I2S_RX_SAMPLE_DEPTH_24;
|
||||
break;
|
||||
default:
|
||||
|
@ -387,6 +387,7 @@ static const struct snd_soc_component_driver i2s_rx_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(i2s_rx_dapm_widgets),
|
||||
.dapm_routes = i2s_rx_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(i2s_rx_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static void *wov_map_shm(struct cros_ec_codec_priv *priv,
|
||||
|
|
|
@ -1113,6 +1113,8 @@ static const struct snd_soc_component_driver soc_component_dev_cs35l41 = {
|
|||
.controls = cs35l41_aud_controls,
|
||||
.num_controls = ARRAY_SIZE(cs35l41_aud_controls),
|
||||
.set_sysclk = cs35l41_component_set_sysclk,
|
||||
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int cs35l41_handle_pdata(struct device *dev, struct cs35l41_platform_data *pdata)
|
||||
|
|
|
@ -663,6 +663,7 @@ static const struct snd_soc_component_driver soc_component_cs4234 = {
|
|||
.non_legacy_dai_naming = 1,
|
||||
.idle_bias_on = 1,
|
||||
.suspend_bias_off = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct regmap_config cs4234_regmap = {
|
||||
|
|
|
@ -32,18 +32,9 @@
|
|||
#include <linux/gpio/consumer.h>
|
||||
#include <linux/of_device.h>
|
||||
|
||||
/*
|
||||
* The codec isn't really big-endian or little-endian, since the I2S
|
||||
* interface requires data to be sent serially with the MSbit first.
|
||||
* However, to support BE and LE I2S devices, we specify both here. That
|
||||
* way, ALSA will always match the bit patterns.
|
||||
*/
|
||||
#define CS4270_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
|
||||
SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE)
|
||||
#define CS4270_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S20_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE)
|
||||
|
||||
/* CS4270 registers addresses */
|
||||
#define CS4270_CHIPID 0x01 /* Chip ID */
|
||||
|
|
|
@ -51,11 +51,8 @@ struct cs42l51_private {
|
|||
struct regmap *regmap;
|
||||
};
|
||||
|
||||
#define CS42L51_FORMATS ( \
|
||||
SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE)
|
||||
#define CS42L51_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE)
|
||||
|
||||
static int cs42l51_get_chan_mix(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
|
|
|
@ -223,12 +223,9 @@ static const struct snd_soc_dapm_route cs4349_routes[] = {
|
|||
{"OutputB", NULL, "HiFi DAC"},
|
||||
};
|
||||
|
||||
#define CS4349_PCM_FORMATS (SNDRV_PCM_FMTBIT_S8 | \
|
||||
SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE | \
|
||||
#define CS4349_PCM_FORMATS (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_LE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S20_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE | \
|
||||
SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
#define CS4349_PCM_RATES SNDRV_PCM_RATE_8000_192000
|
||||
|
|
|
@ -1527,6 +1527,7 @@ static const struct snd_soc_component_driver soc_codec_driver_cx2072x = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(cx2072x_dapm_widgets),
|
||||
.dapm_routes = cx2072x_intercon,
|
||||
.num_dapm_routes = ARRAY_SIZE(cx2072x_intercon),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
@ -571,13 +571,14 @@ static const struct snd_soc_dapm_widget hdac_hda_dapm_widgets[] = {
|
|||
};
|
||||
|
||||
static const struct snd_soc_component_driver hdac_hda_codec = {
|
||||
.probe = hdac_hda_codec_probe,
|
||||
.remove = hdac_hda_codec_remove,
|
||||
.idle_bias_on = false,
|
||||
.dapm_widgets = hdac_hda_dapm_widgets,
|
||||
.num_dapm_widgets = ARRAY_SIZE(hdac_hda_dapm_widgets),
|
||||
.dapm_routes = hdac_hda_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(hdac_hda_dapm_routes),
|
||||
.probe = hdac_hda_codec_probe,
|
||||
.remove = hdac_hda_codec_remove,
|
||||
.dapm_widgets = hdac_hda_dapm_widgets,
|
||||
.num_dapm_widgets = ARRAY_SIZE(hdac_hda_dapm_widgets),
|
||||
.dapm_routes = hdac_hda_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(hdac_hda_dapm_routes),
|
||||
.idle_bias_on = false,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int hdac_hda_dev_probe(struct hdac_device *hdev)
|
||||
|
|
|
@ -727,10 +727,8 @@ static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
|
|||
SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_176400 |\
|
||||
SNDRV_PCM_RATE_192000)
|
||||
|
||||
#define SPDIF_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |\
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE)
|
||||
#define SPDIF_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE)
|
||||
|
||||
/*
|
||||
* This list is only for formats allowed on the I2S bus. So there is
|
||||
|
@ -740,12 +738,9 @@ static const struct snd_soc_dai_ops hdmi_codec_spdif_dai_ops = {
|
|||
* problems, we should add the video side driver an option to disable
|
||||
* them.
|
||||
*/
|
||||
#define I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |\
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\
|
||||
SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
|
||||
#define I2S_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_LE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_LE)
|
||||
|
||||
static struct snd_kcontrol_new hdmi_codec_controls[] = {
|
||||
{
|
||||
|
|
|
@ -212,12 +212,13 @@ static struct snd_soc_dai_driver lochnagar_sc_dai[] = {
|
|||
};
|
||||
|
||||
static const struct snd_soc_component_driver lochnagar_sc_driver = {
|
||||
.non_legacy_dai_naming = 1,
|
||||
|
||||
.dapm_widgets = lochnagar_sc_widgets,
|
||||
.num_dapm_widgets = ARRAY_SIZE(lochnagar_sc_widgets),
|
||||
.dapm_routes = lochnagar_sc_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(lochnagar_sc_routes),
|
||||
|
||||
.non_legacy_dai_naming = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int lochnagar_sc_probe(struct platform_device *pdev)
|
||||
|
|
|
@ -291,6 +291,7 @@ static const struct snd_soc_component_driver max98504_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(max98504_dapm_widgets),
|
||||
.dapm_routes = max98504_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(max98504_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct regmap_config max98504_regmap = {
|
||||
|
|
|
@ -282,12 +282,9 @@ static const struct snd_soc_dai_ops mt6351_codec_dai_ops = {
|
|||
.hw_params = mt6351_codec_dai_hw_params,
|
||||
};
|
||||
|
||||
#define MT6351_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |\
|
||||
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
|
||||
SNDRV_PCM_FMTBIT_U24_LE | SNDRV_PCM_FMTBIT_U24_BE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\
|
||||
SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_U32_BE)
|
||||
#define MT6351_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE)
|
||||
|
||||
static struct snd_soc_dai_driver mt6351_dai_driver[] = {
|
||||
{
|
||||
|
@ -1448,6 +1445,7 @@ static const struct snd_soc_component_driver mt6351_soc_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(mt6351_dapm_widgets),
|
||||
.dapm_routes = mt6351_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(mt6351_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int mt6351_codec_driver_probe(struct platform_device *pdev)
|
||||
|
|
|
@ -2340,12 +2340,9 @@ static const struct snd_soc_dai_ops mt6358_codec_dai_ops = {
|
|||
.hw_params = mt6358_codec_dai_hw_params,
|
||||
};
|
||||
|
||||
#define MT6358_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |\
|
||||
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
|
||||
SNDRV_PCM_FMTBIT_U24_LE | SNDRV_PCM_FMTBIT_U24_BE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\
|
||||
SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_U32_BE)
|
||||
#define MT6358_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE)
|
||||
|
||||
static struct snd_soc_dai_driver mt6358_dai_driver[] = {
|
||||
{
|
||||
|
@ -2433,6 +2430,7 @@ static const struct snd_soc_component_driver mt6358_soc_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(mt6358_dapm_widgets),
|
||||
.dapm_routes = mt6358_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(mt6358_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static void mt6358_parse_dt(struct mt6358_priv *priv)
|
||||
|
|
|
@ -2576,12 +2576,9 @@ static const struct snd_soc_dai_ops mt6359_codec_dai_ops = {
|
|||
.shutdown = mt6359_codec_dai_shutdown,
|
||||
};
|
||||
|
||||
#define MT6359_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |\
|
||||
SNDRV_PCM_FMTBIT_U16_LE | SNDRV_PCM_FMTBIT_U16_BE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE |\
|
||||
SNDRV_PCM_FMTBIT_U24_LE | SNDRV_PCM_FMTBIT_U24_BE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |\
|
||||
SNDRV_PCM_FMTBIT_U32_LE | SNDRV_PCM_FMTBIT_U32_BE)
|
||||
#define MT6359_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_U16_LE |\
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE |\
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_U32_LE)
|
||||
|
||||
static struct snd_soc_dai_driver mt6359_dai_driver[] = {
|
||||
{
|
||||
|
@ -2739,6 +2736,7 @@ static const struct snd_soc_component_driver mt6359_soc_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(mt6359_dapm_widgets),
|
||||
.dapm_routes = mt6359_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(mt6359_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int mt6359_parse_dt(struct mt6359_priv *priv)
|
||||
|
|
|
@ -323,6 +323,7 @@ static const struct snd_soc_component_driver mt6660_component_driver = {
|
|||
.num_dapm_routes = ARRAY_SIZE(mt6660_component_dapm_routes),
|
||||
|
||||
.idle_bias_on = false, /* idle_bias_off = true */
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int mt6660_component_aif_hw_params(struct snd_pcm_substream *substream,
|
||||
|
|
|
@ -255,6 +255,7 @@ static const struct snd_soc_component_driver pcm3060_soc_comp_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(pcm3060_dapm_widgets),
|
||||
.dapm_routes = pcm3060_dapm_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(pcm3060_dapm_map),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
/* regmap */
|
||||
|
|
|
@ -515,7 +515,7 @@ static struct snd_soc_dai_driver rt1019_dai[] = {
|
|||
};
|
||||
|
||||
static const struct snd_soc_component_driver soc_component_dev_rt1019 = {
|
||||
.probe = rt1019_probe,
|
||||
.probe = rt1019_probe,
|
||||
.controls = rt1019_snd_controls,
|
||||
.num_controls = ARRAY_SIZE(rt1019_snd_controls),
|
||||
.dapm_widgets = rt1019_dapm_widgets,
|
||||
|
@ -523,6 +523,7 @@ static const struct snd_soc_component_driver soc_component_dev_rt1019 = {
|
|||
.dapm_routes = rt1019_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt1019_dapm_routes),
|
||||
.non_legacy_dai_naming = 1,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct regmap_config rt1019_regmap = {
|
||||
|
|
|
@ -615,6 +615,7 @@ static const struct snd_soc_component_driver soc_component_sdw_rt1308 = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(rt1308_dapm_widgets),
|
||||
.dapm_routes = rt1308_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt1308_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct snd_soc_dai_ops rt1308_aif_dai_ops = {
|
||||
|
|
|
@ -597,6 +597,7 @@ static const struct snd_soc_component_driver soc_component_sdw_rt1316 = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(rt1316_dapm_widgets),
|
||||
.dapm_routes = rt1316_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt1316_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct snd_soc_dai_ops rt1316_aif_dai_ops = {
|
||||
|
|
|
@ -853,6 +853,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rt700 = {
|
|||
.dapm_routes = rt700_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt700_audio_map),
|
||||
.set_jack = rt700_set_jack_detect,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int rt700_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
|
|
@ -1208,6 +1208,7 @@ static const struct snd_soc_component_driver soc_sdca_dev_rt711 = {
|
|||
.num_dapm_routes = ARRAY_SIZE(rt711_sdca_audio_map),
|
||||
.set_jack = rt711_sdca_set_jack_detect,
|
||||
.remove = rt711_sdca_remove,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int rt711_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
|
|
@ -950,6 +950,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rt711 = {
|
|||
.num_dapm_routes = ARRAY_SIZE(rt711_audio_map),
|
||||
.set_jack = rt711_set_jack_detect,
|
||||
.remove = rt711_remove,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int rt711_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
|
|
@ -765,6 +765,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rt715_sdca = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(rt715_sdca_dapm_widgets),
|
||||
.dapm_routes = rt715_sdca_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt715_sdca_audio_map),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int rt715_sdca_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
|
|
@ -745,6 +745,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rt715 = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(rt715_dapm_widgets),
|
||||
.dapm_routes = rt715_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt715_audio_map),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int rt715_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
|
|
@ -178,6 +178,7 @@ static const struct snd_soc_component_driver rt9120_component_driver = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(rt9120_dapm_widgets),
|
||||
.dapm_routes = rt9120_dapm_routes,
|
||||
.num_dapm_routes = ARRAY_SIZE(rt9120_dapm_routes),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int rt9120_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
|
||||
|
|
|
@ -38,6 +38,7 @@ static void sdw_mockup_component_remove(struct snd_soc_component *component)
|
|||
static const struct snd_soc_component_driver snd_soc_sdw_mockup_component = {
|
||||
.probe = sdw_mockup_component_probe,
|
||||
.remove = sdw_mockup_component_remove,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int sdw_mockup_set_sdw_stream(struct snd_soc_dai *dai, void *sdw_stream,
|
||||
|
|
|
@ -48,12 +48,9 @@
|
|||
SNDRV_PCM_RATE_192000)
|
||||
|
||||
#define STA32X_FORMATS \
|
||||
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE | \
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE)
|
||||
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
/* Power-up register defaults */
|
||||
static const struct reg_default sta32x_regs[] = {
|
||||
|
|
|
@ -48,12 +48,9 @@
|
|||
SNDRV_PCM_RATE_192000)
|
||||
|
||||
#define STA350_FORMATS \
|
||||
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE | \
|
||||
SNDRV_PCM_FMTBIT_S18_3LE | SNDRV_PCM_FMTBIT_S18_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S20_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S24_BE | \
|
||||
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE)
|
||||
(SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_3LE | \
|
||||
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
|
||||
|
||||
/* Power-up register defaults */
|
||||
static const struct reg_default sta350_regs[] = {
|
||||
|
|
|
@ -1152,20 +1152,20 @@ static int adc3xxx_hw_params(struct snd_pcm_substream *substream,
|
|||
return i;
|
||||
|
||||
/* select data word length */
|
||||
switch (params_format(params)) {
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
switch (params_width(params)) {
|
||||
case 16:
|
||||
iface_len = ADC3XXX_IFACE_16BITS;
|
||||
width = 16;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S20_3LE:
|
||||
case 20:
|
||||
iface_len = ADC3XXX_IFACE_20BITS;
|
||||
width = 20;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case 24:
|
||||
iface_len = ADC3XXX_IFACE_24BITS;
|
||||
width = 24;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case 32:
|
||||
iface_len = ADC3XXX_IFACE_32BITS;
|
||||
width = 32;
|
||||
break;
|
||||
|
@ -1335,6 +1335,7 @@ static const struct snd_soc_component_driver soc_component_dev_adc3xxx = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(adc3xxx_dapm_widgets),
|
||||
.dapm_routes = adc3xxx_intercon,
|
||||
.num_dapm_routes = ARRAY_SIZE(adc3xxx_intercon),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static const struct i2c_device_id adc3xxx_i2c_id[] = {
|
||||
|
|
|
@ -3120,18 +3120,17 @@ static int set_aif_sample_format(struct snd_soc_component *component,
|
|||
unsigned int width;
|
||||
int ret;
|
||||
|
||||
switch (format) {
|
||||
case SNDRV_PCM_FORMAT_S16_LE:
|
||||
switch (snd_pcm_format_width(format)) {
|
||||
case 16:
|
||||
width = FV_WL_16;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S20_3LE:
|
||||
case 20:
|
||||
width = FV_WL_20;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_3LE:
|
||||
case 24:
|
||||
width = FV_WL_24;
|
||||
break;
|
||||
case SNDRV_PCM_FORMAT_S24_LE:
|
||||
case SNDRV_PCM_FORMAT_S32_LE:
|
||||
case 32:
|
||||
width = FV_WL_32;
|
||||
break;
|
||||
default:
|
||||
|
@ -3326,6 +3325,7 @@ static const struct snd_soc_component_driver soc_component_dev_tscs454 = {
|
|||
.num_dapm_routes = ARRAY_SIZE(tscs454_intercon),
|
||||
.controls = tscs454_snd_controls,
|
||||
.num_controls = ARRAY_SIZE(tscs454_snd_controls),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
#define TSCS454_RATES SNDRV_PCM_RATE_8000_96000
|
||||
|
|
|
@ -4924,6 +4924,7 @@ static const struct snd_soc_component_driver wcd9335_component_drv = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(wcd9335_dapm_widgets),
|
||||
.dapm_routes = wcd9335_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(wcd9335_audio_map),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int wcd9335_probe(struct wcd9335_codec *wcd)
|
||||
|
|
|
@ -5847,6 +5847,7 @@ static const struct snd_soc_component_driver wcd934x_component_drv = {
|
|||
.dapm_routes = wcd934x_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(wcd934x_audio_map),
|
||||
.set_jack = wcd934x_codec_set_jack,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int wcd934x_codec_parse_data(struct wcd934x_codec *wcd)
|
||||
|
|
|
@ -4168,6 +4168,7 @@ static const struct snd_soc_component_driver soc_codec_dev_wcd938x = {
|
|||
.dapm_routes = wcd938x_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(wcd938x_audio_map),
|
||||
.set_jack = wcd938x_codec_set_jack,
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static void wcd938x_dt_parse_micbias_info(struct device *dev, struct wcd938x_priv *wcd)
|
||||
|
|
|
@ -1066,6 +1066,7 @@ static const struct snd_soc_component_driver wsa881x_component_drv = {
|
|||
.num_dapm_widgets = ARRAY_SIZE(wsa881x_dapm_widgets),
|
||||
.dapm_routes = wsa881x_audio_map,
|
||||
.num_dapm_routes = ARRAY_SIZE(wsa881x_audio_map),
|
||||
.endianness = 1,
|
||||
};
|
||||
|
||||
static int wsa881x_update_status(struct sdw_slave *slave,
|
||||
|
|
Loading…
Reference in New Issue