[PATCH 6/9] topology: ABI - Change stream formats to a bitwise flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mengdong Lin <mengdong.lin@xxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxx>
Acked-by: Liam Girdwood <liam.r.girdwood@xxxxxxxxxxxxxxx>

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++;
 	}
-- 
1.9.1

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux