Skip to content

Commit

Permalink
topology2: add ALC5650 codec support
Browse files Browse the repository at this point in the history
ALC5650 codec is I2S codec integrated Headphone and Speaker.
The HW board connects to ALC5650 as below:

SSP0 config for rt5650-aif1 Speaker
SSP2 config for rt5650-aif2 Headphone

define clks_control attribute {MCLK_ES, BCLK_ES, MCLK_AON}
default value is "0".
ALC5650 requires MCLK_ALWAYS_ON, so override the SSP_CLKS_CONTROL.

Signed-off-by: Mac Chiang <[email protected]>
  • Loading branch information
macchian committed Oct 20, 2023
1 parent 868711c commit f72edd1
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/topology/topology2/cavs-rt5682.conf
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Define {
GOOGLE_AEC_PIPELINE_PRIORITY 2
DMIC_PIPELINE_PRIORITY 1
ECHO_REF_PIPELINE_PRIORITY 0
SSP_CLKS_CONTROL "0"
}

# override defaults with platform-specific config
Expand Down Expand Up @@ -153,6 +154,7 @@ Object.Dai.SSP [
default_hw_conf_id 0
sample_bits 32
io_clk $MCLK
clks_control $SSP_CLKS_CONTROL

Object.Base.hw_config.1 {
name $HEADSET_HW_CONFIG_NAME
Expand Down Expand Up @@ -181,6 +183,7 @@ Object.Dai.SSP [
default_hw_conf_id 0
sample_bits 32
io_clk $MCLK
clks_control $SSP_CLKS_CONTROL

Object.Base.hw_config.1 {
name $SPEAKER_HW_CONFIG_NAME
Expand Down
19 changes: 19 additions & 0 deletions tools/topology/topology2/include/dais/ssp.conf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ Class.Dai."SSP" {

DefineAttribute."default_hw_config_id" {}

DefineAttribute."clks_control" {
# Token reference and type
token_ref "intel_ssp.word"
constraints {
!valid_values [
"0"
"mclk_es"
"bclk_es"
"mclk_aon"
]
!tuple_values [
0
64
128
256
]
}
}

DefineAttribute."name" {
type "string"
}
Expand Down
8 changes: 8 additions & 0 deletions tools/topology/topology2/sof-ace-tplg/tplg-targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAM
BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\
DEEPBUFFER_D0I3_COMPATIBLE=true"

#RT5650 integrated codec support
"cavs-rt5682\;sof-mtl-rt5650-ssp2-ssp0\;PLATFORM=mtl,NUM_DMICS=4,PDM1_MIC_A_ENABLE=1,\
PDM1_MIC_B_ENABLE=1,DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,\
NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682.bin,DEEPBUFFER_FW_DMA_MS=10,HEADSET_SSP_DAI_INDEX=2,\
SPK_ID=6,SPEAKER_SSP_DAI_INDEX=0,HEADSET_CODEC_NAME=SSP2-Codec,SPEAKER_CODEC_NAME=SSP0-Codec,\
BT_NAME=SSP1-BT,BT_INDEX=1,BT_ID=7,BT_PCM_NAME=Bluetooth,INCLUDE_ECHO_REF=true,USE_CHAIN_DMA=true,\
DEEPBUFFER_D0I3_COMPATIBLE=true,SSP_CLKS_CONTROL=mclk_aon"

"cavs-rt5682\;sof-mtl-max98357a-rt5682-ssp2-ssp0-2ch-pdm1\;PLATFORM=mtl,NUM_DMICS=2,\
PDM0_MIC_A_ENABLE=0,PDM0_MIC_B_ENABLE=0,PDM1_MIC_A_ENABLE=1,PDM1_MIC_B_ENABLE=1,\
DMIC0_PCM_ID=99,PREPROCESS_PLUGINS=nhlt,NHLT_BIN=nhlt-sof-mtl-max98357a-rt5682-2ch.bin,\
Expand Down

0 comments on commit f72edd1

Please sign in to comment.