topology: Include DAI format in pipeline definitions

Make sure we allow different DAI formats in pipelines.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2017-08-21 20:26:05 +01:00
parent 3d8e7478a4
commit 08adb55f0b
5 changed files with 35 additions and 12 deletions

View File

@ -26,7 +26,7 @@ define(`PIPELINE_PCM_ADD',
)
dnl PIPELINE_PCM_DAI_ADD(pipeline, id, pcm, max channels, format, frames,
dnl deadline, priority, core, dai type, dai_index, stream_name, periods)
dnl deadline, priority, core, dai type, dai_index, stream_name, dai format, periods)
define(`PIPELINE_PCM_DAI_ADD',
`undefine(`PCM_ID')'
`undefine(`PIPELINE_ID')'
@ -41,6 +41,7 @@ define(`PIPELINE_PCM_DAI_ADD',
`undefine(`DAI_TYPE')'
`undefine(`DAI_INDEX')'
`undefine(`DAI_SNAME')'
`undefine(`DAI_FORMAT')'
`undefine(`DAI_PERIODS')'
`define(`PIPELINE_ID', $2)'
`define(`PCM_ID', $3)'
@ -55,7 +56,8 @@ define(`PIPELINE_PCM_DAI_ADD',
`define(`DAI_TYPE', STR($12))'
`define(`DAI_INDEX', STR($13))'
`define(`DAI_SNAME', $14)'
`define(`DAI_PERIODS', $15)'
`define(`DAI_FORMAT', $15)'
`define(`DAI_PERIODS', $16)'
`define(`DAI_NAME', $12$13)'
`include($1)'
)

View File

@ -253,7 +253,7 @@ define(`N_DAI', DAI_NAME)
define(`N_DAI_OUT', DAI_NAME`.OUT')
define(`N_DAI_IN', DAI_NAME`.IN')
dnl W_DAI_OUT(stream, type, index, data, periods_sink, periods_source, preload)
dnl W_DAI_OUT(stream, type, index, format, periods_sink, periods_source, preload, data)
define(`W_DAI_OUT',
`SectionVendorTuples."'N_DAI_OUT($1)`_tuples_w_comp" {'
` tokens "sof_comp_tokens"'
@ -284,6 +284,15 @@ define(`W_DAI_OUT',
`SectionData."'N_DAI_OUT($1)`_data_str" {'
` tuples "'N_DAI_OUT($1)`_tuples_str"'
`}'
`SectionVendorTuples."'N_DAI_OUT($1)`_tuples_comp_str" {'
` tokens "sof_comp_tokens"'
` tuples."string" {'
` SOF_TKN_COMP_FORMAT' STR($4)
` }'
`}'
`SectionData."'N_DAI_OUT($1)`_data_comp_str" {'
` tuples "'N_DAI_OUT($1)`_tuples_comp_str"'
`}'
`SectionWidget."'N_DAI_OUT`" {'
` index "'PIPELINE_ID`"'
` type "dai_in"'
@ -293,11 +302,12 @@ define(`W_DAI_OUT',
` "'N_DAI_OUT($1)`_data_w"'
` "'N_DAI_OUT($1)`_data_w_comp"'
` "'N_DAI_OUT($1)`_data_str"'
` "'$4`"'
` "'N_DAI_OUT($1)`_data_comp_str"'
` "'$8`"'
` ]'
`}')
dnl W_DAI_IN(stream, type, index, data, periods_sink, periods_source, preload)
dnl W_DAI_IN(stream, type, index, format, periods_sink, periods_source, preload, data)
define(`W_DAI_IN',
`SectionVendorTuples."'N_DAI_IN($1)`_tuples_w_comp" {'
` tokens "sof_comp_tokens"'
@ -328,6 +338,15 @@ define(`W_DAI_IN',
`SectionData."'N_DAI_IN($1)`_data_str" {'
` tuples "'N_DAI_IN($1)`_tuples_str"'
`}'
`SectionVendorTuples."'N_DAI_IN($1)`_tuples_comp_str" {'
` tokens "sof_comp_tokens"'
` tuples."string" {'
` SOF_TKN_COMP_FORMAT' STR($4)
` }'
`}'
`SectionData."'N_DAI_IN($1)`_data_comp_str" {'
` tuples "'N_DAI_IN($1)`_tuples_comp_str"'
`}'
`SectionWidget."'N_DAI_IN`" {'
` index "'PIPELINE_ID`"'
` type "dai_out"'
@ -337,7 +356,8 @@ define(`W_DAI_IN',
` "'N_DAI_IN($1)`_data_w"'
` "'N_DAI_IN($1)`_data_w_comp"'
` "'N_DAI_IN($1)`_data_str"'
` "'$4`"'
` "'N_DAI_OUT($1)`_data_comp_str"'
` "'$8`"'
` ]'
`}')
@ -447,6 +467,7 @@ define(`COMP_SAMPLE_SIZE',
$1, `s16le', `2',
$1, `s24_4le', `4',
$1, `s32le', `4',
$1, `float', `4',
`4')')

View File

@ -6,7 +6,7 @@ include(`local.m4')
#
# DAI definitions
#
W_DAI_IN(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0c_plat_conf)
W_DAI_IN(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 2, 0, 0, dai0c_plat_conf)
#
# DAI pipeline - always use 0 for DAIs

View File

@ -6,7 +6,7 @@ include(`local.m4')
#
# DAI definitions
#
W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0p_plat_conf)
W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf)
#
# DAI pipeline - always use 0 for DAIs

View File

@ -16,14 +16,14 @@ include(`local.m4')
# with 2 sink and 0 source periods
W_PCM_PLAYBACK(Passthrough Playback, PIPELINE_DMAC, PIPELINE_DMAC_CHAN, 2, 0, 2)
# Capture Buffers
# Playback Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(2,
COMP_SAMPLE_SIZE(PIPELINE_FORMAT), PIPELINE_CHANNELS, SCHEDULE_FRAMES))
#
# DAI definitions
#
W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, dai0p_plat_conf)
W_DAI_OUT(DAI_SNAME, DAI_TYPE, DAI_INDEX, DAI_FORMAT, 0, 2, 2, dai0p_plat_conf)
#
# DAI pipeline - always use 0 for DAIs
@ -33,7 +33,7 @@ W_PIPELINE(N_DAI_OUT, SCHEDULE_DEADLINE, SCHEDULE_PRIORITY, SCHEDULE_FRAMES, SCH
#
# Pipeline Graph
#
# host PCM <--B1-- volume <--B0-- source DAI0
# host PCM_P --> B0 --> sink DAI0
SectionGraph."pipe-pass-playback-PIPELINE_ID" {
index STR(PIPELINE_ID)
@ -65,7 +65,7 @@ SectionPCMCapabilities.STR(Passthrough Playback PCM_ID) {
buffer_size_max "65536"
}
# PCM Low Latency Capture
# PCM Low Latency Passthrough Playback
SectionPCM.STR(PCM PCM_ID) {
index STR(PIPELINE_ID)