From: Clemens Ladisch Date: Mon, 10 Sep 2007 06:05:19 +0000 (+0200) Subject: [ALSA] document basic TLV stuff X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d1761d1b14158498d4782d555a9b367ea4647224;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [ALSA] document basic TLV stuff Add documentation about how to define dB scale information for mixer controls. Signed-off-by: Clemens Ladisch Signed-off-by: Jaroslav Kysela --- diff --git a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl index b9d2dbee9bc3..2c3fc3cb3b6b 100644 --- a/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl +++ b/Documentation/sound/alsa/DocBook/writing-an-alsa-driver.tmpl @@ -18,8 +18,8 @@ - July 26, 2007 - 0.3.6.1 + September 10, 2007 + 0.3.7 @@ -3472,6 +3472,13 @@ struct _snd_pcm_runtime { (casted to unsigned long) of some record to this field, too. + + The tlv field can be used to provide + metadata about the control; see the + + Metadata subsection. + + The other three are @@ -3871,6 +3878,56 @@ struct _snd_pcm_runtime { +
+ Metadata + + 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: + + + + + + + + + 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. + +
+