topology: keyword: selector: add bytes control

Add bytes control for selector to send binary
data to it.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
This commit is contained in:
Jaska Uimonen 2019-03-07 09:05:11 +02:00 committed by Liam Girdwood
parent b0c900b9a7
commit 500d64fe5d
2 changed files with 25 additions and 2 deletions

View File

@ -5,7 +5,7 @@ dnl Define macro for channel selector widget
dnl Selector name)
define(`N_SELECTOR', `SELECTOR'PIPELINE_ID`.'$1)
dnl W_SELECTOR(name, format, periods_sink, periods_source, in_chan_cnt, out_chan_cnt, sel_chan_index)
dnl W_SELECTOR(name, format, periods_sink, periods_source, kcontrols_list)
define(`W_SELECTOR',
`SectionVendorTuples."'N_SELECTOR($1)`_tuples_w" {'
` tokens "sof_comp_tokens"'
@ -41,6 +41,9 @@ define(`W_SELECTOR',
` "'N_SELECTOR($1)`_data_w"'
` "'N_SELECTOR($1)`_data_str"'
` ]'
` bytes ['
$5
` ]'
`}')
divert(0)dnl

View File

@ -13,6 +13,8 @@ include(`buffer.m4')
include(`pga.m4')
include(`ch_sel.m4')
include(`detect.m4')
include(`mixercontrol.m4')
include(`bytecontrol.m4')
include(`pipeline.m4')
#
@ -20,6 +22,24 @@ include(`pipeline.m4')
#
# Selector initial parameters
CONTROLBYTES_PRIV(SELECTOR_priv,
` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,'
` 0x0c,0x00,0x00,0x00,0x00,0x10,0x00,0x03,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,'
` 0x02,0x00,0x00,0x00,0x01,0x00,0x00,0x00,'
` 0x00,0x00,0x00,0x00"'
)
# Selector Bytes control with max value of 255
C_CONTROLBYTES(SELECTOR, PIPELINE_ID,
CONTROLBYTES_OPS(bytes, 258 binds the mixer control to bytes get/put handlers, 258, 258),
CONTROLBYTES_EXTOPS(258 binds the mixer control to bytes get/put handlers, 258, 258),
, , ,
CONTROLBYTES_MAX(, 304),
,
SELECTOR_priv)
#
# Components and Buffers
#
@ -27,7 +47,7 @@ include(`pipeline.m4')
# "Detect 0" has 2 sink period and 0 source periods
W_DETECT(0, PIPELINE_FORMAT, 0, 2, KEYWORD, N_STS(PCM_ID))
W_SELECTOR(0, PIPELINE_FORMAT, 2, 2, 2, 1, 0)
W_SELECTOR(0, PIPELINE_FORMAT, 2, 2, LIST(` ', "SELECTOR"))
# Capture Buffers
W_BUFFER(1, COMP_BUFFER_SIZE(2,