[Sound-open-firmware] [PATCH v2 1/3] topology: use switch IO handler for tone switch
Use the bespoke switch IO handler in the driver for the tone switch kcontrol.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/sof/pipe-tone.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4 index 53cef5a..fc5eb00 100644 --- a/topology/sof/pipe-tone.m4 +++ b/topology/sof/pipe-tone.m4 @@ -30,7 +30,7 @@ C_CONTROLMIXER(Tone Volume, PIPELINE_ID,
# Switch type Mixer Control with max value of 1 C_CONTROLMIXER(Tone Switch, PIPELINE_ID, - CONTROLMIXER_OPS(volsw, 256 binds the mixer control to volume get/put handlers, 256, 256), + 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, ,
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/test/tplg-build.sh | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/topology/test/tplg-build.sh b/topology/test/tplg-build.sh index ad4d1da..9d3649e 100755 --- a/topology/test/tplg-build.sh +++ b/topology/test/tplg-build.sh @@ -204,6 +204,9 @@ simple_test nocodec src "NoCodec" s24le SSP 4 s24le 25 24 2400000 24000000 I2S S
# Tone test: Tone component only supports s32le currently simple_test codec tone "SSP2-Codec" s32le SSP 2 s16le 20 16 1920000 19200000 I2S TONE_TEST[@] +#Tone Test for APL +simple_test codec tone "SSP5-Codec" s32le SSP 5 s24le 32 24 3072000 24576000 I2S TONE_TEST[@] +simple_test codec tone "SSP5-Codec" s32le SSP 5 s32le 32 32 3072000 24576000 I2S TONE_TEST[@]
#DMIC Test simple_test nocodec passthrough "DMIC0" s32le DMIC 0 s32le 1 500000 4800000\
Add SAMPLE_RATE token for tone comp. Include it in tone definition and set it from the test pipeline definition.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- topology/m4/tone.m4 | 7 +++++++ topology/sof/tokens.m4 | 4 ++++ topology/test/test-tone-playback.m4 | 4 ++++ 3 files changed, 15 insertions(+)
diff --git a/topology/m4/tone.m4 b/topology/m4/tone.m4 index 6a88b37..583134c 100644 --- a/topology/m4/tone.m4 +++ b/topology/m4/tone.m4 @@ -15,8 +15,15 @@ define(`W_TONE', ` SOF_TKN_COMP_PRELOAD_COUNT' STR($5) ` }' `}' +`SectionVendorTuples."'N_TONE($1)`_tone_tuples_w" {' +` tokens "sof_tone_tokens"' +` tuples."word" {' +` SOF_TKN_TONE_SAMPLE_RATE' ifdef(TONE_SAMPLE_RATE, STR(TONE_SAMPLE_RATE), "48000") +` }' +`}' `SectionData."'N_TONE($1)`_data_w" {' ` tuples "'N_TONE($1)`_tuples_w"' +` tuples "'N_TONE($1)`_tone_tuples_w"' `}' `SectionVendorTuples."'N_TONE($1)`_tuples_str" {' ` tokens "sof_comp_tokens"' diff --git a/topology/sof/tokens.m4 b/topology/sof/tokens.m4 index f0b3428..62c478b 100644 --- a/topology/sof/tokens.m4 +++ b/topology/sof/tokens.m4 @@ -77,3 +77,7 @@ SectionVendorTokens."sof_dmic_pdm_tokens" { SOF_TKN_INTEL_DMIC_PDM_CLK_EDGE "705" SOF_TKN_INTEL_DMIC_PDM_SKEW "706" } + +SectionVendorTokens."sof_tone_tokens" { + SOF_TKN_TONE_SAMPLE_RATE "800" +} diff --git a/topology/test/test-tone-playback.m4 b/topology/test/test-tone-playback.m4 index 1c38c09..01d6045 100644 --- a/topology/test/test-tone-playback.m4 +++ b/topology/test/test-tone-playback.m4 @@ -6,6 +6,7 @@ include(`pipeline.m4') include(`dai.m4') include(`utils.m4') +include(`tone.m4')
# Include TLV library include(`common/tlv.m4') @@ -36,6 +37,9 @@ include(`dsps/byt.m4') # Tone --B0--> volume --B1--> SSP2 #
+# Set sample rate for tone +define(`TONE_SAMPLE_RATE', 48000) + # Tone Playback pipeline 5 using max 2 channels of TEST_PIPE_FORMAT. # Schedule with 48 frame per 1000us deadline on core 0 with priority 0 PIPELINE_ADD(sof/pipe-tone.m4,
participants (1)
-
Ranjani Sridharan