aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/emu10k1/emufx.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/emufx.c')
-rw-r--r--sound/pci/emu10k1/emufx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index dfba00230d4d..13cd6ce89811 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -35,6 +35,7 @@
35#include <linux/mutex.h> 35#include <linux/mutex.h>
36 36
37#include <sound/core.h> 37#include <sound/core.h>
38#include <sound/tlv.h>
38#include <sound/emu10k1.h> 39#include <sound/emu10k1.h>
39 40
40#if 0 /* for testing purposes - digital out -> capture */ 41#if 0 /* for testing purposes - digital out -> capture */
@@ -266,6 +267,7 @@ static const u32 treble_table[41][5] = {
266 { 0x37c4448b, 0xa45ef51d, 0x262f3267, 0x081e36dc, 0xfd8f5d14 } 267 { 0x37c4448b, 0xa45ef51d, 0x262f3267, 0x081e36dc, 0xfd8f5d14 }
267}; 268};
268 269
270/* dB gain = (float) 20 * log10( float(db_table_value) / 0x8000000 ) */
269static const u32 db_table[101] = { 271static const u32 db_table[101] = {
270 0x00000000, 0x01571f82, 0x01674b41, 0x01783a1b, 0x0189f540, 272 0x00000000, 0x01571f82, 0x01674b41, 0x01783a1b, 0x0189f540,
271 0x019c8651, 0x01aff763, 0x01c45306, 0x01d9a446, 0x01eff6b8, 273 0x019c8651, 0x01aff763, 0x01c45306, 0x01d9a446, 0x01eff6b8,
@@ -290,6 +292,9 @@ static const u32 db_table[101] = {
290 0x7fffffff, 292 0x7fffffff,
291}; 293};
292 294
295/* EMU10k1/EMU10k2 DSP control db gain */
296static DECLARE_TLV_DB_SCALE(snd_emu10k1_db_scale1, -4000, 40, 1);
297
293static const u32 onoff_table[2] = { 298static const u32 onoff_table[2] = {
294 0x00000000, 0x00000001 299 0x00000000, 0x00000001
295}; 300};
@@ -755,6 +760,11 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,
755 knew.device = gctl->id.device; 760 knew.device = gctl->id.device;
756 knew.subdevice = gctl->id.subdevice; 761 knew.subdevice = gctl->id.subdevice;
757 knew.info = snd_emu10k1_gpr_ctl_info; 762 knew.info = snd_emu10k1_gpr_ctl_info;
763 if (gctl->tlv.p) {
764 knew.tlv.p = gctl->tlv.p;
765 knew.access = SNDRV_CTL_ELEM_ACCESS_READWRITE |
766 SNDRV_CTL_ELEM_ACCESS_TLV_READ;
767 }
758 knew.get = snd_emu10k1_gpr_ctl_get; 768 knew.get = snd_emu10k1_gpr_ctl_get;
759 knew.put = snd_emu10k1_gpr_ctl_put; 769 knew.put = snd_emu10k1_gpr_ctl_put;
760 memset(nctl, 0, sizeof(*nctl)); 770 memset(nctl, 0, sizeof(*nctl));
@@ -1013,6 +1023,7 @@ snd_emu10k1_init_mono_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
1013 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval; 1023 ctl->gpr[0] = gpr + 0; ctl->value[0] = defval;
1014 ctl->min = 0; 1024 ctl->min = 0;
1015 ctl->max = 100; 1025 ctl->max = 100;
1026 ctl->tlv.p = snd_emu10k1_db_scale1;
1016 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1027 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
1017} 1028}
1018 1029
@@ -1027,6 +1038,7 @@ snd_emu10k1_init_stereo_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
1027 ctl->gpr[1] = gpr + 1; ctl->value[1] = defval; 1038 ctl->gpr[1] = gpr + 1; ctl->value[1] = defval;
1028 ctl->min = 0; 1039 ctl->min = 0;
1029 ctl->max = 100; 1040 ctl->max = 100;
1041 ctl->tlv.p = snd_emu10k1_db_scale1;
1030 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1042 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
1031} 1043}
1032 1044