]> git.alsa-project.org Git - alsa-lib.git/commitdiff
topology: ABI - Change stream formats to a bitwise flag
authorMengdong Lin <mengdong.lin@linux.intel.com>
Thu, 5 Nov 2015 12:49:02 +0000 (20:49 +0800)
committerJaroslav Kysela <perex@perex.cz>
Thu, 5 Nov 2015 13:53:24 +0000 (14:53 +0100)
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
src/topology/pcm.c

index acff6ec45ecd283b377a1107db44a937bd425518..5f857cf6f648043999037dfb6c9038d942783fd9 100644 (file)
@@ -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 */
index 8559376f83f989b22aa62f7525a0b760f8647d60..ec26f9c5a061ba97073a141baa628061431c884c 100644 (file)
@@ -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++;
        }