From 79f97a6a0c07b9eb44e68fd78f8c38ae6a4cc5f3 Mon Sep 17 00:00:00 2001 From: Keyon Jie Date: Sat, 11 Apr 2020 00:31:11 +0800 Subject: [PATCH] Topology: utils: add macros to get format values Add macros to get format values from strings. Signed-off-by: Keyon Jie --- tools/topology/m4/utils.m4 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/topology/m4/utils.m4 b/tools/topology/m4/utils.m4 index 6538f6a1a..f0696d8ea 100644 --- a/tools/topology/m4/utils.m4 +++ b/tools/topology/m4/utils.m4 @@ -49,6 +49,14 @@ define(`COMP_FORMAT_NAME', $1, `float', `FLOAT_LE', )') +dnl COMP_FORMAT_VALUE(FMT) +define(`COMP_FORMAT_VALUE', +`ifelse( + $1, `s16le', `0x00', + $1, `s24le', `0x01', + $1, `s32le', `0x02', + )') + dnl P_GRAPH(NAME, PIPELINE_ID, CONNECTIONS) define(`P_GRAPH', `SectionGraph.STR($1 $2) {'