This patch adds the changes required to support kcontrols for tone components in topology
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com
--- Tested with: Minnowboard Turbot rt5651 SOF master: 28cb21b578759cdaa884d440d7d79b2c44e716a4 SOF-Tool master: a02abb799405d0e4ad0d6bb46eacf6fbe958c06e https://github.com/plbossart/sound/tree/topic/sof-v4.14: 9513a73b981bc1917705671ec54402a7e21672eb --- --- topology/m4/local.m4 | 5 ++++- topology/sof/pipe-tone.m4 | 31 ++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/topology/m4/local.m4 b/topology/m4/local.m4 index 29b8b29..a340ec3 100644 --- a/topology/m4/local.m4 +++ b/topology/m4/local.m4 @@ -227,7 +227,7 @@ define(`W_MIXER', dnl Tone name) define(`N_TONE', `TONE'PIPELINE_ID`.'$1)
-dnl W_TONE(name, format, periods_sink, periods_source, preload) +dnl W_TONE(name, format, periods_sink, periods_source, preload, kcontrols) define(`W_TONE', `SectionVendorTuples."'N_TONE($1)`_tuples_w" {' ` tokens "sof_comp_tokens"' @@ -257,6 +257,9 @@ define(`W_TONE', ` "'N_TONE($1)`_data_w"' ` "'N_TONE($1)`_data_str"' ` ]' +` mixer [' + $6 +` ]' `}')
dnl DAI name) diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index e04a1b9..8f92680 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -32,6 +32,7 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) { # control uses bespoke driver get/put/info ID 0 ops."ctl" { info "volsw" + # 256 binds the mixer control to volume get/put handlers get "256" put "256" } @@ -42,12 +43,40 @@ SectionControlMixer.STR(Tone Volume PIPELINE_ID) { tlv "vtlv_m90s3" }
+SectionControlMixer.STR(Tone Switch PIPELINE_ID) { + + # control belongs to this index group + index STR(PIPELINE_ID) + + # Channel register and shift for Front Left/Right + channel."FL" { + reg "2" + shift "0" + } + channel."FR" { + reg "2" + shift "1" + } + + # control uses bespoke driver get/put/info ID 0 + ops."ctl" { + info "volsw" + # 256 binds the mixer control to volume get/put handlers + get "256" + put "256" + } + + # max 1 indicates switch type mixer control + max "1" + invert "false" +} + # # Components and Buffers #
# "Tone 0" has 2 sink period and 0 source periods -W_TONE(0, PIPELINE_FORMAT, 2, 0, 0) +W_TONE(0, PIPELINE_FORMAT, 2, 0, 0, KCONTROLS("Tone Switch PIPELINE_ID"))
# "Tone Volume" has 2 sink period and 2 source periods W_PGA(0, PIPELINE_FORMAT, 2, 2, 0, KCONTROLS("Tone Volume PIPELINE_ID"))