diff options
Diffstat (limited to 'sound/isa/cs423x/cs4231_lib.c')
-rw-r--r-- | sound/isa/cs423x/cs4231_lib.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c index eab7eb59b5f7..823db8246701 100644 --- a/sound/isa/cs423x/cs4231_lib.c +++ b/sound/isa/cs423x/cs4231_lib.c | |||
@@ -531,7 +531,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip, | |||
531 | unsigned long flags; | 531 | unsigned long flags; |
532 | int full_calib = 1; | 532 | int full_calib = 1; |
533 | 533 | ||
534 | down(&chip->mce_mutex); | 534 | mutex_lock(&chip->mce_mutex); |
535 | snd_cs4231_calibrate_mute(chip, 1); | 535 | snd_cs4231_calibrate_mute(chip, 1); |
536 | if (chip->hardware == CS4231_HW_CS4231A || | 536 | if (chip->hardware == CS4231_HW_CS4231A || |
537 | (chip->hardware & CS4231_HW_CS4232_MASK)) { | 537 | (chip->hardware & CS4231_HW_CS4232_MASK)) { |
@@ -560,7 +560,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip, | |||
560 | snd_cs4231_mce_down(chip); | 560 | snd_cs4231_mce_down(chip); |
561 | } | 561 | } |
562 | snd_cs4231_calibrate_mute(chip, 0); | 562 | snd_cs4231_calibrate_mute(chip, 0); |
563 | up(&chip->mce_mutex); | 563 | mutex_unlock(&chip->mce_mutex); |
564 | } | 564 | } |
565 | 565 | ||
566 | static void snd_cs4231_capture_format(struct snd_cs4231 *chip, | 566 | static void snd_cs4231_capture_format(struct snd_cs4231 *chip, |
@@ -570,7 +570,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip, | |||
570 | unsigned long flags; | 570 | unsigned long flags; |
571 | int full_calib = 1; | 571 | int full_calib = 1; |
572 | 572 | ||
573 | down(&chip->mce_mutex); | 573 | mutex_lock(&chip->mce_mutex); |
574 | snd_cs4231_calibrate_mute(chip, 1); | 574 | snd_cs4231_calibrate_mute(chip, 1); |
575 | if (chip->hardware == CS4231_HW_CS4231A || | 575 | if (chip->hardware == CS4231_HW_CS4231A || |
576 | (chip->hardware & CS4231_HW_CS4232_MASK)) { | 576 | (chip->hardware & CS4231_HW_CS4232_MASK)) { |
@@ -603,7 +603,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip, | |||
603 | snd_cs4231_mce_down(chip); | 603 | snd_cs4231_mce_down(chip); |
604 | } | 604 | } |
605 | snd_cs4231_calibrate_mute(chip, 0); | 605 | snd_cs4231_calibrate_mute(chip, 0); |
606 | up(&chip->mce_mutex); | 606 | mutex_unlock(&chip->mce_mutex); |
607 | } | 607 | } |
608 | 608 | ||
609 | /* | 609 | /* |
@@ -709,15 +709,15 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode) | |||
709 | { | 709 | { |
710 | unsigned long flags; | 710 | unsigned long flags; |
711 | 711 | ||
712 | down(&chip->open_mutex); | 712 | mutex_lock(&chip->open_mutex); |
713 | if ((chip->mode & mode) || | 713 | if ((chip->mode & mode) || |
714 | ((chip->mode & CS4231_MODE_OPEN) && chip->single_dma)) { | 714 | ((chip->mode & CS4231_MODE_OPEN) && chip->single_dma)) { |
715 | up(&chip->open_mutex); | 715 | mutex_unlock(&chip->open_mutex); |
716 | return -EAGAIN; | 716 | return -EAGAIN; |
717 | } | 717 | } |
718 | if (chip->mode & CS4231_MODE_OPEN) { | 718 | if (chip->mode & CS4231_MODE_OPEN) { |
719 | chip->mode |= mode; | 719 | chip->mode |= mode; |
720 | up(&chip->open_mutex); | 720 | mutex_unlock(&chip->open_mutex); |
721 | return 0; | 721 | return 0; |
722 | } | 722 | } |
723 | /* ok. now enable and ack CODEC IRQ */ | 723 | /* ok. now enable and ack CODEC IRQ */ |
@@ -737,7 +737,7 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode) | |||
737 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 737 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
738 | 738 | ||
739 | chip->mode = mode; | 739 | chip->mode = mode; |
740 | up(&chip->open_mutex); | 740 | mutex_unlock(&chip->open_mutex); |
741 | return 0; | 741 | return 0; |
742 | } | 742 | } |
743 | 743 | ||
@@ -745,10 +745,10 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode) | |||
745 | { | 745 | { |
746 | unsigned long flags; | 746 | unsigned long flags; |
747 | 747 | ||
748 | down(&chip->open_mutex); | 748 | mutex_lock(&chip->open_mutex); |
749 | chip->mode &= ~mode; | 749 | chip->mode &= ~mode; |
750 | if (chip->mode & CS4231_MODE_OPEN) { | 750 | if (chip->mode & CS4231_MODE_OPEN) { |
751 | up(&chip->open_mutex); | 751 | mutex_unlock(&chip->open_mutex); |
752 | return; | 752 | return; |
753 | } | 753 | } |
754 | snd_cs4231_calibrate_mute(chip, 1); | 754 | snd_cs4231_calibrate_mute(chip, 1); |
@@ -785,7 +785,7 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode) | |||
785 | snd_cs4231_calibrate_mute(chip, 0); | 785 | snd_cs4231_calibrate_mute(chip, 0); |
786 | 786 | ||
787 | chip->mode = 0; | 787 | chip->mode = 0; |
788 | up(&chip->open_mutex); | 788 | mutex_unlock(&chip->open_mutex); |
789 | } | 789 | } |
790 | 790 | ||
791 | /* | 791 | /* |
@@ -1408,8 +1408,8 @@ static int snd_cs4231_new(struct snd_card *card, | |||
1408 | chip->hwshare = hwshare; | 1408 | chip->hwshare = hwshare; |
1409 | 1409 | ||
1410 | spin_lock_init(&chip->reg_lock); | 1410 | spin_lock_init(&chip->reg_lock); |
1411 | init_MUTEX(&chip->mce_mutex); | 1411 | mutex_init(&chip->mce_mutex); |
1412 | init_MUTEX(&chip->open_mutex); | 1412 | mutex_init(&chip->open_mutex); |
1413 | chip->card = card; | 1413 | chip->card = card; |
1414 | chip->rate_constraint = snd_cs4231_xrate; | 1414 | chip->rate_constraint = snd_cs4231_xrate; |
1415 | chip->set_playback_format = snd_cs4231_playback_format; | 1415 | chip->set_playback_format = snd_cs4231_playback_format; |
@@ -1538,8 +1538,8 @@ int snd_cs4231_pcm(struct snd_cs4231 *chip, int device, struct snd_pcm **rpcm) | |||
1538 | return err; | 1538 | return err; |
1539 | 1539 | ||
1540 | spin_lock_init(&chip->reg_lock); | 1540 | spin_lock_init(&chip->reg_lock); |
1541 | init_MUTEX(&chip->mce_mutex); | 1541 | mutex_init(&chip->mce_mutex); |
1542 | init_MUTEX(&chip->open_mutex); | 1542 | mutex_init(&chip->open_mutex); |
1543 | 1543 | ||
1544 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops); | 1544 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops); |
1545 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops); | 1545 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_cs4231_capture_ops); |