Commit a0aef8ed authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Add dB scale information to trident driver

Added the dB scale information to trident driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 666c70ff
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <sound/core.h> #include <sound/core.h>
#include <sound/info.h> #include <sound/info.h>
#include <sound/control.h> #include <sound/control.h>
#include <sound/tlv.h>
#include <sound/trident.h> #include <sound/trident.h>
#include <sound/asoundef.h> #include <sound/asoundef.h>
...@@ -2627,6 +2628,8 @@ static int snd_trident_vol_control_get(struct snd_kcontrol *kcontrol, ...@@ -2627,6 +2628,8 @@ static int snd_trident_vol_control_get(struct snd_kcontrol *kcontrol,
return 0; return 0;
} }
static DECLARE_TLV_DB_SCALE(db_scale_gvol, -6375, 25, 0);
static int snd_trident_vol_control_put(struct snd_kcontrol *kcontrol, static int snd_trident_vol_control_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol) struct snd_ctl_elem_value *ucontrol)
{ {
...@@ -2653,6 +2656,7 @@ static struct snd_kcontrol_new snd_trident_vol_music_control __devinitdata = ...@@ -2653,6 +2656,7 @@ static struct snd_kcontrol_new snd_trident_vol_music_control __devinitdata =
.get = snd_trident_vol_control_get, .get = snd_trident_vol_control_get,
.put = snd_trident_vol_control_put, .put = snd_trident_vol_control_put,
.private_value = 16, .private_value = 16,
.tlv = { .p = db_scale_gvol },
}; };
static struct snd_kcontrol_new snd_trident_vol_wave_control __devinitdata = static 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,6 +2667,7 @@ static struct snd_kcontrol_new snd_trident_vol_wave_control __devinitdata =
.get = snd_trident_vol_control_get, .get = snd_trident_vol_control_get,
.put = snd_trident_vol_control_put, .put = snd_trident_vol_control_put,
.private_value = 0, .private_value = 0,
.tlv = { .p = db_scale_gvol },
}; };
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
...@@ -2730,6 +2735,7 @@ static struct snd_kcontrol_new snd_trident_pcm_vol_control __devinitdata = ...@@ -2730,6 +2735,7 @@ static struct snd_kcontrol_new snd_trident_pcm_vol_control __devinitdata =
.info = snd_trident_pcm_vol_control_info, .info = snd_trident_pcm_vol_control_info,
.get = snd_trident_pcm_vol_control_get, .get = snd_trident_pcm_vol_control_get,
.put = snd_trident_pcm_vol_control_put, .put = snd_trident_pcm_vol_control_put,
/* FIXME: no tlv yet */
}; };
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
...@@ -2839,6 +2845,8 @@ static int snd_trident_pcm_rvol_control_put(struct snd_kcontrol *kcontrol, ...@@ -2839,6 +2845,8 @@ static int snd_trident_pcm_rvol_control_put(struct snd_kcontrol *kcontrol,
return change; return change;
} }
static DECLARE_TLV_DB_SCALE(db_scale_crvol, -3175, 25, 1);
static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata = static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata =
{ {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
...@@ -2848,6 +2856,7 @@ static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata = ...@@ -2848,6 +2856,7 @@ static struct snd_kcontrol_new snd_trident_pcm_rvol_control __devinitdata =
.info = snd_trident_pcm_rvol_control_info, .info = snd_trident_pcm_rvol_control_info,
.get = snd_trident_pcm_rvol_control_get, .get = snd_trident_pcm_rvol_control_get,
.put = snd_trident_pcm_rvol_control_put, .put = snd_trident_pcm_rvol_control_put,
.tlv = { .p = db_scale_crvol },
}; };
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
...@@ -2903,6 +2912,7 @@ static struct snd_kcontrol_new snd_trident_pcm_cvol_control __devinitdata = ...@@ -2903,6 +2912,7 @@ static struct snd_kcontrol_new snd_trident_pcm_cvol_control __devinitdata =
.info = snd_trident_pcm_cvol_control_info, .info = snd_trident_pcm_cvol_control_info,
.get = snd_trident_pcm_cvol_control_get, .get = snd_trident_pcm_cvol_control_get,
.put = snd_trident_pcm_cvol_control_put, .put = snd_trident_pcm_cvol_control_put,
.tlv = { .p = db_scale_crvol },
}; };
static void snd_trident_notify_pcm_change1(struct snd_card *card, static void snd_trident_notify_pcm_change1(struct snd_card *card,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment