Skip to content

Commit 96f1af0

Browse files
johnylin76lgirdwood
authored andcommitted
topology1: add Google CTC enable switch control
Signed-off-by: Johny Lin <johnylin@google.com>
1 parent ca5b47c commit 96f1af0

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

tools/topology/topology1/m4/google_ctc_audio_processing.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ define(`W_GOOGLE_CTC_AUDIO_PROCESSING',
6060
` bytes ['
6161
$6
6262
` ]'
63+
` mixer ['
64+
$7
65+
` ]'
6366
`}')
6467

6568
divert(0)dnl

tools/topology/topology1/sof/pipe-ctc-playback.m4

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ include(`buffer.m4')
1010
include(`pcm.m4')
1111
include(`dai.m4')
1212
include(`bytecontrol.m4')
13+
include(`mixercontrol.m4')
1314
include(`pipeline.m4')
1415
include(`google_ctc_audio_processing.m4')
1516

@@ -37,12 +38,25 @@ C_CONTROLBYTES(DEF_CTC_BYTES, PIPELINE_ID,
3738
,
3839
DEF_CTC_PRIV)
3940

41+
define(DEF_CTC_SWITCH, concat(`ctc_enable_', PIPELINE_ID))
42+
define(`CONTROL_NAME', `DEF_CTC_SWITCH')
43+
C_CONTROLMIXER(DEF_CTC_SWITCH, PIPELINE_ID,
44+
CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259),
45+
CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
46+
false,
47+
,
48+
Channel register and shift for Front Center,
49+
LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)),
50+
"1")
51+
undefine(`CONTROL_NAME')
52+
4053
#
4154
# Components and Buffers
4255
#
4356

4457
W_GOOGLE_CTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, 2, 2, SCHEDULE_CORE,
45-
LIST(` ', "DEF_CTC_BYTES"))
58+
LIST(` ', "DEF_CTC_BYTES"),
59+
LIST(` ', "DEF_CTC_SWITCH"))
4660

4761
# Playback Buffers
4862
W_BUFFER(0, COMP_BUFFER_SIZE(2,
@@ -77,3 +91,4 @@ PCM_CAPABILITIES(CTC Processing Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE
7791

7892
undefine(`DEF_CTC_PRIV')
7993
undefine(`DEF_CTC_BYTES')
94+
undefine(`DEF_CTC_SWITCH')

tools/topology/topology1/sof/pipe-waves-codec-ctc-playback.m4

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ include(`pcm.m4')
1111
include(`dai.m4')
1212
include(`pipeline.m4')
1313
include(`bytecontrol.m4')
14+
include(`mixercontrol.m4')
1415
include(`google_ctc_audio_processing.m4')
1516

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

77+
define(DEF_CTC_SWITCH, concat(`ctc_enable_', PIPELINE_ID))
78+
define(`CONTROL_NAME', `DEF_CTC_SWITCH')
79+
C_CONTROLMIXER(DEF_CTC_SWITCH, PIPELINE_ID,
80+
CONTROLMIXER_OPS(volsw, 259 binds the mixer control to switch get/put handlers, 259, 259),
81+
CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
82+
false,
83+
,
84+
Channel register and shift for Front Center,
85+
LIST(` ', KCONTROL_CHANNEL(FC, 3, 0)),
86+
"1")
87+
undefine(`CONTROL_NAME')
88+
7689
#
7790
# Components and Buffers
7891
#
@@ -89,7 +102,8 @@ W_CODEC_ADAPTER(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, CA_SCHEDULE_CORE,
89102
LIST(` ', "CA_SETUP_CONTROLBYTES_NAME_PIPE"))
90103

91104
W_GOOGLE_CTC_AUDIO_PROCESSING(0, PIPELINE_FORMAT, DAI_PERIODS, DAI_PERIODS, SCHEDULE_CORE,
92-
LIST(` ', "DEF_CTC_BYTES"))
105+
LIST(` ', "DEF_CTC_BYTES"),
106+
LIST(` ', "DEF_CTC_SWITCH"))
93107

94108
# Playback Buffers
95109
W_BUFFER(0, COMP_BUFFER_SIZE(DAI_PERIODS,
@@ -130,6 +144,7 @@ PCM_CAPABILITIES(Passthrough Playback PCM_ID, CAPABILITY_FORMAT_NAME(PIPELINE_FO
130144

131145
undefine(`DEF_CTC_PRIV')
132146
undefine(`DEF_CTC_BYTES')
147+
undefine(`DEF_CTC_SWITCH')
133148

134149
undefine(`CA_SETUP_CONTROLBYTES_NAME_PIPE')
135150
undefine(`CA_SETUP_PARAMS')

0 commit comments

Comments
 (0)