aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/vx_core.h1
-rw-r--r--sound/drivers/vx/vx_mixer.c17
-rw-r--r--sound/pci/vx222/vx222.c7
-rw-r--r--sound/pci/vx222/vx222_ops.c9
-rw-r--r--sound/pcmcia/vx/vxpocket.c5
5 files changed, 37 insertions, 2 deletions
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index 9821a6194caa..dbca14170615 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -128,6 +128,7 @@ struct snd_vx_hardware {
128 unsigned int num_ins; 128 unsigned int num_ins;
129 unsigned int num_outs; 129 unsigned int num_outs;
130 unsigned int output_level_max; 130 unsigned int output_level_max;
131 unsigned int *output_level_db_scale;
131}; 132};
132 133
133/* hwdep id string */ 134/* hwdep id string */
diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c
index c1d7fcdd1973..1613ed844ac6 100644
--- a/sound/drivers/vx/vx_mixer.c
+++ b/sound/drivers/vx/vx_mixer.c
@@ -23,6 +23,7 @@
23#include <sound/driver.h> 23#include <sound/driver.h>
24#include <sound/core.h> 24#include <sound/core.h>
25#include <sound/control.h> 25#include <sound/control.h>
26#include <sound/tlv.h>
26#include <sound/vx_core.h> 27#include <sound/vx_core.h>
27#include "vx_cmd.h" 28#include "vx_cmd.h"
28 29
@@ -455,10 +456,13 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
455 456
456static struct snd_kcontrol_new vx_control_output_level = { 457static struct snd_kcontrol_new vx_control_output_level = {
457 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 458 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
459 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
460 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
458 .name = "Master Playback Volume", 461 .name = "Master Playback Volume",
459 .info = vx_output_level_info, 462 .info = vx_output_level_info,
460 .get = vx_output_level_get, 463 .get = vx_output_level_get,
461 .put = vx_output_level_put, 464 .put = vx_output_level_put,
465 /* tlv will be filled later */
462}; 466};
463 467
464/* 468/*
@@ -712,12 +716,17 @@ static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
712 return 0; 716 return 0;
713} 717}
714 718
719static DECLARE_TLV_DB_SCALE(db_scale_audio_gain, -10975, 25, 0);
720
715static struct snd_kcontrol_new vx_control_audio_gain = { 721static struct snd_kcontrol_new vx_control_audio_gain = {
716 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 722 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
723 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
724 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
717 /* name will be filled later */ 725 /* name will be filled later */
718 .info = vx_audio_gain_info, 726 .info = vx_audio_gain_info,
719 .get = vx_audio_gain_get, 727 .get = vx_audio_gain_get,
720 .put = vx_audio_gain_put 728 .put = vx_audio_gain_put,
729 .tlv = { .p = db_scale_audio_gain },
721}; 730};
722static struct snd_kcontrol_new vx_control_output_switch = { 731static struct snd_kcontrol_new vx_control_output_switch = {
723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 732 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -729,9 +738,12 @@ static struct snd_kcontrol_new vx_control_output_switch = {
729static struct snd_kcontrol_new vx_control_monitor_gain = { 738static struct snd_kcontrol_new vx_control_monitor_gain = {
730 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 739 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
731 .name = "Monitoring Volume", 740 .name = "Monitoring Volume",
741 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
742 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
732 .info = vx_audio_gain_info, /* shared */ 743 .info = vx_audio_gain_info, /* shared */
733 .get = vx_audio_monitor_get, 744 .get = vx_audio_monitor_get,
734 .put = vx_audio_monitor_put 745 .put = vx_audio_monitor_put,
746 .tlv = { .p = db_scale_audio_gain },
735}; 747};
736static struct snd_kcontrol_new vx_control_monitor_switch = { 748static struct snd_kcontrol_new vx_control_monitor_switch = {
737 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 749 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -918,6 +930,7 @@ int snd_vx_mixer_new(struct vx_core *chip)
918 for (i = 0; i < chip->hw->num_outs; i++) { 930 for (i = 0; i < chip->hw->num_outs; i++) {
919 temp = vx_control_output_level; 931 temp = vx_control_output_level;
920 temp.index = i; 932 temp.index = i;
933 temp.tlv.p = chip->hw->output_level_db_scale;
921 if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0) 934 if ((err = snd_ctl_add(card, snd_ctl_new1(&temp, chip))) < 0)
922 return err; 935 return err;
923 } 936 }
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index 9c03c6b4e490..e7cd8acab59a 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -26,6 +26,7 @@
26#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
27#include <sound/core.h> 27#include <sound/core.h>
28#include <sound/initval.h> 28#include <sound/initval.h>
29#include <sound/tlv.h>
29#include "vx222.h" 30#include "vx222.h"
30 31
31#define CARD_NAME "VX222" 32#define CARD_NAME "VX222"
@@ -72,6 +73,9 @@ MODULE_DEVICE_TABLE(pci, snd_vx222_ids);
72/* 73/*
73 */ 74 */
74 75
76static DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0);
77static DECLARE_TLV_DB_SCALE(db_scale_akm, -7350, 50, 0);
78
75static struct snd_vx_hardware vx222_old_hw = { 79static struct snd_vx_hardware vx222_old_hw = {
76 80
77 .name = "VX222/Old", 81 .name = "VX222/Old",
@@ -81,6 +85,7 @@ static struct snd_vx_hardware vx222_old_hw = {
81 .num_ins = 1, 85 .num_ins = 1,
82 .num_outs = 1, 86 .num_outs = 1,
83 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX, 87 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX,
88 .output_level_db_scale = db_scale_old_vol,
84}; 89};
85 90
86static struct snd_vx_hardware vx222_v2_hw = { 91static struct snd_vx_hardware vx222_v2_hw = {
@@ -92,6 +97,7 @@ static struct snd_vx_hardware vx222_v2_hw = {
92 .num_ins = 1, 97 .num_ins = 1,
93 .num_outs = 1, 98 .num_outs = 1,
94 .output_level_max = VX2_AKM_LEVEL_MAX, 99 .output_level_max = VX2_AKM_LEVEL_MAX,
100 .output_level_db_scale = db_scale_akm,
95}; 101};
96 102
97static struct snd_vx_hardware vx222_mic_hw = { 103static struct snd_vx_hardware vx222_mic_hw = {
@@ -103,6 +109,7 @@ static struct snd_vx_hardware vx222_mic_hw = {
103 .num_ins = 1, 109 .num_ins = 1,
104 .num_outs = 1, 110 .num_outs = 1,
105 .output_level_max = VX2_AKM_LEVEL_MAX, 111 .output_level_max = VX2_AKM_LEVEL_MAX,
112 .output_level_db_scale = db_scale_akm,
106}; 113};
107 114
108 115
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index 9b6d345b83a6..5e51950e05f9 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -28,6 +28,7 @@
28 28
29#include <sound/core.h> 29#include <sound/core.h>
30#include <sound/control.h> 30#include <sound/control.h>
31#include <sound/tlv.h>
31#include <asm/io.h> 32#include <asm/io.h>
32#include "vx222.h" 33#include "vx222.h"
33 34
@@ -845,6 +846,8 @@ static void vx2_set_input_level(struct snd_vx222 *chip)
845 846
846#define MIC_LEVEL_MAX 0xff 847#define MIC_LEVEL_MAX 0xff
847 848
849static DECLARE_TLV_DB_SCALE(db_scale_mic, -6450, 50, 0);
850
848/* 851/*
849 * controls API for input levels 852 * controls API for input levels
850 */ 853 */
@@ -922,18 +925,24 @@ static int vx_mic_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
922 925
923static struct snd_kcontrol_new vx_control_input_level = { 926static struct snd_kcontrol_new vx_control_input_level = {
924 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 927 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
928 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
929 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
925 .name = "Capture Volume", 930 .name = "Capture Volume",
926 .info = vx_input_level_info, 931 .info = vx_input_level_info,
927 .get = vx_input_level_get, 932 .get = vx_input_level_get,
928 .put = vx_input_level_put, 933 .put = vx_input_level_put,
934 .tlv = { .p = db_scale_mic },
929}; 935};
930 936
931static struct snd_kcontrol_new vx_control_mic_level = { 937static struct snd_kcontrol_new vx_control_mic_level = {
932 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 938 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
939 .access = (SNDRV_CTL_ELEM_ACCESS_READWRITE |
940 SNDRV_CTL_ELEM_ACCESS_TLV_READ),
933 .name = "Mic Capture Volume", 941 .name = "Mic Capture Volume",
934 .info = vx_mic_level_info, 942 .info = vx_mic_level_info,
935 .get = vx_mic_level_get, 943 .get = vx_mic_level_get,
936 .put = vx_mic_level_put, 944 .put = vx_mic_level_put,
945 .tlv = { .p = db_scale_mic },
937}; 946};
938 947
939/* 948/*
diff --git a/sound/pcmcia/vx/vxpocket.c b/sound/pcmcia/vx/vxpocket.c
index 76c85cffb40e..3089fcca800e 100644
--- a/sound/pcmcia/vx/vxpocket.c
+++ b/sound/pcmcia/vx/vxpocket.c
@@ -27,6 +27,7 @@
27#include <pcmcia/ciscode.h> 27#include <pcmcia/ciscode.h>
28#include <pcmcia/cisreg.h> 28#include <pcmcia/cisreg.h>
29#include <sound/initval.h> 29#include <sound/initval.h>
30#include <sound/tlv.h>
30 31
31/* 32/*
32 */ 33 */
@@ -90,6 +91,8 @@ static int snd_vxpocket_dev_free(struct snd_device *device)
90 * Only output levels can be modified 91 * Only output levels can be modified
91 */ 92 */
92 93
94static DECLARE_TLV_DB_SCALE(db_scale_old_vol, -11350, 50, 0);
95
93static struct snd_vx_hardware vxpocket_hw = { 96static struct snd_vx_hardware vxpocket_hw = {
94 .name = "VXPocket", 97 .name = "VXPocket",
95 .type = VX_TYPE_VXPOCKET, 98 .type = VX_TYPE_VXPOCKET,
@@ -99,6 +102,7 @@ static struct snd_vx_hardware vxpocket_hw = {
99 .num_ins = 1, 102 .num_ins = 1,
100 .num_outs = 1, 103 .num_outs = 1,
101 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX, 104 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX,
105 .output_level_db_scale = db_scale_old_vol,
102}; 106};
103 107
104/* VX-pocket 440 108/* VX-pocket 440
@@ -120,6 +124,7 @@ static struct snd_vx_hardware vxp440_hw = {
120 .num_ins = 2, 124 .num_ins = 2,
121 .num_outs = 2, 125 .num_outs = 2,
122 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX, 126 .output_level_max = VX_ANALOG_OUT_LEVEL_MAX,
127 .output_level_db_scale = db_scale_old_vol,
123}; 128};
124 129
125 130