topology: add dmic channel maps for different channel counts

Volume and switch controls in the dmic pipeline need different channel
maps based on dmic channel count. This will enable the control of all
channel volumes and mutes from user space.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
This commit is contained in:
Jaska Uimonen 2020-09-25 15:11:02 +03:00 committed by Liam Girdwood
parent 256c934375
commit 0ed7023861
6 changed files with 31 additions and 10 deletions

View File

@ -22,6 +22,27 @@ ifdef(`DMIC_PCM_CHANNELS', `', `define(DMIC_PCM_CHANNELS, CHANNELS)')
ifdef(`DMIC16K_DAI_CHANNELS', `', `define(DMIC16K_DAI_CHANNELS, CHANNELS)')
ifdef(`DMIC16K_PCM_CHANNELS', `', `define(DMIC16K_PCM_CHANNELS, CHANNELS)')
ifelse(CHANNELS, 1, `define(DMIC_VOL_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FL, 1, 0)))')
ifelse(CHANNELS, 2, `define(DMIC_VOL_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FL, 1, 0),
KCONTROL_CHANNEL(FR, 1, 1)))')
ifelse(CHANNELS, 3, `define(DMIC_VOL_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FL, 1, 0),
KCONTROL_CHANNEL(FC, 1, 1),
KCONTROL_CHANNEL(FR, 1, 2)))')
ifelse(CHANNELS, 4, `define(DMIC_VOL_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FLW, 1, 0),
KCONTROL_CHANNEL(FL, 1, 1),
KCONTROL_CHANNEL(FR, 1, 2),
KCONTROL_CHANNEL(FRW, 1, 3)))')
ifelse(CHANNELS, 1, `define(DMIC_SW_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0)))')
ifelse(CHANNELS, 2, `define(DMIC_SW_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0),
KCONTROL_CHANNEL(FR, 2, 1)))')
ifelse(CHANNELS, 3, `define(DMIC_SW_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FL, 2, 0),
KCONTROL_CHANNEL(FC, 2, 1),
KCONTROL_CHANNEL(FR, 2, 2)))')
ifelse(CHANNELS, 4, `define(DMIC_SW_CH_MAPS, LIST(` ', KCONTROL_CHANNEL(FLW, 2, 0),
KCONTROL_CHANNEL(FL, 2, 1),
KCONTROL_CHANNEL(FR, 2, 2),
KCONTROL_CHANNEL(FRW, 2, 3)))')
#
# Define the pipelines
#

View File

@ -33,7 +33,7 @@ C_CONTROLMIXER(Capture Volume, PIPELINE_ID,
false,
CONTROLMIXER_TLV(TLV 80 steps from -50dB to +20dB for 1dB, vtlv_m50s1),
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
DMIC_VOL_CH_MAPS)
undefine(`CONTROL_NAME')
define(`CONTROL_NAME', `CONTROL_NAME_SWITCH')
@ -45,7 +45,7 @@ C_CONTROLMIXER(Capture Switch, PIPELINE_ID,
false,
,
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)),
DMIC_SW_CH_MAPS,
"1", "1")
# Volume Configuration

View File

@ -53,7 +53,7 @@ C_CONTROLMIXER(Capture Volume, PIPELINE_ID,
false,
CONTROLMIXER_TLV(TLV 80 steps from -50dB to +20dB for 1dB, vtlv_m50s1),
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
DMIC_VOL_CH_MAPS)
undefine(`CONTROL_NAME')
define(`CONTROL_NAME', `CONTROL_NAME_SWITCH')
@ -65,7 +65,7 @@ C_CONTROLMIXER(Capture Switch, PIPELINE_ID,
false,
,
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)),
DMIC_SW_CH_MAPS,
"1", "1")
# Volume Configuration

View File

@ -53,7 +53,7 @@ C_CONTROLMIXER(Capture Volume, PIPELINE_ID,
false,
CONTROLMIXER_TLV(TLV 80 steps from -50dB to +20dB for 1dB, vtlv_m50s1),
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
DMIC_VOL_CH_MAPS)
undefine(`CONTROL_NAME')
define(`CONTROL_NAME', `CONTROL_NAME_SWITCH')
@ -65,7 +65,7 @@ C_CONTROLMIXER(Capture Switch, PIPELINE_ID,
false,
,
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)),
DMIC_SW_CH_MAPS,
"1", "1")
# Volume Configuration

View File

@ -52,7 +52,7 @@ C_CONTROLMIXER(Capture Volume, PIPELINE_ID,
false,
CONTROLMIXER_TLV(TLV 80 steps from -50dB to +20dB for 1dB, vtlv_m50s1),
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
DMIC_VOL_CH_MAPS)
undefine(`CONTROL_NAME')
define(`CONTROL_NAME', `CONTROL_NAME_SWITCH')
@ -64,7 +64,7 @@ C_CONTROLMIXER(Capture Switch, PIPELINE_ID,
false,
,
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)),
DMIC_SW_CH_MAPS,
"1", "1")
# Volume Configuration

View File

@ -52,7 +52,7 @@ C_CONTROLMIXER(Capture Volume, PIPELINE_ID,
false,
CONTROLMIXER_TLV(TLV 80 steps from -50dB to +20dB for 1dB, vtlv_m50s1),
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 1, 0), KCONTROL_CHANNEL(FR, 1, 1)))
DMIC_VOL_CH_MAPS)
undefine(`CONTROL_NAME')
define(`CONTROL_NAME', `CONTROL_NAME_SWITCH')
@ -64,7 +64,7 @@ C_CONTROLMIXER(Capture Switch, PIPELINE_ID,
false,
,
Channel register and shift for Front Left/Right,
LIST(` ', KCONTROL_CHANNEL(FL, 2, 0), KCONTROL_CHANNEL(FR, 2, 1)),
DMIC_SW_CH_MAPS),
"1", "1")
# Volume Configuration