Skip to content

Commit

Permalink
Topology: Add HDA config
Browse files Browse the repository at this point in the history
We need to config HDA rate and channels.

Signed-off-by: Bard Liao <[email protected]>
  • Loading branch information
bardliao authored and lrgirdwo committed Apr 17, 2020
1 parent ce21997 commit 49cba21
Show file tree
Hide file tree
Showing 29 changed files with 235 additions and 89 deletions.
4 changes: 4 additions & 0 deletions src/include/kernel/tokens.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,8 @@
#define SOF_TKN_INTEL_ALH_RATE 1400
#define SOF_TKN_INTEL_ALH_CH 1401

/* HDA */
#define SOF_TKN_INTEL_HDA_RATE 1500
#define SOF_TKN_INTEL_HDA_CH 1501

#endif /* __KERNEL_TOKENS_H__ */
4 changes: 2 additions & 2 deletions tools/topology/m4/dai.m4
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ define(`DO_DAI_CONFIG',
`'
` id "'$3`"'
`'
` ifelse($1, `SSP', $5, $1, `ALH', $5, $1, `ESAI', $5, $1, `SAI', $5, `}')'
` ifelse($1, `SSP', $5, $1, `HDA', $5, $1, `ALH', $5, $1, `ESAI', $5, $1, `SAI', $5, `}')'
`ifelse($1, `DMIC', $5, `')'
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples_common" {'
` tokens "sof_dai_tokens"'
Expand All @@ -157,7 +157,7 @@ define(`DO_DAI_CONFIG',
` "'$1$2`"'
` ]'
` data ['
` ifelse($1, `HDA', `', `"'N_DAI_CONFIG($1$2)`_data"')'
` "'N_DAI_CONFIG($1$2)`_data"'
` "'N_DAI_CONFIG($1$2)`_data_common"'
`ifelse($1, `DMIC',` "'N_DAI_CONFIG($1$2)`_pdm_data"', `')'
` ]'
Expand Down
25 changes: 25 additions & 0 deletions tools/topology/platform/common/hda.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
divert(-1)

dnl HDA related macros

dnl HDA_CONFIG(hda_config_data)
define(`HDA_CONFIG',
`}'
$1
)

dnl HDA_CONFIG_DATA(type, idx, rate, channels)
define(`HDA_CONFIG_DATA',
`SectionVendorTuples."'N_DAI_CONFIG($1$2)`_tuples" {'
` tokens "sof_hda_tokens"'
` tuples."word" {'
` SOF_TKN_INTEL_HDA_RATE' STR($3)
` SOF_TKN_INTEL_HDA_CH' STR($4)
` }'
`}'
`SectionData."'N_DAI_CONFIG($1$2)`_data" {'
` tuples "'N_DAI_CONFIG($1$2)`_tuples"'
`}'
)

divert(0)dnl
10 changes: 7 additions & 3 deletions tools/topology/sof-apl-da7219.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -181,9 +182,12 @@ DAI_CONFIG(DMIC, 0, 2, dmic01,
PDM_CONFIG(DMIC, 0, STEREO_PDM0)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 3, 3, iDisp1)
DAI_CONFIG(HDA, 4, 4, iDisp2)
DAI_CONFIG(HDA, 5, 5, iDisp3)
DAI_CONFIG(HDA, 3, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2)))
DAI_CONFIG(HDA, 4, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2)))
DAI_CONFIG(HDA, 5, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2)))

## remove warnings with SST hard-coded routes

Expand Down
10 changes: 7 additions & 3 deletions tools/topology/sof-apl-demux-pcm512x.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`muxdemux.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -185,8 +186,11 @@ DAI_CONFIG(SSP, 5, 0, SSP5-Codec,
SSP_CONFIG_DATA(SSP, 5, 24)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 0, 3, iDisp1)
DAI_CONFIG(HDA, 1, 4, iDisp2)
DAI_CONFIG(HDA, 2, 5, iDisp3)
DAI_CONFIG(HDA, 0, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))

DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-apl-pcm512x.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -215,8 +216,11 @@ DAI_CONFIG(DMIC, 1, 2, dmic16k,
PDM_CONFIG(DMIC, 1, STEREO_PDM0)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 0, 3, iDisp1)
DAI_CONFIG(HDA, 1, 4, iDisp2)
DAI_CONFIG(HDA, 2, 5, iDisp3)
DAI_CONFIG(HDA, 0, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))

DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-apl-rt298.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -114,7 +115,10 @@ DAI_CONFIG(SSP, 5, 0, SSP5-Codec,
SSP_TDM(2, 32, 3, 3),
SSP_CONFIG_DATA(SSP, 5, 24)))

