File 0078-topology-ABI-Change-stream-formats-to-a-bitwise-flag.patch of Package alsa.openSUSE_Leap_42.1_Update
From 9977accde22c86e783830efd932112dcc9ceb475 Mon Sep 17 00:00:00 2001
From: Mengdong Lin <mengdong.lin@linux.intel.com>
Date: Thu, 5 Nov 2015 20:49:02 +0800
Subject: [PATCH] topology: ABI - Change stream formats to a bitwise flag
The toplogy user space tool will generate this bitwise flag by using
SNDRV_PCM_FORMAT_* exposed by asound.h, and the topology core will copy
this flag when generating DAI streams.
Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
include/sound/asoc.h | 2 +-
src/topology/pcm.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/sound/asoc.h b/include/sound/asoc.h
index acff6ec45ecd..5f857cf6f648 100644
--- a/include/sound/asoc.h
+++ b/include/sound/asoc.h
@@ -190,7 +190,7 @@ struct snd_soc_tplg_ctl_hdr {
struct snd_soc_tplg_stream_caps {
__le32 size; /* in bytes of this structure */
char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
- __le64 formats[SND_SOC_TPLG_MAX_FORMATS]; /* supported formats SNDRV_PCM_FMTBIT_* */
+ __le64 formats; /* supported formats SNDRV_PCM_FMTBIT_* */
__le32 rates; /* supported rates SNDRV_PCM_RATE_* */
__le32 rate_min; /* min rate */
__le32 rate_max; /* max rate */
diff --git a/src/topology/pcm.c b/src/topology/pcm.c
index 8559376f83f9..ec26f9c5a061 100644
--- a/src/topology/pcm.c
+++ b/src/topology/pcm.c
@@ -174,7 +174,7 @@ static int split_format(struct snd_soc_tplg_stream_caps *caps, char *str)
return -EINVAL;
}
- caps->formats[i] = format;
+ caps->formats |= 1 << format;
s = strtok(NULL, ", ");
i++;
}
--
2.6.2