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 devices.

SSP0 config for ALC5650 Speaker
SSP2 config for ALC5650 Headphone

add clks_control attribute {}. Because ALC5650 requires MCLK 24.576MHz
always on and 24 valid bits. So that it will overriden the SSP_CLKS_CONTROL
and SSP_SAMPLE_BITS. Otherwise, keep the default configurations.

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

# override defaults with platform-specific config
Expand Down Expand Up @@ -151,8 +153,9 @@ Object.Dai.SSP [
direction "duplex"
name $HEADSET_CODEC_NAME
default_hw_conf_id 0
sample_bits 32
sample_bits $SAMPLE_BITS
io_clk $MCLK
clks_control $CLKS_CONTROL

Object.Base.hw_config.1 {
name $HEADSET_HW_CONFIG_NAME
Expand All @@ -179,8 +182,9 @@ Object.Dai.SSP [
}
name $SPEAKER_CODEC_NAME
default_hw_conf_id 0
sample_bits 32
sample_bits $SAMPLE_BITS
io_clk $MCLK
clks_control $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,SAMPLE_BITS=24,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 e63d230

Please sign in to comment.