DAI_CONFIG(HDA, 3, 3, iDisp1)
DAI_CONFIG(HDA, 4, 4, iDisp2)
DAI_CONFIG(HDA, 5, 5, iDisp3)
DAI_CONFIG(HDA, 3, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2)))
DAI_CONFIG(HDA, 4, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2)))
DAI_CONFIG(HDA, 5, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2)))

10 changes: 7 additions & 3 deletions tools/topology/sof-cml-demux-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`muxdemux.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -216,9 +217,12 @@ DAI_CONFIG(DMIC, 0, 1, dmic01,
PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 0, 3, iDisp1)
DAI_CONFIG(HDA, 1, 4, iDisp2)
DAI_CONFIG(HDA, 2, 5, iDisp3)
DAI_CONFIG(HDA, 0, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))


DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-cml-rt5682-kwd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -209,8 +210,11 @@ DAI_CONFIG(DMIC, 1, 2, dmic16k,
PDM_CONFIG(DMIC, 1, STEREO_PDM0)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 0, 3, iDisp1)
DAI_CONFIG(HDA, 1, 4, iDisp2)
DAI_CONFIG(HDA, 2, 5, iDisp3)
DAI_CONFIG(HDA, 0, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))

DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-cml-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -185,8 +186,11 @@ DAI_CONFIG(DMIC, 1, 2, dmic16k,
PDM_CONFIG(DMIC, 1, STEREO_PDM0)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 0, 3, iDisp1)
DAI_CONFIG(HDA, 1, 4, iDisp2)
DAI_CONFIG(HDA, 2, 5, iDisp3)
DAI_CONFIG(HDA, 0, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))

DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-cml-rt700.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`alh.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -180,8 +181,11 @@ DAI_CONFIG(DMIC, 1, 3, dmic16k,
PDM_CONFIG(DMIC, 1, STEREO_PDM0)))

# 3 HDMI/DP outputs (ID: 4,5,6)
DAI_CONFIG(HDA, 0, 4, iDisp1)
DAI_CONFIG(HDA, 1, 5, iDisp2)
DAI_CONFIG(HDA, 2, 6, iDisp3)
DAI_CONFIG(HDA, 0, 4, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 5, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 6, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))

DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-cml-src-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -156,9 +157,12 @@ DAI_CONFIG(DMIC, 0, 1, dmic01,
PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))

# 3 HDMI/DP outputs (ID: 2,3,4)
DAI_CONFIG(HDA, 0, 2, iDisp1)
DAI_CONFIG(HDA, 1, 3, iDisp2)
DAI_CONFIG(HDA, 2, 4, iDisp3)
DAI_CONFIG(HDA, 0, 2, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 3, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 4, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))


DEBUG_END
13 changes: 9 additions & 4 deletions tools/topology/sof-ehl-rt5660.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -208,10 +209,14 @@ DAI_CONFIG(DMIC, 1, 2, dmic16k,
ifelse(HDMI, `1',
`
# 4 HDMI/DP outputs (ID: 5,6,7,8)
DAI_CONFIG(HDA, 0, 5, iDisp1)
DAI_CONFIG(HDA, 1, 6, iDisp2)
DAI_CONFIG(HDA, 2, 7, iDisp3)
DAI_CONFIG(HDA, 3, 8, iDisp4)
DAI_CONFIG(HDA, 0, 5, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 6, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
DAI_CONFIG(HDA, 2, 7, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 2, 48000, 2)))
DAI_CONFIG(HDA, 3, 8, iDisp4,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2)))
')

