diff mbox series

[RFC,17/17] ASoC: Intel: avs: Kill S24_LE in HDAudio streaming

Message ID 20230811164853.1797547-18-cezary.rojewski@intel.com
State New
Headers show
Series ALSA/ASoC: hda: Address format selection limitations and ambiguity | expand

Commit Message

Cezary Rojewski Aug. 11, 2023, 4:48 p.m. UTC
Eliminate all occurrences of S24_LE within the HDAudio related pcm code,
both HOST and LINK side. Replace those with MSBITS subformats to allow
for granular selection when S32_LE is the format of choice.

Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
---
 sound/soc/intel/avs/pcm.c      | 4 +++-
 sound/soc/intel/avs/topology.c | 9 ++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

Amadeusz Sławiński Aug. 21, 2023, 7:49 a.m. UTC | #1
On 8/11/2023 6:48 PM, Cezary Rojewski wrote:
> Eliminate all occurrences of S24_LE within the HDAudio related pcm code,
> both HOST and LINK side. Replace those with MSBITS subformats to allow
> for granular selection when S32_LE is the format of choice.
> 
> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
> ---
>   sound/soc/intel/avs/pcm.c      | 4 +++-
>   sound/soc/intel/avs/topology.c | 9 ++++++++-
>   2 files changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
> index 31737133b991..83cdce8fead4 100644
> --- a/sound/soc/intel/avs/pcm.c
> +++ b/sound/soc/intel/avs/pcm.c
> @@ -1160,8 +1160,10 @@ static const struct snd_pcm_hardware avs_pcm_hardware = {
>   				  SNDRV_PCM_INFO_RESUME |
>   				  SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
>   	.formats		= SNDRV_PCM_FMTBIT_S16_LE |
> -				  SNDRV_PCM_FMTBIT_S24_LE |
>   				  SNDRV_PCM_FMTBIT_S32_LE,
> +	.subformats		= SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
> +				  SNDRV_PCM_SUBFMTBIT_MSBITS_24 |
> +				  SNDRV_PCM_SUBFMTBIT_MSBITS_32,
>   	.buffer_bytes_max	= AZX_MAX_BUF_SIZE,
>   	.period_bytes_min	= 128,
>   	.period_bytes_max	= AZX_MAX_BUF_SIZE / 2,
> diff --git a/sound/soc/intel/avs/topology.c b/sound/soc/intel/avs/topology.c
> index 118f386d8582..5130261f0b33 100644
> --- a/sound/soc/intel/avs/topology.c
> +++ b/sound/soc/intel/avs/topology.c
> @@ -1620,8 +1620,15 @@ static int avs_dai_load(struct snd_soc_component *comp, int index,
>   			struct snd_soc_dai_driver *dai_drv, struct snd_soc_tplg_pcm *pcm,
>   			struct snd_soc_dai *dai)
>   {
> -	if (pcm)
> +	u64 subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
> +			 SNDRV_PCM_SUBFMTBIT_MSBITS_24;

SNDRV_PCM_SUBFMTBIT_MSBITS_32 seems to be missing in the above?

> +
> +	if (pcm) {
>   		dai_drv->ops = &avs_dai_fe_ops;
> +		dai_drv->capture.subformats |= subformats;
> +		dai_drv->playback.subformats |= subformats;
> +	}
> +
>   	return 0;
>   }
>
diff mbox series

Patch

diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c
index 31737133b991..83cdce8fead4 100644
--- a/sound/soc/intel/avs/pcm.c
+++ b/sound/soc/intel/avs/pcm.c
@@ -1160,8 +1160,10 @@  static const struct snd_pcm_hardware avs_pcm_hardware = {
 				  SNDRV_PCM_INFO_RESUME |
 				  SNDRV_PCM_INFO_NO_PERIOD_WAKEUP,
 	.formats		= SNDRV_PCM_FMTBIT_S16_LE |
-				  SNDRV_PCM_FMTBIT_S24_LE |
 				  SNDRV_PCM_FMTBIT_S32_LE,
+	.subformats		= SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
+				  SNDRV_PCM_SUBFMTBIT_MSBITS_24 |
+				  SNDRV_PCM_SUBFMTBIT_MSBITS_32,
 	.buffer_bytes_max	= AZX_MAX_BUF_SIZE,
 	.period_bytes_min	= 128,
 	.period_bytes_max	= AZX_MAX_BUF_SIZE / 2,
diff --git a/sound/soc/intel/avs/topology.c b/sound/soc/intel/avs/topology.c
index 118f386d8582..5130261f0b33 100644
--- a/sound/soc/intel/avs/topology.c
+++ b/sound/soc/intel/avs/topology.c
@@ -1620,8 +1620,15 @@  static int avs_dai_load(struct snd_soc_component *comp, int index,
 			struct snd_soc_dai_driver *dai_drv, struct snd_soc_tplg_pcm *pcm,
 			struct snd_soc_dai *dai)
 {
-	if (pcm)
+	u64 subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 |
+			 SNDRV_PCM_SUBFMTBIT_MSBITS_24;
+
+	if (pcm) {
 		dai_drv->ops = &avs_dai_fe_ops;
+		dai_drv->capture.subformats |= subformats;
+		dai_drv->playback.subformats |= subformats;
+	}
+
 	return 0;
 }