From 9d6283e99471c8eeff74f377e2524021841f80cd Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Wed, 4 Jul 2018 10:48:02 +0800 Subject: [PATCH 1/2] topology: Add SOF_TKN_DAI_BESPOKE_CONFIG for DAI bespoke config Signed-off-by: Pan Xiuli --- topology/sof/tokens.m4 | 1 + 1 file changed, 1 insertion(+) diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index 4aa2fea..8662904 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -18,6 +18,7 @@ SectionVendorTokens."sof_dai_tokens" { SOF_TKN_DAI_DMAC_CONFIG "153" SOF_TKN_DAI_TYPE "154" SOF_TKN_DAI_INDEX "155" + SOF_TKN_DAI_BESPOKE_CONFIG "157" } SectionVendorTokens."sof_sched_tokens" { From 8f27227a5d45b137559a18bc8d2d8a37bae6c1bb Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Wed, 4 Jul 2018 11:53:57 +0800 Subject: [PATCH 2/2] topology: add SSP bespoke config data for SSP dais Add DAI bespoke config data for dai_in widget, bind DAI bespoke config to DAI comp. Signed-off-by: Pan Xiuli --- topology/m4/dai.m4 | 10 +++++++--- topology/platform/common/ssp.m4 | 14 ++++++++++++++ topology/sof-apl-nocodec.m4 | 18 ++++++++++++------ topology/sof-apl-pcm512x.m4 | 3 ++- topology/sof-apl-tdf8532.m4 | 15 ++++++++++----- topology/sof-bdw-rt286.m4 | 3 ++- topology/sof-bdw-rt5640.m4 | 3 ++- topology/sof-byt-da7213.m4 | 3 ++- topology/sof-byt-nocodec.m4 | 3 ++- topology/sof-byt-rt5640.m4 | 3 ++- topology/sof-byt-rt5645.m4 | 3 ++- topology/sof-byt-rt5651.m4 | 3 ++- topology/sof-cht-max98090.m4 | 3 ++- topology/sof-cht-nocodec.m4 | 3 ++- topology/sof-cnl-rt274.m4 | 3 ++- topology/sof-hsw-rt5640.m4 | 3 ++- topology/sof/pipe-dai-playback.m4 | 2 +- topology/test/test-all.m4 | 3 ++- 18 files changed, 70 insertions(+), 28 deletions(-) diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4 index b0802af..465f156 100644 --- a/topology/m4/dai.m4 +++ b/topology/m4/dai.m4 @@ -7,7 +7,7 @@ define(`N_DAI', DAI_NAME) define(`N_DAI_OUT', DAI_NAME`.OUT') define(`N_DAI_IN', DAI_NAME`.IN') -dnl W_DAI_OUT(type, index, dai_link, format, periods_sink, periods_source, preload) +dnl W_DAI_OUT(type, index, dai_link, format, periods_sink, periods_source, preload, bespoke_data) define(`W_DAI_OUT', `SectionVendorTuples."'N_DAI_OUT($2)`_tuples_w_comp" {' ` tokens "sof_comp_tokens"' @@ -47,6 +47,7 @@ define(`W_DAI_OUT', `SectionData."'N_DAI_OUT($2)`_data_comp_str" {' ` tuples "'N_DAI_OUT($2)`_tuples_comp_str"' `}' +$8 `SectionWidget."'N_DAI_OUT`" {' ` index "'PIPELINE_ID`"' ` type "dai_in"' @@ -57,6 +58,7 @@ define(`W_DAI_OUT', ` "'N_DAI_OUT($2)`_data_w_comp"' ` "'N_DAI_OUT($2)`_data_str"' ` "'N_DAI_OUT($2)`_data_comp_str"' +`ifelse($8, `', `',` "'N_DAI_OUT($2)`_data_bespoke_w"')' ` ]' `}') @@ -159,8 +161,8 @@ define(`DAI_CONFIG', dnl DAI_ADD(pipeline, dnl pipe id, dai type, dai_index, dai_be, -dnl buffer, periods, format, -dnl frames, deadline, priority, core) +dnl buffer, periods, format,frames, deadline, +dnl priority, core, bespoken_config) define(`DAI_ADD', `undefine(`PIPELINE_ID')' `undefine(`DAI_TYPE')' @@ -173,6 +175,7 @@ define(`DAI_ADD', `undefine(`SCHEDULE_DEADLINE')' `undefine(`SCHEDULE_PRIORITY')' `undefine(`SCHEDULE_CORE')' +`undefine(`DAI_BESPOKE_CONFIG')' `define(`PIPELINE_ID', $2)' `define(`DAI_TYPE', STR($3))' `define(`DAI_INDEX', STR($4))' @@ -185,6 +188,7 @@ define(`DAI_ADD', `define(`SCHEDULE_DEADLINE', $10)' `define(`SCHEDULE_PRIORITY', $11)' `define(`SCHEDULE_CORE', $12)' +`define(`DAI_BESPOKE_CONFIG', $13)' `include($1)' ) diff --git a/topology/platform/common/ssp.m4 b/topology/platform/common/ssp.m4 index f3c7862..6cab41d 100644 --- a/topology/platform/common/ssp.m4 +++ b/topology/platform/common/ssp.m4 @@ -43,4 +43,18 @@ define(`SSP_CONFIG_DATA', `}' ) +dnl SSP_BESPOKE_DATA(type, idx, value) +dnl value is optional +define(`SSP_BESPOKE_DATA', +`SectionVendorTuples."$1$2.OUT_tuples_bespoke_w" {' +` tokens "sof_dai_tokens"' +` tuples."word" {' +` SOF_TKN_DAI_BESPOKE_CONFIG' ifelse($3, `', "0", STR($3)) +` }' +`}' +`SectionData."$1$2.OUT_data_bespoke_w" {' +` tuples "$1$2.OUT_tuples_bespoke_w"' +`}' +) + divert(0)dnl diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4 index 823674e..cd2feb6 100644 --- a/topology/sof-apl-nocodec.m4 +++ b/topology/sof-apl-nocodec.m4 @@ -116,7 +116,8 @@ PIPELINE_PCM_DAI_ADD(sof/pipe-volume-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, NoCodec-0, PIPELINE_SOURCE_1, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 0, 1)) # capture DAI is SSP0 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -130,7 +131,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 3, SSP, 1, NoCodec-1, PIPELINE_SOURCE_3, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 1, 1)) # capture DAI is SSP1 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -144,7 +146,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 5, SSP, 2, NoCodec-2, PIPELINE_SOURCE_5, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -158,7 +161,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 7, SSP, 3, NoCodec-3, PIPELINE_SOURCE_7, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 3, 1)) # capture DAI is SSP3 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -172,7 +176,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, #DAI_ADD(sof/pipe-dai-playback.m4, # 9, SSP, 4, NoCodec, # PIPELINE_SOURCE_9, 2, s16le, -# 48, 1000, 0, 0) +# 48, 1000, 0, 0, +# SSP_BESPOKE_DATA(SSP, 4, 1)) # capture DAI is SSP4 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -186,7 +191,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, #DAI_ADD(sof/pipe-dai-playback.m4, # 11, SSP, 5, NoCodec, # PIPELINE_SOURCE_11, 2, s16le, -# 48, 1000, 0, 0) +# 48, 1000, 0, 0, +# SSP_BESPOKE_DATA(SSP, 5, 1)) # capture DAI is SSP5 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-apl-pcm512x.m4 b/topology/sof-apl-pcm512x.m4 index 3412559..e4af87c 100644 --- a/topology/sof-apl-pcm512x.m4 +++ b/topology/sof-apl-pcm512x.m4 @@ -61,7 +61,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 2, SSP, 5, SSP5-Codec, PIPELINE_SOURCE_2, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 5, 1)) # capture DAI is SSP5 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-apl-tdf8532.m4 b/topology/sof-apl-tdf8532.m4 index 8421c07..651d190 100644 --- a/topology/sof-apl-tdf8532.m4 +++ b/topology/sof-apl-tdf8532.m4 @@ -102,7 +102,8 @@ PIPELINE_PCM_DAI_ADD(sof/pipe-volume-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 4, SSP, 0, SSP0-Codec, PIPELINE_SOURCE_4, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 0, 1)) # capture DAI is SSP0 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -123,7 +124,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 2, SSP, 2, SSP2-Codec, PIPELINE_SOURCE_2, 2, s32le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s32le format, with 48 frame per 1000us on core 0 with priority 0 @@ -137,7 +139,8 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 7, SSP, 3, SSP3-Codec, PIPELINE_SOURCE_7, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 3, 1)) # capture DAI is SSP3 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 @@ -151,14 +154,16 @@ DAI_ADD(sof/pipe-dai-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 4, SSP4-Codec, PIPELINE_SOURCE_1, 2, s32le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 4, 1)) # playback DAI is SSP5 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 DAI_ADD(sof/pipe-dai-playback.m4, 9, SSP, 5, SSP5-Codec, PIPELINE_SOURCE_9, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 5, 1)) # capture DAI is SSP5 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4 index f8294d2..cc7f0b6 100644 --- a/topology/sof-bdw-rt286.m4 +++ b/topology/sof-bdw-rt286.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-bdw-rt286" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 0, 1)) # capture DAI is SSP0 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-bdw-rt5640.m4 b/topology/sof-bdw-rt5640.m4 index 3c72d30..82398a2 100644 --- a/topology/sof-bdw-rt5640.m4 +++ b/topology/sof-bdw-rt5640.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-bdw-rt5640" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 0, 1)) # capture DAI is SSP0 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-byt-da7213.m4 b/topology/sof-byt-da7213.m4 index af5129c..99bb09a 100644 --- a/topology/sof-byt-da7213.m4 +++ b/topology/sof-byt-da7213.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-byt-da7212" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, SSP2-Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-byt-nocodec.m4 b/topology/sof-byt-nocodec.m4 index 2345fa5..611d218 100644 --- a/topology/sof-byt-nocodec.m4 +++ b/topology/sof-byt-nocodec.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-byt-nocodec" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, NoCodec-2, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-byt-rt5640.m4 b/topology/sof-byt-rt5640.m4 index 4107491..ec7ad25 100644 --- a/topology/sof-byt-rt5640.m4 +++ b/topology/sof-byt-rt5640.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-byt-rt5640" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, SSP2-Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-byt-rt5645.m4 b/topology/sof-byt-rt5645.m4 index 028cb45..603ee60 100644 --- a/topology/sof-byt-rt5645.m4 +++ b/topology/sof-byt-rt5645.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-byt-rt5645" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, SSP2-Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-byt-rt5651.m4 b/topology/sof-byt-rt5651.m4 index d2cdfad..2299385 100644 --- a/topology/sof-byt-rt5651.m4 +++ b/topology/sof-byt-rt5651.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-byt-rt5651" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, SSP2-Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-cht-max98090.m4 b/topology/sof-cht-max98090.m4 index 38244d7..ef65dce 100644 --- a/topology/sof-cht-max98090.m4 +++ b/topology/sof-cht-max98090.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-cht-max98090" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, SSP2-Codec, PIPELINE_SOURCE_1, 2, s16le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s16le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-cht-nocodec.m4 b/topology/sof-cht-nocodec.m4 index 23c6ef7..adb4e7f 100644 --- a/topology/sof-cht-nocodec.m4 +++ b/topology/sof-cht-nocodec.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-cht-nocodec" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 2, NoCodec-2, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 2, 1)) # capture DAI is SSP2 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4 index e416ce3..2db13d3 100644 --- a/topology/sof-cnl-rt274.m4 +++ b/topology/sof-cnl-rt274.m4 @@ -48,7 +48,8 @@ PIPELINE_PCM_DAI_ADD(sof/pipe-volume-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, SSP0-Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 0, 1)) # capture DAI is SSP0 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof-hsw-rt5640.m4 b/topology/sof-hsw-rt5640.m4 index 9bf8976..7469790 100644 --- a/topology/sof-hsw-rt5640.m4 +++ b/topology/sof-hsw-rt5640.m4 @@ -76,7 +76,8 @@ SectionGraph."pipe-hsw-rt5640" { DAI_ADD(sof/pipe-dai-playback.m4, 1, SSP, 0, Codec, PIPELINE_SOURCE_1, 2, s24le, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(SSP, 0, 1)) # capture DAI is SSP0 using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0 diff --git a/topology/sof/pipe-dai-playback.m4 b/topology/sof/pipe-dai-playback.m4 index 804b180..625d753 100644 --- a/topology/sof/pipe-dai-playback.m4 +++ b/topology/sof/pipe-dai-playback.m4 @@ -8,7 +8,7 @@ include(`pipeline.m4') # # DAI definitions # -W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2) +W_DAI_OUT(DAI_TYPE, DAI_INDEX, DAI_BE, DAI_FORMAT, 0, 2, 2, DAI_BESPOKE_CONFIG) # # DAI pipeline - always use 0 for DAIs diff --git a/topology/test/test-all.m4 b/topology/test/test-all.m4 index 8f9747c..37f8ef0 100644 --- a/topology/test/test-all.m4 +++ b/topology/test/test-all.m4 @@ -66,7 +66,8 @@ PIPELINE_PCM_DAI_ADD(sof/pipe-TEST_PIPE_NAME-capture.m4, DAI_ADD(sof/pipe-dai-playback.m4, 1, TEST_DAI_TYPE, TEST_DAI_PORT, TEST_DAI_LINK_NAME, PIPELINE_SOURCE_1, 2, TEST_DAI_FORMAT, - 48, 1000, 0, 0) + 48, 1000, 0, 0, + SSP_BESPOKE_DATA(TEST_DAI_TYPE, TEST_DAI_PORT, 1)) # capture DAI is SSP TEST_DAI_PORT using 2 periods # Buffers use s24le format, with 48 frame per 1000us on core 0 with priority 0