[Sound-open-firmware] [PATCH v4 6/8] topology: create m4 wrapper SectionPCMCapabilities
Ranjani Sridharan
ranjani.sridharan at linux.intel.com
Mon Mar 5 22:58:31 CET 2018
This patch adds a m4 wrpper for PCM Capabilities sections
in pipeline definition
Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
topology/m4/local.m4 | 16 ++++++++++++++++
topology/sof/pipe-low-latency-capture.m4 | 16 +---------------
topology/sof/pipe-low-latency-playback.m4 | 16 ++--------------
topology/sof/pipe-passthrough-capture.m4 | 15 +--------------
topology/sof/pipe-passthrough-playback.m4 | 15 +--------------
topology/sof/pipe-pcm-media.m4 | 14 +-------------
topology/sof/pipe-src-capture.m4 | 15 +--------------
topology/sof/pipe-src-playback.m4 | 15 +--------------
topology/sof/pipe-volume-capture.m4 | 14 +-------------
topology/sof/pipe-volume-playback.m4 | 17 ++---------------
10 files changed, 27 insertions(+), 126 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4
index 690f677..90d690e 100644
--- a/topology/m4/local.m4
+++ b/topology/m4/local.m4
@@ -615,6 +615,22 @@ define(`P_GRAPH',
` ]'
`}')
+dnl PCM_CAPABILITIES(name, formats, rate_min, rate_max, channels_min, channels_max, periods_min, periods_max, period_size_min, period_size_max, buffer_size_min, buffer_size_max)
+define(`PCM_CAPABILITIES',
+`SectionPCMCapabilities.STR($1) {'
+`'
+` formats "$2"'
+` rate_min STR($3)'
+` rate_max STR($4)'
+` channels_min STR($5)'
+` channels_max STR($6)'
+` periods_min STR($7)'
+` periods_max STR($8)'
+` period_size_min STR($9)'
+` period_size_max STR($10)'
+` buffer_size_min STR($11)'
+` buffer_size_max STR($12)'
+`}')
divert(0) dnl
diff --git a/topology/sof/pipe-low-latency-capture.m4 b/topology/sof/pipe-low-latency-capture.m4
index 07b59ad..7adfd14 100644
--- a/topology/sof/pipe-low-latency-capture.m4
+++ b/topology/sof/pipe-low-latency-capture.m4
@@ -60,18 +60,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Capture PCM_ID
# PCM Configuration
#
-SectionPCMCapabilities.STR(Low Latency Capture PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "48000"
- rate_max "48000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "4"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
-
+PCM_CAPABILITIES(Low Latency Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 4, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-low-latency-playback.m4 b/topology/sof/pipe-low-latency-playback.m4
index 7c39f16..11cf07d 100644
--- a/topology/sof/pipe-low-latency-playback.m4
+++ b/topology/sof/pipe-low-latency-playback.m4
@@ -108,19 +108,7 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Low Latency Playback PCM_I
# PCM Configuration
#
+
# PCM capabilities supported by FW
-SectionPCMCapabilities.STR(Low Latency Playback PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "48000"
- rate_max "48000"
- channels_min "2"
- channels_max "2"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
+PCM_CAPABILITIES(Low Latency Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 2, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-passthrough-capture.m4 b/topology/sof/pipe-passthrough-capture.m4
index 8ef8a81..cfa357a 100644
--- a/topology/sof/pipe-passthrough-capture.m4
+++ b/topology/sof/pipe-passthrough-capture.m4
@@ -51,17 +51,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID
# PCM Configuration
#
-SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "48000"
- rate_max "48000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
+PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-passthrough-playback.m4 b/topology/sof/pipe-passthrough-playback.m4
index a26b5eb..3218431 100644
--- a/topology/sof/pipe-passthrough-playback.m4
+++ b/topology/sof/pipe-passthrough-playback.m4
@@ -51,17 +51,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I
# PCM Configuration
#
-SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "48000"
- rate_max "48000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
+PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-media.m4
index 8cb8ed5..1171d07 100644
--- a/topology/sof/pipe-pcm-media.m4
+++ b/topology/sof/pipe-pcm-media.m4
@@ -97,19 +97,7 @@ W_PIPELINE(N_SRC(0), SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCHE
# PCM capabilities supported by FW
-SectionPCMCapabilities.STR(Media Playback PCM_ID) {
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "8000"
- rate_max "192000"
- channels_min "2"
- channels_max "2"
- periods_min "2"
- periods_max "32"
- period_size_min "192"
- period_size_max "262144"
- buffer_size_min "8388608"
- buffer_size_max "8388608"
-}
+PCM_CAPABILITIES(Media Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 8000, 192000, 2, 2, 2, 32, 192, 262144, 8388608, 8388608)
# PCM Low Latency Playback and Capture
SectionPCM.STR(Media Playback PCM_ID) {
diff --git a/topology/sof/pipe-src-capture.m4 b/topology/sof/pipe-src-capture.m4
index 44bb030..d8e04a8 100644
--- a/topology/sof/pipe-src-capture.m4
+++ b/topology/sof/pipe-src-capture.m4
@@ -77,17 +77,4 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID
# PCM Configuration
#
-SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "8000"
- rate_max "96000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
+PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 8000, 96000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-src-playback.m4 b/topology/sof/pipe-src-playback.m4
index d34bc8a..c9b4159 100644
--- a/topology/sof/pipe-src-playback.m4
+++ b/topology/sof/pipe-src-playback.m4
@@ -77,18 +77,5 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I
# PCM Configuration
#
-SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "8000"
- rate_max "96000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
+PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 8000, 96000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-volume-capture.m4
index 0aa10bc..299a0f8 100644
--- a/topology/sof/pipe-volume-capture.m4
+++ b/topology/sof/pipe-volume-capture.m4
@@ -72,17 +72,5 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Capture PCM_ID
# PCM Configuration
#
-SectionPCMCapabilities.STR(Passthrough Capture PCM_ID) {
+PCM_CAPABILITIES(Passthrough Capture PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "48000"
- rate_max "48000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
diff --git a/topology/sof/pipe-volume-playback.m4 b/topology/sof/pipe-volume-playback.m4
index 4ca8ab7..3e3f98e 100644
--- a/topology/sof/pipe-volume-playback.m4
+++ b/topology/sof/pipe-volume-playback.m4
@@ -80,20 +80,7 @@ indir(`define', concat(`PIPELINE_PCM_', PIPELINE_ID), Passthrough Playback PCM_I
#
# PCM Configuration
-#
-SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) {
-
- formats "S32_LE,S24_LE,S16_LE"
- rate_min "48000"
- rate_max "48000"
- channels_min "2"
- channels_max "4"
- periods_min "2"
- periods_max "16"
- period_size_min "192"
- period_size_max "16384"
- buffer_size_min "65536"
- buffer_size_max "65536"
-}
+#
+PCM_CAPABILITIES(Passthrough Playback PCM_ID, `S32_LE,S24_LE,S16_LE', 48000, 48000, 2, 4, 2, 16, 192, 16384, 65536, 65536)
--
2.14.1
More information about the Sound-open-firmware
mailing list