diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-10-10 04:25:39 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-10-10 04:55:10 -0400 |
commit | abd134db940ddccaf6a61d88cf0841a62b917ab3 (patch) | |
tree | 84e1df92acc61e1bc6f5b7d29d92cc494485180f | |
parent | 6fcfa3959a5f5ecb7c333f54f401575d94eb8172 (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.c | 43 |
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); | |||
2198 | static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0); | 2198 | static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0); |
2199 | static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); | 2199 | static const DECLARE_TLV_DB_SCALE(db_scale_5bit_12db_max, -3450, 150, 0); |
2200 | static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); | 2200 | static const DECLARE_TLV_DB_SCALE(db_scale_rec_gain, 0, 150, 0); |
2201 | static const DECLARE_TLV_DB_SCALE(db_scale_4bit, -4500, 300, 0); | ||
2201 | 2202 | ||
2202 | static struct snd_kcontrol_new snd_ad1848_controls[] = { | 2203 | static struct snd_kcontrol_new snd_ad1848_controls[] = { |
2203 | WSS_DOUBLE("PCM Playback Switch", 0, CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, | 2204 | WSS_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 | }, |
2228 | WSS_DOUBLE("Mic Boost", 0, | ||
2229 | CS4231_LEFT_INPUT, CS4231_RIGHT_INPUT, 5, 5, 1, 0), | ||
2227 | WSS_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0), | 2230 | WSS_SINGLE("Loopback Capture Switch", 0, CS4231_LOOPBACK, 0, 1, 0), |
2228 | WSS_SINGLE_TLV("Loopback Capture Volume", 0, CS4231_LOOPBACK, 1, 63, 0, | 2231 | WSS_SINGLE_TLV("Loopback Capture Volume", 0, CS4231_LOOPBACK, 2, 63, 1, |
2229 | db_scale_6bit), | 2232 | db_scale_6bit), |
2230 | }; | 2233 | }; |
2231 | 2234 | ||
2232 | static struct snd_kcontrol_new snd_wss_controls[] = { | 2235 | static struct snd_kcontrol_new snd_wss_controls[] = { |
2233 | WSS_DOUBLE("PCM Playback Switch", 0, | 2236 | WSS_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), |
2235 | WSS_DOUBLE("PCM Playback Volume", 0, | 2238 | WSS_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), | ||
2237 | WSS_DOUBLE("Line Playback Switch", 0, | 2241 | WSS_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), |
2239 | WSS_DOUBLE("Line Playback Volume", 0, | 2243 | WSS_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), | ||
2241 | WSS_DOUBLE("Aux Playback Switch", 0, | 2246 | WSS_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), |
2243 | WSS_DOUBLE("Aux Playback Volume", 0, | 2248 | WSS_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), | ||
2245 | WSS_DOUBLE("Aux Playback Switch", 1, | 2251 | WSS_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), |
2247 | WSS_DOUBLE("Aux Playback Volume", 1, | 2253 | WSS_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), | ||
2249 | WSS_SINGLE("Mono Playback Switch", 0, | 2256 | WSS_SINGLE("Mono Playback Switch", 0, |
2250 | CS4231_MONO_CTRL, 7, 1, 1), | 2257 | CS4231_MONO_CTRL, 7, 1, 1), |
2251 | WSS_SINGLE("Mono Playback Volume", 0, | 2258 | WSS_SINGLE_TLV("Mono Playback Volume", 0, |
2252 | CS4231_MONO_CTRL, 0, 15, 1), | 2259 | CS4231_MONO_CTRL, 0, 15, 1, |
2260 | db_scale_4bit), | ||
2253 | WSS_SINGLE("Mono Output Playback Switch", 0, | 2261 | WSS_SINGLE("Mono Output Playback Switch", 0, |
2254 | CS4231_MONO_CTRL, 6, 1, 1), | 2262 | CS4231_MONO_CTRL, 6, 1, 1), |
2255 | WSS_SINGLE("Mono Output Playback Bypass", 0, | 2263 | WSS_SINGLE("Mono Output Playback Bypass", 0, |
2256 | CS4231_MONO_CTRL, 5, 1, 0), | 2264 | CS4231_MONO_CTRL, 5, 1, 0), |
2257 | WSS_DOUBLE("Capture Volume", 0, | 2265 | WSS_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), |
2268 | WSS_SINGLE("Loopback Capture Switch", 0, | 2276 | WSS_SINGLE("Loopback Capture Switch", 0, |
2269 | CS4231_LOOPBACK, 0, 1, 0), | 2277 | CS4231_LOOPBACK, 0, 1, 0), |
2270 | WSS_SINGLE("Loopback Capture Volume", 0, | 2278 | WSS_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 | ||
2274 | static struct snd_kcontrol_new snd_opti93x_controls[] = { | 2282 | static struct snd_kcontrol_new snd_opti93x_controls[] = { |
2275 | WSS_DOUBLE("Master Playback Switch", 0, | 2283 | WSS_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), |
2277 | WSS_DOUBLE("Master Playback Volume", 0, | 2285 | WSS_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), | ||
2279 | WSS_DOUBLE("PCM Playback Switch", 0, | 2288 | WSS_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), |
2281 | WSS_DOUBLE("PCM Playback Volume", 0, | 2290 | WSS_DOUBLE("PCM Playback Volume", 0, |