diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
| commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
| tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /sound/isa/cs423x | |
| parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
| parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) | |
Merge branch 'linus'
Diffstat (limited to 'sound/isa/cs423x')
| -rw-r--r-- | sound/isa/cs423x/cs4231.c | 4 | ||||
| -rw-r--r-- | sound/isa/cs423x/cs4231_lib.c | 30 | ||||
| -rw-r--r-- | sound/isa/cs423x/cs4236.c | 4 | ||||
| -rw-r--r-- | sound/isa/cs423x/cs4236_lib.c | 6 |
4 files changed, 23 insertions, 21 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c index ab67b5c2590d..a30dcd962525 100644 --- a/sound/isa/cs423x/cs4231.c +++ b/sound/isa/cs423x/cs4231.c | |||
| @@ -203,8 +203,10 @@ static int __init alsa_card_cs4231_init(void) | |||
| 203 | return err; | 203 | return err; |
| 204 | 204 | ||
| 205 | cards = 0; | 205 | cards = 0; |
| 206 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 206 | for (i = 0; i < SNDRV_CARDS; i++) { |
| 207 | struct platform_device *device; | 207 | struct platform_device *device; |
| 208 | if (! enable[i]) | ||
| 209 | continue; | ||
| 208 | device = platform_device_register_simple(SND_CS4231_DRIVER, | 210 | device = platform_device_register_simple(SND_CS4231_DRIVER, |
| 209 | i, NULL, 0); | 211 | i, NULL, 0); |
| 210 | if (IS_ERR(device)) { | 212 | if (IS_ERR(device)) { |
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); |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 99a42138bea0..4060918e0327 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
| @@ -771,9 +771,9 @@ static int __init alsa_card_cs423x_init(void) | |||
| 771 | if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0) | 771 | if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0) |
| 772 | return err; | 772 | return err; |
| 773 | 773 | ||
| 774 | for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { | 774 | for (i = 0; i < SNDRV_CARDS; i++) { |
| 775 | struct platform_device *device; | 775 | struct platform_device *device; |
| 776 | if (is_isapnp_selected(i)) | 776 | if (! enable[i] || is_isapnp_selected(i)) |
| 777 | continue; | 777 | continue; |
| 778 | device = platform_device_register_simple(CS423X_DRIVER, | 778 | device = platform_device_register_simple(CS423X_DRIVER, |
| 779 | i, NULL, 0); | 779 | i, NULL, 0); |
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c index e36981d64ec5..7a5a6c71f5e4 100644 --- a/sound/isa/cs423x/cs4236_lib.c +++ b/sound/isa/cs423x/cs4236_lib.c | |||
| @@ -644,7 +644,7 @@ static int snd_cs4236_put_master_digital(struct snd_kcontrol *kcontrol, struct s | |||
| 644 | val2 = (chip->eimage[CS4236_REG(CS4236_RIGHT_MASTER)] & ~0x7f) | val2; | 644 | val2 = (chip->eimage[CS4236_REG(CS4236_RIGHT_MASTER)] & ~0x7f) | val2; |
| 645 | change = val1 != chip->eimage[CS4236_REG(CS4236_LEFT_MASTER)] || val2 != chip->eimage[CS4236_REG(CS4236_RIGHT_MASTER)]; | 645 | change = val1 != chip->eimage[CS4236_REG(CS4236_LEFT_MASTER)] || val2 != chip->eimage[CS4236_REG(CS4236_RIGHT_MASTER)]; |
| 646 | snd_cs4236_ext_out(chip, CS4236_LEFT_MASTER, val1); | 646 | snd_cs4236_ext_out(chip, CS4236_LEFT_MASTER, val1); |
| 647 | snd_cs4236_ext_out(chip, CS4236_RIGHT_MASTER, val1); | 647 | snd_cs4236_ext_out(chip, CS4236_RIGHT_MASTER, val2); |
| 648 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 648 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
| 649 | return change; | 649 | return change; |
| 650 | } | 650 | } |
| @@ -841,7 +841,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn | |||
| 841 | 841 | ||
| 842 | enable = ucontrol->value.integer.value[0] & 1; | 842 | enable = ucontrol->value.integer.value[0] & 1; |
| 843 | 843 | ||
| 844 | down(&chip->mce_mutex); | 844 | mutex_lock(&chip->mce_mutex); |
| 845 | snd_cs4231_mce_up(chip); | 845 | snd_cs4231_mce_up(chip); |
| 846 | spin_lock_irqsave(&chip->reg_lock, flags); | 846 | spin_lock_irqsave(&chip->reg_lock, flags); |
| 847 | val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0e) | (0<<2) | (enable << 1); | 847 | val = (chip->image[CS4231_ALT_FEATURE_1] & ~0x0e) | (0<<2) | (enable << 1); |
| @@ -854,7 +854,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn | |||
| 854 | snd_cs4236_ctrl_out(chip, 4, val); | 854 | snd_cs4236_ctrl_out(chip, 4, val); |
| 855 | spin_unlock_irqrestore(&chip->reg_lock, flags); | 855 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
| 856 | snd_cs4231_mce_down(chip); | 856 | snd_cs4231_mce_down(chip); |
| 857 | up(&chip->mce_mutex); | 857 | mutex_unlock(&chip->mce_mutex); |
| 858 | 858 | ||
| 859 | #if 0 | 859 | #if 0 |
| 860 | printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", | 860 | printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n", |
