aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-08-23 07:01:37 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:43:14 -0400
commita0aef8edfc9d6d682dba557fe42599297cbc329a (patch)
treebf1cf3b912ac3e1d8a51029002d6dd2c5b4c6eac /sound
parent666c70ffd1c4be795de988f26a8ab13524d4ed47 (diff)
[ALSA] Add dB scale information to trident driver
Added the dB scale information to trident driver. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/trident/trident_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 4930cc6b054..ebbe12d78d8 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -40,6 +40,7 @@
40#include <sound/core.h> 40#include <sound/core.h>
41#include <sound/info.h> 41#include <sound/info.h>
42#include <sound/control.h> 42#include <sound/control.h>
43#include <sound/tlv.h>
43#include <sound/trident.h> 44#include <sound/trident.h>
44#include <sound/asoundef.h> 45#include <sound/asoundef.h>
45 46
@@ -2627,6 +2628,8 @@ static int snd_trident_vol_control_get(struct snd_kcontrol *kcontrol,
2627 return 0; 2628 return 0;
2628} 2629}
2629 2630
2631static DECLARE_TLV_DB_SCALE(db_scale_gvol, -6375, 25, 0);
2632
2630static int snd_trident_vol_control_put(struct snd_kcontrol *kcontrol, 2633static int snd_trident_vol_control_put(struct snd_kcontrol *kcontrol,
2631 struct snd_ctl_elem_value *ucontrol) 2634 struct snd_ctl_elem_value *ucontrol)
2632{ 2635{
@@ -2653,6 +2656,7 @@ static struct snd_kcontrol_new snd_trident_vol_music_control __devinitdata =
2653 .get = snd_trident_vol_control_get, 2656 .get = snd_trident_vol_control_get,
2654 .put = snd_trident_vol_control_put, 2657 .put = snd_trident_vol_control_put,
2655 .private_value = 16, 2658 .private_value = 16,
2659 .tlv = { .p = db_scale_gvol },
2656}; 2660};
2657 2661
2658static struct snd_kcontrol_new snd_trident_vol_wave_control __devinitdata = 2662static struct snd_kcontrol_new snd_trident_vol_wave_control __devinitdata =
@@ -2663,6 +2667,7 @@ static struct snd_kcontrol_new snd_trident_vol_wave_control __devinitdata =
2663 .get = snd_trident_vol_control_get, 2667 .get = snd_trident_vol_control_get,
2664 .put = snd_trident_vol_control_put, 2668 .put = snd_trident_vol_control_put,
2665 .private_value = 0, 2669 .private_value = 0,
2670 .tlv = { .p = db_scale_gvol },
2666}; 2671};
2667 2672
2668/*--------------------------------------------------------------------------- 2673/*---------------------------------------------------------------------------
@@ -2730,6 +2735,7 @@ static struct snd_kcontrol_new snd_trident_pcm_vol_control __devinitdata =
2730 .info = snd_trident_pcm_vol_control_info, 2735 .info = snd_trident_pcm_vol_control_info,
2731 .get = snd_trident_pcm_vol_control_get, 2736 .get = snd_trident_pcm_vol_control_get,
2732 .put = snd_trident_pcm_vol_control_put, 2737 .put = snd_trident_pcm_vol_control_put,
2738 /* FIXME: no tlv yet */
2733}; 2739};
2734 2740
2735/*--------------------------------------------------------------------------- 2741/*---------------------------------------------------------------------------
@@ -2839,6 +2845,8 @@ static int snd_trident_pcm_rvol_control_put(struct snd_kcontrol *kcontrol,
2839 return change; 2845 return change;
2840} 2846}
2841 2847
2848static DECLARE_TLV_DB_SCALE(db_scale_crvol, -3175, 25, 1);
2849
2842static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata = 2850static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata =
2843{ 2851{
2844 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2852 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -2848,6 +2856,7 @@ static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata =
2848 .info = snd_trident_pcm_rvol_control_info, 2856 .info = snd_trident_pcm_rvol_control_info,
2849 .get = snd_trident_pcm_rvol_control_get, 2857 .get = snd_trident_pcm_rvol_control_get,
2850 .put = snd_trident_pcm_rvol_control_put, 2858 .put = snd_trident_pcm_rvol_control_put,
2859 .tlv = { .p = db_scale_crvol },
2851}; 2860};
2852 2861
2853/*--------------------------------------------------------------------------- 2862/*---------------------------------------------------------------------------
@@ -2903,6 +2912,7 @@ static struct snd_kcontrol_new snd_trident_pcm_cvol_control __devinitdata =
2903 .info = snd_trident_pcm_cvol_control_info, 2912 .info = snd_trident_pcm_cvol_control_info,
2904 .get = snd_trident_pcm_cvol_control_get, 2913 .get = snd_trident_pcm_cvol_control_get,
2905 .put = snd_trident_pcm_cvol_control_put, 2914 .put = snd_trident_pcm_cvol_control_put,
2915 .tlv = { .p = db_scale_crvol },
2906}; 2916};
2907 2917
2908static void snd_trident_notify_pcm_change1(struct snd_card *card, 2918static void snd_trident_notify_pcm_change1(struct snd_card *card,