[Sound-open-firmware] [RFC PATCH 1/5] topology: mixer: Add CONTROLMIXER_MIN
Ranjani Sridharan
ranjani.sridharan at linux.intel.com
Wed May 30 18:02:12 CEST 2018
Should the prefix be mixer control?
mixer might also imply the mixer component?
On Wed, 2018-05-30 at 17:51 +0800, Xiuli Pan wrote:
> From: Pan Xiuli <xiuli.pan at linux.intel.com>
>
> CONTROLMIXER_MIN should go pair with CONTROLMIXER_MAX.
>
> Signed-off-by: Pan Xiuli <xiuli.pan at linux.intel.com>
> ---
> topology/m4/mixercontrol.m4 | 16 +++++++++++-----
> topology/sof/pipe-low-latency-capture.m4 | 3 ++-
> topology/sof/pipe-low-latency-playback.m4 | 2 ++
> topology/sof/pipe-pcm-media.m4 | 1 +
> topology/sof/pipe-tone.m4 | 2 ++
> topology/sof/pipe-volume-capture.m4 | 1 +
> topology/sof/pipe-volume-playback.m4 | 1 +
> 7 files changed, 20 insertions(+), 6 deletions(-)
>
> diff --git a/topology/m4/mixercontrol.m4
> b/topology/m4/mixercontrol.m4
> index a3423c3..2a16d2c 100644
> --- a/topology/m4/mixercontrol.m4
> +++ b/topology/m4/mixercontrol.m4
> @@ -14,6 +14,11 @@ define(`CONTROLMIXER_MAX',
> `#$1'
> ` max STR($2)')
>
> +dnl CONTROLMIXER_MIN(comment, value)
> +define(`CONTROLMIXER_MIN',
> +`#$1'
> +` min STR($2)')
> +
> dnl CONTROLMIXER_TLV(comment, value)
> define(`CONTROLMIXER_TLV',
> `#$1'
> @@ -28,21 +33,22 @@ define(`CONTROLMIXER_OPS',
> ` put STR($4)'
> ` }')
>
> -dnl C_CONTROLMIXER(name, index, ops, max, invert, tlv,
> KCONTROL_CHANNELS)
> +dnl C_CONTROLMIXER(name, index, ops, min, max, invert, tlv,
> KCONTROL_CHANNELS)
> define(`C_CONTROLMIXER',
> `SectionControlMixer."$1 PIPELINE_ID" {'
> `'
> ` # control belongs to this index group'
> ` index STR($2)'
> `'
> -` #$7'
> -` $8'
> +` #$8'
> +` $9'
> ` # control uses bespoke driver get/put/info ID'
> ` $3'
> `'
> ` $4'
> -` invert STR($5)'
> -` $6'
> +` $5'
> +` invert STR($6)'
> +` $7'
>
> `}')
>
> diff --git a/topology/sof/pipe-low-latency-capture.m4
> b/topology/sof/pipe-low-latency-capture.m4
> index 39be2bc..73340a4 100644
> --- a/topology/sof/pipe-low-latency-capture.m4
> +++ b/topology/sof/pipe-low-latency-capture.m4
> @@ -17,7 +17,8 @@ include(`mixercontrol.m4')
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(PCM PCM_ID Capture Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> - CONTROLMIXER_MAX(, 40),
> + CONTROLMIXER_MIN(, 0),
> + CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
> Channel register and shift for Front Left/Right,
> diff --git a/topology/sof/pipe-low-latency-playback.m4
> b/topology/sof/pipe-low-latency-playback.m4
> index b40b793..b4451ff 100644
> --- a/topology/sof/pipe-low-latency-playback.m4
> +++ b/topology/sof/pipe-low-latency-playback.m4
> @@ -33,6 +33,7 @@ include(`mixercontrol.m4')
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> + CONTROLMIXER_MIN(, 0),
> CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
> @@ -42,6 +43,7 @@ C_CONTROLMIXER(PCM PCM_ID Playback Volume,
> PIPELINE_ID,
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> + CONTROLMIXER_MIN(, 0),
> CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
> diff --git a/topology/sof/pipe-pcm-media.m4 b/topology/sof/pipe-pcm-
> media.m4
> index 7f68977..2c0ebee 100644
> --- a/topology/sof/pipe-pcm-media.m4
> +++ b/topology/sof/pipe-pcm-media.m4
> @@ -22,6 +22,7 @@ include(`pcm.m4')
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(PCM PCM_ID Playback Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> + CONTROLMIXER_MIN(, 0),
> CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
> diff --git a/topology/sof/pipe-tone.m4 b/topology/sof/pipe-tone.m4
> index 3cdd408..2bba8b7 100644
> --- a/topology/sof/pipe-tone.m4
> +++ b/topology/sof/pipe-tone.m4
> @@ -22,6 +22,7 @@ include(`pipeline.m4')
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(Tone Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> + CONTROLMIXER_MIN(, 0),
> CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
> @@ -31,6 +32,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_MIN(, 0),
> CONTROLMIXER_MAX(max 1 indicates switch type control, 1),
> false,
> ,
> diff --git a/topology/sof/pipe-volume-capture.m4 b/topology/sof/pipe-
> volume-capture.m4
> index b3d3206..71ff970 100644
> --- a/topology/sof/pipe-volume-capture.m4
> +++ b/topology/sof/pipe-volume-capture.m4
> @@ -19,6 +19,7 @@ include(`pipeline.m4')
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(Master Capture Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> + CONTROLMIXER_MIN(, 0),
> CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
> diff --git a/topology/sof/pipe-volume-playback.m4
> b/topology/sof/pipe-volume-playback.m4
> index 4b12d2a..163507c 100644
> --- a/topology/sof/pipe-volume-playback.m4
> +++ b/topology/sof/pipe-volume-playback.m4
> @@ -19,6 +19,7 @@ include(`pipeline.m4')
> # Volume Mixer control with max value of 32
> C_CONTROLMIXER(Master Playback Volume, PIPELINE_ID,
> CONTROLMIXER_OPS(volsw, 256 binds the mixer control to
> volume get/put handlers, 256, 256),
> + CONTROLMIXER_MIN(, 0),
> CONTROLMIXER_MAX(, 32),
> false,
> CONTROLMIXER_TLV(TLV 32 steps from -90dB to +6dB for 3dB,
> vtlv_m90s3),
More information about the Sound-open-firmware
mailing list