diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-12-12 03:51:03 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-12-12 04:42:25 -0500 |
commit | e9d0a803c127e2e30afb0df780ccb3af4e2adb28 (patch) | |
tree | a3e3ad0bbd31ebb1c4f95f6d308db5723b44086d /sound/isa/opti9xx | |
parent | b2e8d7dab9d82be3851b8cbcc1ab64b1b2575844 (diff) |
ALSA: opti93x: use dB scale for mixer controls
Add dB scale for mixer controls. Fix dB scale for
Master Volume control.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa/opti9xx')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c index ea4a67120468..b0ea310c87de 100644 --- a/sound/isa/opti9xx/opti92x-ad1848.c +++ b/sound/isa/opti9xx/opti92x-ad1848.c | |||
@@ -547,32 +547,40 @@ __skip_mpu: | |||
547 | 547 | ||
548 | #ifdef OPTi93X | 548 | #ifdef OPTi93X |
549 | 549 | ||
550 | static const DECLARE_TLV_DB_SCALE(db_scale_6bit, -9450, 150, 0); | 550 | static const DECLARE_TLV_DB_SCALE(db_scale_5bit_3db_step, -9300, 300, 0); |
551 | static const DECLARE_TLV_DB_SCALE(db_scale_5bit, -4650, 150, 0); | ||
552 | static const DECLARE_TLV_DB_SCALE(db_scale_4bit_12db_max, -3300, 300, 0); | ||
551 | 553 | ||
552 | static struct snd_kcontrol_new snd_opti93x_controls[] = { | 554 | static struct snd_kcontrol_new snd_opti93x_controls[] = { |
553 | WSS_DOUBLE("Master Playback Switch", 0, | 555 | WSS_DOUBLE("Master Playback Switch", 0, |
554 | OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), | 556 | OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 7, 7, 1, 1), |
555 | WSS_DOUBLE_TLV("Master Playback Volume", 0, | 557 | WSS_DOUBLE_TLV("Master Playback Volume", 0, |
556 | OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1, | 558 | OPTi93X_OUT_LEFT, OPTi93X_OUT_RIGHT, 1, 1, 31, 1, |
557 | db_scale_6bit), | 559 | db_scale_5bit_3db_step), |
558 | WSS_DOUBLE("PCM Playback Volume", 0, | 560 | WSS_DOUBLE_TLV("PCM Playback Volume", 0, |
559 | CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 31, 1), | 561 | CS4231_LEFT_OUTPUT, CS4231_RIGHT_OUTPUT, 0, 0, 31, 1, |
560 | WSS_DOUBLE("FM Playback Volume", 0, | 562 | db_scale_5bit), |
561 | CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 1, 1, 15, 1), | 563 | WSS_DOUBLE_TLV("FM Playback Volume", 0, |
564 | CS4231_AUX2_LEFT_INPUT, CS4231_AUX2_RIGHT_INPUT, 1, 1, 15, 1, | ||
565 | db_scale_4bit_12db_max), | ||
562 | WSS_DOUBLE("Line Playback Switch", 0, | 566 | WSS_DOUBLE("Line Playback Switch", 0, |
563 | CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1), | 567 | CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 7, 7, 1, 1), |
564 | WSS_DOUBLE("Line Playback Volume", 0, | 568 | WSS_DOUBLE_TLV("Line Playback Volume", 0, |
565 | CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 15, 1), | 569 | CS4231_LEFT_LINE_IN, CS4231_RIGHT_LINE_IN, 0, 0, 15, 1, |
570 | db_scale_4bit_12db_max), | ||
566 | WSS_DOUBLE("Mic Playback Switch", 0, | 571 | WSS_DOUBLE("Mic Playback Switch", 0, |
567 | OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 7, 7, 1, 1), | 572 | OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 7, 7, 1, 1), |
568 | WSS_DOUBLE("Mic Playback Volume", 0, | 573 | WSS_DOUBLE_TLV("Mic Playback Volume", 0, |
569 | OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1), | 574 | OPTi93X_MIC_LEFT_INPUT, OPTi93X_MIC_RIGHT_INPUT, 1, 1, 15, 1, |
570 | WSS_DOUBLE("CD Playback Volume", 0, | 575 | db_scale_4bit_12db_max), |
571 | CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 1, 1, 15, 1), | 576 | WSS_DOUBLE_TLV("CD Playback Volume", 0, |
577 | CS4231_AUX1_LEFT_INPUT, CS4231_AUX1_RIGHT_INPUT, 1, 1, 15, 1, | ||
578 | db_scale_4bit_12db_max), | ||
572 | WSS_DOUBLE("Aux Playback Switch", 0, | 579 | WSS_DOUBLE("Aux Playback Switch", 0, |
573 | OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 7, 7, 1, 1), | 580 | OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 7, 7, 1, 1), |
574 | WSS_DOUBLE("Aux Playback Volume", 0, | 581 | WSS_DOUBLE_TLV("Aux Playback Volume", 0, |
575 | OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1), | 582 | OPTi931_AUX_LEFT_INPUT, OPTi931_AUX_RIGHT_INPUT, 1, 1, 15, 1, |
583 | db_scale_4bit_12db_max), | ||
576 | }; | 584 | }; |
577 | 585 | ||
578 | static int __devinit snd_opti93x_mixer(struct snd_wss *chip) | 586 | static int __devinit snd_opti93x_mixer(struct snd_wss *chip) |