From: Mengdong Lin mengdong.lin@linux.intel.com
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
diff --git a/include/sound/asoc.h b/include/sound/asoc.h index acff6ec..5f857cf 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 8559376..ec26f9c 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++; }