From 1ba615ef943bff830d25a43efced296a06874fdb Mon Sep 17 00:00:00 2001 From: Dharageswari R Date: Tue, 15 Sep 2020 19:11:54 -0700 Subject: [PATCH 1/2] topology: Modify init params for the Demux Config This patch creates macros for the channel map of Feedback and reference streams. Also, modifies the feedback channels and channel map of the Demux configuration to send voltage and current data to the smart amplifier component and only voltage data to the host as Feedback stream. Signed-off-by: Dharageswari R --- tools/topology/sof/pipe-amp-ref-capture.m4 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/topology/sof/pipe-amp-ref-capture.m4 b/tools/topology/sof/pipe-amp-ref-capture.m4 index 67285cb806fe..c5ff324c7f18 100644 --- a/tools/topology/sof/pipe-amp-ref-capture.m4 +++ b/tools/topology/sof/pipe-amp-ref-capture.m4 @@ -38,6 +38,17 @@ ifdef(`SMART_REF_PPL_ID',`',`errprint(note: Need to define Echo Ref pipeline ID ifdef(`SMART_REF_CH_NUM',`',`errprint(note: Need to define Echo Ref channel number for sof-smart-amplifier )') +ifelse(SMART_FB_CHANNELS, `8', +`define(`FB_CHMAP',`0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80')', +`define(`FB_CHMAP',`0x01,0x02,0x04,0x08,0x00,0x00,0x00,0x00')' +) + +ifelse(SMART_REF_CHANNELS, `8', +`define(`REF_CHMAP',`0x01,0x02,0x04,0x08,0x00,0x00,0x00,0x00')', +`define(`REF_CHMAP',`0x01,0x04,0x00,0x00,0x00,0x00,0x00,0x00')' +) + + # should be aligned with struct sof_mux_config, used for mux input/output configuration. CONTROLBYTES_PRIV(DEMUX_priv, ` bytes "0x53,0x4f,0x46,0x00,0x00,0x00,0x00,0x00,' @@ -45,10 +56,8 @@ CONTROLBYTES_PRIV(DEMUX_priv, ` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' ` 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,' ` COMP_FORMAT_VALUE(PIPELINE_FORMAT),0x00,DEC2HEX(SMART_RX_CHANNELS),0x00,0x02,0x00,0x00,0x00,' -` DEC2HEX(SMART_PB_PPL_ID),0x00,0x00,0x00,DEC2HEX(SMART_FB_CHANNELS),0x01,0x02,0x04,' -` 0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,' -` DEC2HEX(SMART_REF_PPL_ID),0x00,0x00,0x00,DEC2HEX(SMART_REF_CH_NUM),0x01,0x02,0x04,' -` 0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00"' +` DEC2HEX(SMART_PB_PPL_ID),0x00,0x00,0x00,DEC2HEX(SMART_FB_CHANNELS),FB_CHMAP,0x00,0x00,0x00,' +` DEC2HEX(SMART_REF_PPL_ID),0x00,0x00,0x00,DEC2HEX(SMART_REF_CH_NUM),REF_CHMAP,0x00,0x00,0x00"' ) # demux Bytes control with max value of 255 From b267ba83f4266cb3410c59ea17fd8988754bb3dc Mon Sep 17 00:00:00 2001 From: Sathyanarayana Nujella Date: Tue, 15 Sep 2020 19:19:08 -0700 Subject: [PATCH 2/2] topology: Update number of feeback reference channel on max98373 This patch modifies the number of reference feedback channels from the Demux component to the host capture stream in sof-tgl-max98373-rt5682. Signed-off-by: Dharageswari R --- tools/topology/sof-tgl-max98373-rt5682.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/topology/sof-tgl-max98373-rt5682.m4 b/tools/topology/sof-tgl-max98373-rt5682.m4 index 3f73ea1ac7e9..c04e077a7e0f 100644 --- a/tools/topology/sof-tgl-max98373-rt5682.m4 +++ b/tools/topology/sof-tgl-max98373-rt5682.m4 @@ -53,11 +53,11 @@ define(`SSP_MCLK', 19200000) define(`SMART_PB_PPL_ID', 1) define(`SMART_PB_CH_NUM', 2) define(`SMART_TX_CHANNELS', 4) -define(`SMART_RX_CHANNELS', 8) +define(`SMART_RX_CHANNELS', 4) define(`SMART_FB_CHANNELS', 4) # Ref capture related define(`SMART_REF_PPL_ID', 11) -define(`SMART_REF_CH_NUM', 4) +define(`SMART_REF_CH_NUM', 2) # PCM related define(`SMART_PCM_ID', 0) define(`SMART_PCM_NAME', `smart373-spk')