From e81c25eab7f3bb0fcfa064512f24f305144fc8c3 Mon Sep 17 00:00:00 2001 From: Yong Zhi Date: Mon, 29 Mar 2021 17:09:29 -0500 Subject: [PATCH] topology: Add CHANNELS_MIN macro for passthrough pipeline Add macro to restrict channel number of PCM capabilities, this will allow channels_min to be configurable. The default behavior is not changed with this patch. Signed-off-by: Yong Zhi --- tools/topology/sof/pipe-passthrough-capture.m4 | 5 ++++- tools/topology/sof/pipe-passthrough-playback.m4 | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/topology/sof/pipe-passthrough-capture.m4 b/tools/topology/sof/pipe-passthrough-capture.m4 index d6dbb1389..007d79b84 100644 --- a/tools/topology/sof/pipe-passthrough-capture.m4 +++ b/tools/topology/sof/pipe-passthrough-capture.m4 @@ -39,8 +39,11 @@ P_GRAPH(pipe-pass-capture-PIPELINE_ID, PIPELINE_ID, indir(`define', concat(`PIPELINE_SINK_', PIPELINE_ID), N_BUFFER(0)) indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID) +ifdef(`CHANNELS_MIN',`', +`define(CHANNELS_MIN, `PIPELINE_CHANNELS')') + # # PCM Configuration # -PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, PIPELINE_CHANNELS, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Capture PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, CHANNELS_MIN, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) diff --git a/tools/topology/sof/pipe-passthrough-playback.m4 b/tools/topology/sof/pipe-passthrough-playback.m4 index fb4e230f2..c586928b9 100644 --- a/tools/topology/sof/pipe-passthrough-playback.m4 +++ b/tools/topology/sof/pipe-passthrough-playback.m4 @@ -39,8 +39,11 @@ P_GRAPH(pipe-pass-playback-PIPELINE_ID, PIPELINE_ID, indir(`define', concat(`PIPELINE_SOURCE_', PIPELINE_ID), N_BUFFER(0)) indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_ID) +ifdef(`CHANNELS_MIN',`', +`define(CHANNELS_MIN, `2')') + # # PCM Configuration # -PCM_CAPABILITIES(Passthrough Playback PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, 2, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536) +PCM_CAPABILITIES(Passthrough Playback PCM_ID, COMP_FORMAT_NAME(PIPELINE_FORMAT), PCM_MIN_RATE, PCM_MAX_RATE, CHANNELS_MIN, PIPELINE_CHANNELS, 2, 16, 192, 16384, 65536, 65536)