Skip to content

Commit

Permalink
topology1: add Google CTC enable switch control
Browse files Browse the repository at this point in the history
Signed-off-by: Johny Lin <[email protected]>
  • Loading branch information
johnylin76 authored and lgirdwood committed Mar 3, 2025
1 parent ca5b47c commit 96f1af0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tools/topology/topology1/m4/google_ctc_audio_processing.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ define(`W_GOOGLE_CTC_AUDIO_PROCESSING',
` bytes ['
$6
` ]'
` mixer ['
$7
` ]'
`}')

divert(0)dnl
17 changes: 16 additions & 1 deletion tools/topology/topology1/sof/pipe-ctc-playback.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ include(`buffer.m4')
include(`pcm.m4')
include(`dai.m4')
include(`bytecontrol.m4')
include(`mixercontrol.m4')
include(`pipeline.m4')
include(`google_ctc_audio_processing.m4')

Expand Down Expand Up @@ -37,12 +38,25 @@ C_CONTROLBYTES(DEF_CTC_BYTES, PIPELINE_ID,
,
DEF_CTC_PRIV)

define(DEF_CTC_SWITCH, concat(`ctc_enable_', PIPELINE_ID))
define(`CONTROL_NAME', `DEF_CTC_SWITCH')
C_CONTROLMIXER(DEF_CTC_SWITCH, PIPELINE_ID,
CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259),
CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
false,
,
Channel register and shift for Front Center,
LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)),
"1")
undefine(`CONTROL_NAME')

#
# Components and Buffers
#

W_GOOGLE_CTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, 2, 2, SCHEDULE_CORE,
LIST(` ', "DEF_CTC_BYTES"))
LIST(` ', "DEF_CTC_BYTES"),
LIST(` ', "DEF_CTC_SWITCH"))

# Playback Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(2,
Expand Down Expand Up @@ -77,3 +91,4 @@ PCM_CAPABILITIES(CTC Processing Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE

undefine(`DEF_CTC_PRIV')
undefine(`DEF_CTC_BYTES')
undefine(`DEF_CTC_SWITCH')
17 changes: 16 additions & 1 deletion tools/topology/topology1/sof/pipe-waves-codec-ctc-playback.m4
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ include(`pcm.m4')
include(`dai.m4')
include(`pipeline.m4')
include(`bytecontrol.m4')
include(`mixercontrol.m4')
include(`google_ctc_audio_processing.m4')

ifdef(`ENDPOINT_NAME',`',`fatal_error(`Pipe requires ENDPOINT_NAME to be defined: Speakers, Headphones, etc.')')
Expand Down Expand Up @@ -73,6 +74,18 @@ C_CONTROLBYTES(DEF_CTC_BYTES, PIPELINE_ID,
,
DEF_CTC_PRIV)

define(DEF_CTC_SWITCH, concat(`ctc_enable_', PIPELINE_ID))
define(`CONTROL_NAME', `DEF_CTC_SWITCH')
C_CONTROLMIXER(DEF_CTC_SWITCH, PIPELINE_ID,
CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259),
CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
false,
,
Channel register and shift for Front Center,
LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)),
"1")
undefine(`CONTROL_NAME')

#
# Components and Buffers
#
Expand All @@ -89,7 +102,8 @@ W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, CA_SCHEDULE_CORE,
LIST(` ', "CA_SETUP_CONTROLBYTES_NAME_PIPE"))

W_GOOGLE_CTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, SCHEDULE_CORE,
LIST(` ', "DEF_CTC_BYTES"))
LIST(` ', "DEF_CTC_BYTES"),
LIST(` ', "DEF_CTC_SWITCH"))

# Playback Buffers
W_BUFFER(0, COMP_BUFFER_SIZE(DAI_PERIODS,
Expand Down Expand Up @@ -130,6 +144,7 @@ PCM_CAPABILITIES(Passthrough Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FO

undefine(`DEF_CTC_PRIV')
undefine(`DEF_CTC_BYTES')
undefine(`DEF_CTC_SWITCH')

undefine(`CA_SETUP_CONTROLBYTES_NAME_PIPE')
undefine(`CA_SETUP_PARAMS')
Expand Down

0 comments on commit 96f1af0

Please sign in to comment.