summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-09-06 19:02:25 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-09-06 19:02:25 -0700
commitb192ede34d629b1a1ac13ea1931e2d859c747f45 (patch)
treebd42014e4ad1bdc3cb51014d011b704500da9a41
parentb5642bbab87ea3481e8e93251a76f19cb3121ad2 (diff)
downloadmediapointer-dvb-s2-b192ede34d629b1a1ac13ea1931e2d859c747f45.tar.gz
mediapointer-dvb-s2-b192ede34d629b1a1ac13ea1931e2d859c747f45.tar.bz2
cx88-alsa: Add TLV support
From: Trent Piepho <xyzzy@speakeasy.org> Lets mixer apps display a dB range for the volume control. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
-rw-r--r--linux/drivers/media/video/cx88/cx88-alsa.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c
index bb6196ea7..dab6fbc06 100644
--- a/linux/drivers/media/video/cx88/cx88-alsa.c
+++ b/linux/drivers/media/video/cx88/cx88-alsa.c
@@ -39,6 +39,7 @@
#include <sound/pcm_params.h>
#include <sound/control.h>
#include <sound/initval.h>
+#include <sound/tlv.h>
#include "compat.h"
#include "cx88.h"
@@ -658,12 +659,17 @@ static int snd_cx88_volume_put(struct snd_kcontrol *kcontrol,
return changed;
}
+static const DECLARE_TLV_DB_SCALE(snd_cx88_db_scale, -6300, 100, 0);
+
static struct snd_kcontrol_new snd_cx88_volume = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+ .access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
+ SNDRV_CTL_ELEM_ACCESS_TLV_READ,
.name = "Playback Volume",
.info = snd_cx88_volume_info,
.get = snd_cx88_volume_get,
.put = snd_cx88_volume_put,
+ .tlv.p = snd_cx88_db_scale,
};
static int snd_cx88_switch_get(struct snd_kcontrol *kcontrol,