aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-08-23 13:53:28 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:44:12 -0400
commit1186ed8c7dc9c0185e783beddf241509cc224f1a (patch)
treef24bf18a5d860ab9a4655c6bc8f67a6eb4a2b667 /sound/pci
parentc6ff77f71fe692fa48fe02dbfe74a01f3d5e55e2 (diff)
[ALSA] Add dB scale information to vxpocket and vx222 drivers
Added the dB scale information to vxpocket and vx222 drivers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/vx222/vx222.c7
-rw-r--r--sound/pci/vx222/vx222_ops.c9
2 files changed, 16 insertions, 0 deletions
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/*