aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/fm801.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c
index f3f2b2c99723..bdfda1997d5b 100644
--- a/sound/pci/fm801.c
+++ b/sound/pci/fm801.c
@@ -29,6 +29,7 @@
29#include <linux/moduleparam.h> 29#include <linux/moduleparam.h>
30#include <sound/core.h> 30#include <sound/core.h>
31#include <sound/pcm.h> 31#include <sound/pcm.h>
32#include <sound/tlv.h>
32#include <sound/ac97_codec.h> 33#include <sound/ac97_codec.h>
33#include <sound/mpu401.h> 34#include <sound/mpu401.h>
34#include <sound/opl3.h> 35#include <sound/opl3.h>
@@ -1053,6 +1054,13 @@ static int snd_fm801_put_single(struct snd_kcontrol *kcontrol,
1053{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_fm801_info_double, \ 1054{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .info = snd_fm801_info_double, \
1054 .get = snd_fm801_get_double, .put = snd_fm801_put_double, \ 1055 .get = snd_fm801_get_double, .put = snd_fm801_put_double, \
1055 .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) } 1056 .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24) }
1057#define FM801_DOUBLE_TLV(xname, reg, shift_left, shift_right, mask, invert, xtlv) \
1058{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, \
1059 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_TLV_READ, \
1060 .name = xname, .info = snd_fm801_info_double, \
1061 .get = snd_fm801_get_double, .put = snd_fm801_put_double, \
1062 .private_value = reg | (shift_left << 8) | (shift_right << 12) | (mask << 16) | (invert << 24), \
1063 .tlv = { .p = (xtlv) } }
1056 1064
1057static int snd_fm801_info_double(struct snd_kcontrol *kcontrol, 1065static int snd_fm801_info_double(struct snd_kcontrol *kcontrol,
1058 struct snd_ctl_elem_info *uinfo) 1066 struct snd_ctl_elem_info *uinfo)
@@ -1149,14 +1157,19 @@ static int snd_fm801_put_mux(struct snd_kcontrol *kcontrol,
1149 return snd_fm801_update_bits(chip, FM801_REC_SRC, 7, val); 1157 return snd_fm801_update_bits(chip, FM801_REC_SRC, 7, val);
1150} 1158}
1151 1159
1160static DECLARE_TLV_DB_SCALE(db_scale_dsp, -3450, 150, 0);
1161
1152#define FM801_CONTROLS ARRAY_SIZE(snd_fm801_controls) 1162#define FM801_CONTROLS ARRAY_SIZE(snd_fm801_controls)
1153 1163
1154static struct snd_kcontrol_new snd_fm801_controls[] __devinitdata = { 1164static struct snd_kcontrol_new snd_fm801_controls[] __devinitdata = {
1155FM801_DOUBLE("Wave Playback Volume", FM801_PCM_VOL, 0, 8, 31, 1), 1165FM801_DOUBLE_TLV("Wave Playback Volume", FM801_PCM_VOL, 0, 8, 31, 1,
1166 db_scale_dsp),
1156FM801_SINGLE("Wave Playback Switch", FM801_PCM_VOL, 15, 1, 1), 1167FM801_SINGLE("Wave Playback Switch", FM801_PCM_VOL, 15, 1, 1),
1157FM801_DOUBLE("I2S Playback Volume", FM801_I2S_VOL, 0, 8, 31, 1), 1168FM801_DOUBLE_TLV("I2S Playback Volume", FM801_I2S_VOL, 0, 8, 31, 1,
1169 db_scale_dsp),
1158FM801_SINGLE("I2S Playback Switch", FM801_I2S_VOL, 15, 1, 1), 1170FM801_SINGLE("I2S Playback Switch", FM801_I2S_VOL, 15, 1, 1),
1159FM801_DOUBLE("FM Playback Volume", FM801_FM_VOL, 0, 8, 31, 1), 1171FM801_DOUBLE_TLV("FM Playback Volume", FM801_FM_VOL, 0, 8, 31, 1,
1172 db_scale_dsp),
1160FM801_SINGLE("FM Playback Switch", FM801_FM_VOL, 15, 1, 1), 1173FM801_SINGLE("FM Playback Switch", FM801_FM_VOL, 15, 1, 1),
1161{ 1174{
1162 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1175 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,