diff --git a/tools/topology/m4/ch_sel.m4 b/tools/topology/m4/ch_sel.m4 index 2f2267d43..8c0ae7edb 100644 --- a/tools/topology/m4/ch_sel.m4 +++ b/tools/topology/m4/ch_sel.m4 @@ -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 diff --git a/tools/topology/sof/pipe-detect.m4 b/tools/topology/sof/pipe-detect.m4 index 406a462d3..edc616894 100644 --- a/tools/topology/sof/pipe-detect.m4 +++ b/tools/topology/sof/pipe-detect.m4 @@ -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,