DEBUG_END
10 changes: 7 additions & 3 deletions tools/topology/sof-glk-da7219-kwd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -223,9 +224,12 @@ DAI_CONFIG(DMIC, 0, 2, dmic01,
PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, HDMI0_INDEX, 3, iDisp1)
DAI_CONFIG(HDA, HDMI1_INDEX, 4, iDisp2)
DAI_CONFIG(HDA, HDMI2_INDEX, 5, iDisp3)
DAI_CONFIG(HDA, HDMI0_INDEX, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, HDMI0_INDEX, 48000, 2)))
DAI_CONFIG(HDA, HDMI1_INDEX, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, HDMI1_INDEX, 48000, 2)))
DAI_CONFIG(HDA, HDMI2_INDEX, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, HDMI2_INDEX, 48000, 2)))

# dmic16k (ID: 6)
DAI_CONFIG(DMIC, 1, 6, dmic16k,
Expand Down
10 changes: 7 additions & 3 deletions tools/topology/sof-glk-da7219.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -183,9 +184,12 @@ DAI_CONFIG(DMIC, 0, 2, dmic01,
PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 3, 3, iDisp1)
DAI_CONFIG(HDA, 4, 4, iDisp2)
DAI_CONFIG(HDA, 5, 5, iDisp3)
DAI_CONFIG(HDA, 3, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2)))
DAI_CONFIG(HDA, 4, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2)))
DAI_CONFIG(HDA, 5, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2)))

## remove warnings with SST hard-coded routes

Expand Down
10 changes: 7 additions & 3 deletions tools/topology/sof-glk-rt5682.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`ssp.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -183,9 +184,12 @@ DAI_CONFIG(DMIC, 0, 2, dmic01,
PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))

# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 3, 3, iDisp1)
DAI_CONFIG(HDA, 4, 4, iDisp2)
DAI_CONFIG(HDA, 5, 5, iDisp3)
DAI_CONFIG(HDA, 3, 3, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 3, 48000, 2)))
DAI_CONFIG(HDA, 4, 4, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2)))
DAI_CONFIG(HDA, 5, 5, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2)))

## remove warnings with SST hard-coded routes

Expand Down
16 changes: 11 additions & 5 deletions tools/topology/sof-hda-asrc.m4
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
include(`utils.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`hda.m4')

# Include TLV library
include(`common/tlv.m4')
Expand Down Expand Up @@ -153,12 +154,17 @@ PCM_PLAYBACK_ADD(HDMI3, 5, PIPELINE_PCM_9)
#

# HDA outputs
DAI_CONFIG(HDA, 0, 4, Analog Playback and Capture)
DAI_CONFIG(HDA, 1, 5, Digital Playback and Capture)
DAI_CONFIG(HDA, 0, 4, Analog Playback and Capture,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 0, 48000, 2)))
DAI_CONFIG(HDA, 1, 5, Digital Playback and Capture,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 1, 48000, 2)))
# 3 HDMI/DP outputs (ID: 3,4,5)
DAI_CONFIG(HDA, 4, 1, iDisp1)
DAI_CONFIG(HDA, 5, 2, iDisp2)
DAI_CONFIG(HDA, 6, 3, iDisp3)
DAI_CONFIG(HDA, 4, 1, iDisp1,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 4, 48000, 2)))
DAI_CONFIG(HDA, 5, 2, iDisp2,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 5, 48000, 2)))
DAI_CONFIG(HDA, 6, 3, iDisp3,
HDA_CONFIG(HDA_CONFIG_DATA(HDA, 6, 48000, 2)))


VIRTUAL_DAPM_ROUTE_IN(codec0_in, HDA, 1, IN, 1)
Expand Down
Loading

0 comments on commit 49cba21

Please sign in to comment.