Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

Commit

Permalink
topology: add SSP bespoke config data for SSP dais
Browse files Browse the repository at this point in the history
Add DAI bespoke config data for dai_in widget, bind DAI bespoke config
to DAI comp.

Signed-off-by: Pan Xiuli <[email protected]>
  • Loading branch information
xiulipan committed Jul 4, 2018
1 parent 9d6283e commit 8f27227
Show file tree
Hide file tree
Showing 18 changed files with 70 additions and 28 deletions.
10 changes: 7 additions & 3 deletions topology/m4/dai.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
Expand Down Expand Up @@ -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"'
Expand All @@ -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"')'
` ]'
`}')

Expand Down Expand Up @@ -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')'
Expand All @@ -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))'
Expand All @@ -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)'
)

Expand Down
14 changes: 14 additions & 0 deletions topology/platform/common/ssp.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 12 additions & 6 deletions topology/sof-apl-nocodec.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-apl-pcm512x.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 10 additions & 5 deletions topology/sof-apl-tdf8532.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-bdw-rt286.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-bdw-rt5640.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-byt-da7213.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-byt-nocodec.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-byt-rt5640.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-byt-rt5645.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-byt-rt5651.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-cht-max98090.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-cht-nocodec.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-cnl-rt274.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/sof-hsw-rt5640.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion topology/sof/pipe-dai-playback.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion topology/test/test-all.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8f27227

Please sign in to comment.