diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2008-08-17 16:38:27 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-08-25 03:57:06 -0400 |
commit | ace457c77ba8c0705e14d95c65e73d7e569bd7b9 (patch) | |
tree | d887d4984ac52f7df0223da993ea9b224382b265 /sound/isa/wss | |
parent | 9e44c6e40fb383e6b1d0df0c9e375a98e11828d1 (diff) |
ALSA: wss_lib: snd_wss_calibrate_mute improvement
Mute sound by setting mute bit without
setting volume to 0. It makes both source code
and binary shorter.
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/isa/wss')
-rw-r--r-- | sound/isa/wss/wss_lib.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index c5beec65936d..2a5defa5e636 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c | |||
@@ -574,7 +574,7 @@ static void snd_wss_calibrate_mute(struct snd_wss *chip, int mute) | |||
574 | { | 574 | { |
575 | unsigned long flags; | 575 | unsigned long flags; |
576 | 576 | ||
577 | mute = mute ? 1 : 0; | 577 | mute = mute ? 0x80 : 0; |
578 | spin_lock_irqsave(&chip->reg_lock, flags); | 578 | spin_lock_irqsave(&chip->reg_lock, flags); |
579 | if (chip->calibrate_mute == mute) { | 579 | if (chip->calibrate_mute == mute) { |
580 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 580 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
@@ -589,34 +589,34 @@ static void snd_wss_calibrate_mute(struct snd_wss *chip, int mute) | |||
589 | chip->image[CS4231_LOOPBACK]); | 589 | chip->image[CS4231_LOOPBACK]); |
590 | } | 590 | } |
591 | snd_wss_dout(chip, CS4231_AUX1_LEFT_INPUT, | 591 | snd_wss_dout(chip, CS4231_AUX1_LEFT_INPUT, |
592 | mute ? 0x80 : chip->image[CS4231_AUX1_LEFT_INPUT]); | 592 | mute | chip->image[CS4231_AUX1_LEFT_INPUT]); |
593 | snd_wss_dout(chip, CS4231_AUX1_RIGHT_INPUT, | 593 | snd_wss_dout(chip, CS4231_AUX1_RIGHT_INPUT, |
594 | mute ? 0x80 : chip->image[CS4231_AUX1_RIGHT_INPUT]); | 594 | mute | chip->image[CS4231_AUX1_RIGHT_INPUT]); |
595 | snd_wss_dout(chip, CS4231_AUX2_LEFT_INPUT, | 595 | snd_wss_dout(chip, CS4231_AUX2_LEFT_INPUT, |
596 | mute ? 0x80 : chip->image[CS4231_AUX2_LEFT_INPUT]); | 596 | mute | chip->image[CS4231_AUX2_LEFT_INPUT]); |
597 | snd_wss_dout(chip, CS4231_AUX2_RIGHT_INPUT, | 597 | snd_wss_dout(chip, CS4231_AUX2_RIGHT_INPUT, |
598 | mute ? 0x80 : chip->image[CS4231_AUX2_RIGHT_INPUT]); | 598 | mute | chip->image[CS4231_AUX2_RIGHT_INPUT]); |
599 | snd_wss_dout(chip, CS4231_LEFT_OUTPUT, | 599 | snd_wss_dout(chip, CS4231_LEFT_OUTPUT, |
600 | mute ? 0x80 : chip->image[CS4231_LEFT_OUTPUT]); | 600 | mute | chip->image[CS4231_LEFT_OUTPUT]); |
601 | snd_wss_dout(chip, CS4231_RIGHT_OUTPUT, | 601 | snd_wss_dout(chip, CS4231_RIGHT_OUTPUT, |
602 | mute ? 0x80 : chip->image[CS4231_RIGHT_OUTPUT]); | 602 | mute | chip->image[CS4231_RIGHT_OUTPUT]); |
603 | if (!(chip->hardware & WSS_HW_AD1848_MASK)) { | 603 | if (!(chip->hardware & WSS_HW_AD1848_MASK)) { |
604 | snd_wss_dout(chip, CS4231_LEFT_LINE_IN, | 604 | snd_wss_dout(chip, CS4231_LEFT_LINE_IN, |
605 | mute ? 0x80 : chip->image[CS4231_LEFT_LINE_IN]); | 605 | mute | chip->image[CS4231_LEFT_LINE_IN]); |
606 | snd_wss_dout(chip, CS4231_RIGHT_LINE_IN, | 606 | snd_wss_dout(chip, CS4231_RIGHT_LINE_IN, |
607 | mute ? 0x80 : chip->image[CS4231_RIGHT_LINE_IN]); | 607 | mute | chip->image[CS4231_RIGHT_LINE_IN]); |
608 | snd_wss_dout(chip, CS4231_MONO_CTRL, | 608 | snd_wss_dout(chip, CS4231_MONO_CTRL, |
609 | mute ? 0xc0 : chip->image[CS4231_MONO_CTRL]); | 609 | mute ? 0xc0 : chip->image[CS4231_MONO_CTRL]); |
610 | } | 610 | } |
611 | if (chip->hardware == WSS_HW_INTERWAVE) { | 611 | if (chip->hardware == WSS_HW_INTERWAVE) { |
612 | snd_wss_dout(chip, CS4231_LEFT_MIC_INPUT, | 612 | snd_wss_dout(chip, CS4231_LEFT_MIC_INPUT, |
613 | mute ? 0x80 : chip->image[CS4231_LEFT_MIC_INPUT]); | 613 | mute | chip->image[CS4231_LEFT_MIC_INPUT]); |
614 | snd_wss_dout(chip, CS4231_RIGHT_MIC_INPUT, | 614 | snd_wss_dout(chip, CS4231_RIGHT_MIC_INPUT, |
615 | mute ? 0x80 : chip->image[CS4231_RIGHT_MIC_INPUT]); | 615 | mute | chip->image[CS4231_RIGHT_MIC_INPUT]); |
616 | snd_wss_dout(chip, CS4231_LINE_LEFT_OUTPUT, | 616 | snd_wss_dout(chip, CS4231_LINE_LEFT_OUTPUT, |
617 | mute ? 0x80 : chip->image[CS4231_LINE_LEFT_OUTPUT]); | 617 | mute | chip->image[CS4231_LINE_LEFT_OUTPUT]); |
618 | snd_wss_dout(chip, CS4231_LINE_RIGHT_OUTPUT, | 618 | snd_wss_dout(chip, CS4231_LINE_RIGHT_OUTPUT, |
619 | mute ? 0x80 : chip->image[CS4231_LINE_RIGHT_OUTPUT]); | 619 | mute | chip->image[CS4231_LINE_RIGHT_OUTPUT]); |
620 | } | 620 | } |
621 | chip->calibrate_mute = mute; | 621 | chip->calibrate_mute = mute; |
622 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 622 | spin_unlock_irqrestore(&chip->reg_lock, flags); |