aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrzysztof Helt <krzysztof.h1@wp.pl>2009-10-10 04:25:39 -0400
committerTakashi Iwai <tiwai@suse.de>2009-10-10 04:55:10 -0400
commitabd134db940ddccaf6a61d88cf0841a62b917ab3 (patch)
tree84e1df92acc61e1bc6f5b7d29d92cc494485180f
parent6fcfa3959a5f5ecb7c333f54f401575d94eb8172 (diff)
ALSA: wss: convert CS4231 mixer to dB scale
Convert CS4231 mixer to dB scale after AD1848 mixer. Also, add missing microphone boost control for the AD1848 and correct wrong bits for loopback volume on the AD1848. Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/isa/wss/wss_lib.c43
1 files changed, 26 insertions, 17 deletions
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c
index 5d2ba1b749ab..754a2089c650 100644
--- a/sound/isa/wss/wss_lib.c
+++ b/sound/isa/wss/wss_lib.c
@@ -2198,6 +2198,7 @@ EXPORT_SYMBOL(snd_wss_put_double);
2198static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0); 2198static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0);
2199static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); 2199static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0);
2200static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); 2200static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0);
2201static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0);
2201 2202
2202static struct snd_kcontrol_new snd_ad1848_controls[] = { 2203static struct snd_kcontrol_new snd_ad1848_controls[] = {
2203WSS_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 2204WSS_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT,
@@ -2224,38 +2225,45 @@ WSS_DOUBLE_TLV("Capture Volume", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT,
2224 .get = snd_wss_get_mux, 2225 .get = snd_wss_get_mux,
2225 .put = snd_wss_put_mux, 2226 .put = snd_wss_put_mux,
2226}, 2227},
2228WSS_DOUBLE("Mic Boost", 0,
2229 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0),
2227WSS_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0), 2230WSS_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0),
2228WSS_SINGLE_TLV("Loopback Capture Volume", 0, CS4231_LOOPBACK, 1, 63, 0, 2231WSS_SINGLE_TLV("Loopback Capture Volume", 0, CS4231_LOOPBACK, 2, 63, 1,
2229 db_scale_6bit), 2232 db_scale_6bit),
2230}; 2233};
2231 2234
2232static struct snd_kcontrol_new snd_wss_controls[] = { 2235static struct snd_kcontrol_new snd_wss_controls[] = {
2233WSS_DOUBLE("PCM Playback Switch", 0, 2236WSS_DOUBLE("PCM Playback Switch", 0,
2234 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), 2237 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
2235WSS_DOUBLE("PCM Playback Volume", 0, 2238WSS_DOUBLE_TLV("PCM Playback Volume", 0,
2236 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1), 2239 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 63, 1,
2240 db_scale_6bit),
2237WSS_DOUBLE("Line Playback Switch", 0, 2241WSS_DOUBLE("Line Playback Switch", 0,
2238 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1), 2242 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1),
2239WSS_DOUBLE("Line Playback Volume", 0, 2243WSS_DOUBLE_TLV("Line Playback Volume", 0,
2240 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1), 2244 CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 31, 1,
2245 db_scale_5bit_12db_max),
2241WSS_DOUBLE("Aux Playback Switch", 0, 2246WSS_DOUBLE("Aux Playback Switch", 0,
2242 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1), 2247 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 7, 7, 1, 1),
2243WSS_DOUBLE("Aux Playback Volume", 0, 2248WSS_DOUBLE_TLV("Aux Playback Volume", 0,
2244 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1), 2249 CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 0, 0, 31, 1,
2250 db_scale_5bit_12db_max),
2245WSS_DOUBLE("Aux Playback Switch", 1, 2251WSS_DOUBLE("Aux Playback Switch", 1,
2246 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1), 2252 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 7, 7, 1, 1),
2247WSS_DOUBLE("Aux Playback Volume", 1, 2253WSS_DOUBLE_TLV("Aux Playback Volume", 1,
2248 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1), 2254 CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 0, 0, 31, 1,
2255 db_scale_5bit_12db_max),
2249WSS_SINGLE("Mono Playback Switch", 0, 2256WSS_SINGLE("Mono Playback Switch", 0,
2250 CS4231_MONO_CTRL, 7, 1, 1), 2257 CS4231_MONO_CTRL, 7, 1, 1),
2251WSS_SINGLE("Mono Playback Volume", 0, 2258WSS_SINGLE_TLV("Mono Playback Volume", 0,
2252 CS4231_MONO_CTRL, 0, 15, 1), 2259 CS4231_MONO_CTRL, 0, 15, 1,
2260 db_scale_4bit),
2253WSS_SINGLE("Mono Output Playback Switch", 0, 2261WSS_SINGLE("Mono Output Playback Switch", 0,
2254 CS4231_MONO_CTRL, 6, 1, 1), 2262 CS4231_MONO_CTRL, 6, 1, 1),
2255WSS_SINGLE("Mono Output Playback Bypass", 0, 2263WSS_SINGLE("Mono Output Playback Bypass", 0,
2256 CS4231_MONO_CTRL, 5, 1, 0), 2264 CS4231_MONO_CTRL, 5, 1, 0),
2257WSS_DOUBLE("Capture Volume", 0, 2265WSS_DOUBLE_TLV("Capture Volume", 0, CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT,
2258 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 0, 0, 15, 0), 2266 0, 0, 15, 0, db_scale_rec_gain),
2259{ 2267{
2260 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 2268 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
2261 .name = "Capture Source", 2269 .name = "Capture Source",
@@ -2267,15 +2275,16 @@ WSS_DOUBLE("Mic Boost", 0,
2267 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0), 2275 CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0),
2268WSS_SINGLE("Loopback Capture Switch", 0, 2276WSS_SINGLE("Loopback Capture Switch", 0,
2269 CS4231_LOOPBACK, 0, 1, 0), 2277 CS4231_LOOPBACK, 0, 1, 0),
2270WSS_SINGLE("Loopback Capture Volume", 0, 2278WSS_SINGLE_TLV("Loopback Capture Volume", 0, CS4231_LOOPBACK, 2, 63, 1,
2271 CS4231_LOOPBACK, 2, 63, 1) 2279 db_scale_6bit),
2272}; 2280};
2273 2281
2274static struct snd_kcontrol_new snd_opti93x_controls[] = { 2282static struct snd_kcontrol_new snd_opti93x_controls[] = {
2275WSS_DOUBLE("Master Playback Switch", 0, 2283WSS_DOUBLE("Master Playback Switch", 0,
2276 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), 2284 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1),
2277WSS_DOUBLE("Master Playback Volume", 0, 2285WSS_DOUBLE_TLV("Master Playback Volume", 0,
2278 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1), 2286 OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1,
2287 db_scale_6bit),
2279WSS_DOUBLE("PCM Playback Switch", 0, 2288WSS_DOUBLE("PCM Playback Switch", 0,
2280 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1), 2289 CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 7, 7, 1, 1),
2281WSS_DOUBLE("PCM Playback Volume", 0, 2290WSS_DOUBLE("PCM Playback Volume", 0,