Skip to content

Commit

Permalink
[ALSA] Add the definition of linear volume TLV
Browse files Browse the repository at this point in the history
Added the definition of linear volume TLV type.
Some DSP chips and codecs (e.g. AK codec) use linear volume control.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Sep 23, 2006
1 parent 1f14d16 commit 063a40d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/sound/tlv.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,21 @@

#define SNDRV_CTL_TLVT_CONTAINER 0 /* one level down - group of TLVs */
#define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */
#define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */

#define DECLARE_TLV_DB_SCALE(name, min, step, mute) \
unsigned int name[] = { \
SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \
(min), ((step) & 0xffff) | ((mute) ? 0x10000 : 0) \
}

/* linear volume between min_dB and max_dB (.01dB unit) */
#define DECLARE_TLV_DB_LINEAR(name, min_dB, max_dB) \
unsigned int name[] = { \
SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \
(min_dB), (max_dB) \
}

#define TLV_DB_GAIN_MUTE -9999999

#endif /* __SOUND_TLV_H */

0 comments on commit 063a40d

Please sign in to comment.