To provide information about the dB values of a mixer control, use
on of the DECLARE_TLV_xxx
macros from
<sound/tlv.h>
to define a variable
containing this information, set thetlv.p
field to point to this variable, and include the
SNDRV_CTL_ELEM_ACCESS_TLV_READ
flag in the
access
field; like this:
static DECLARE_TLV_DB_SCALE(db_scale_my_control, -4050, 150, 0); static struct snd_kcontrol_new my_control = { ... .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, ... .tlv.p = db_scale_my_control, };
The DECLARE_TLV_DB_SCALE
macro defines
information about a mixer control where each step in the control's
value changes the dB value by a constant dB amount.
The first parameter is the name of the variable to be defined.
The second parameter is the minimum value, in units of 0.01 dB.
The third parameter is the step size, in units of 0.01 dB.
Set the fourth parameter to 1 if the minimum value actually mutes
the control.
The DECLARE_TLV_DB_LINEAR
macro defines
information about a mixer control where the control's value affects
the output linearly.
The first parameter is the name of the variable to be defined.
The second parameter is the minimum value, in units of 0.01 dB.
The third parameter is the maximum value, in units of 0.01 dB.
If the minimum value mutes the control, set the second parameter to
TLV_DB_GAIN_MUTE
.