diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-08-23 13:53:28 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-09-23 04:44:12 -0400 |
commit | 1186ed8c7dc9c0185e783beddf241509cc224f1a (patch) | |
tree | f24bf18a5d860ab9a4655c6bc8f67a6eb4a2b667 /sound/drivers/vx | |
parent | c6ff77f71fe692fa48fe02dbfe74a01f3d5e55e2 (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/drivers/vx')
-rw-r--r-- | sound/drivers/vx/vx_mixer.c | 17 |
1 files changed, 15 insertions, 2 deletions
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 | ||
456 | static struct snd_kcontrol_new vx_control_output_level = { | 457 | static 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 | ||
719 | static DECLARE_TLV_DB_SCALE(db_scale_audio_gain, -10975, 25, 0); | ||
720 | |||
715 | static struct snd_kcontrol_new vx_control_audio_gain = { | 721 | static 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 | }; |
722 | static struct snd_kcontrol_new vx_control_output_switch = { | 731 | static 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 = { | |||
729 | static struct snd_kcontrol_new vx_control_monitor_gain = { | 738 | static 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 | }; |
736 | static struct snd_kcontrol_new vx_control_monitor_switch = { | 748 | static 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 | } |