aboutsummaryrefslogtreecommitdiff
path: root/sound/isa/cs423x
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 10:59:20 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 10:59:20 -0800
commit1c2e02750b992703a8a18634e08b04353face243 (patch)
tree5dc2d10bad329eeb73b9e219e237662a8383f971 /sound/isa/cs423x
parent8b4b6707ee32f929846d947d18b1b9bf42e988aa (diff)
parenta3c44854a59f7e983c867060aa906bbf5befb1ef (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa
* git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa: (124 commits) [ALSA] version 1.0.11rc4 [PATCH] Intruduce DMA_28BIT_MASK [ALSA] hda-codec - Add support for ASUS P4GPL-X [ALSA] hda-codec - Add support for HP nx9420 laptop [ALSA] Fix memory leaks in error path of control.c [ALSA] AMD Au1x00: AC'97 controller is memory mapped [ALSA] AMD Au1x00: fix DMA init/cleanup [ALSA] hda-codec - Fix generic auto-configurator [ALSA] hda-codec - Fix BIOS auto-configuration [ALSA] Fixes typos in Audiophile-USB.txt [ALSA] ice1712 - typo fixes for dxr_enable module option [ALSA] AMD Au1x00: make driver build after cleanup [ALSA] ice1712 - Fix wrong value types for enum items [ALSA] fix resource leak in usbmixer [ALSA] Fix gus_pcm dereference before NULL [ALSA] Fix seq_clientmgr dereferences before NULL check [ALSA] hda-codec - Fix for Samsung R65 and ASUS A6J [ALSA] hda-codec - Add support for VAIO FE550G and SZ110 [ALSA] usb-audio: add Maya44 mixer control names [ALSA] usb-audio: add Casio PL-40R support ...
Diffstat (limited to 'sound/isa/cs423x')
-rw-r--r--sound/isa/cs423x/cs4231.c4
-rw-r--r--sound/isa/cs423x/cs4231_lib.c30
-rw-r--r--sound/isa/cs423x/cs4236.c4
-rw-r--r--sound/isa/cs423x/cs4236_lib.c6
4 files changed, 23 insertions, 21 deletions
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index ab67b5c2590..a30dcd96252 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)
return err;
cards = 0;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
+ if (! enable[i])
+ continue;
device = platform_device_register_simple(SND_CS4231_DRIVER,
i, NULL, 0);
if (IS_ERR(device)) {
diff --git a/sound/isa/cs423x/cs4231_lib.c b/sound/isa/cs423x/cs4231_lib.c
index eab7eb59b5f..823db824670 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,
unsigned long flags;
int full_calib = 1;
- down(&chip->mce_mutex);
+ mutex_lock(&chip->mce_mutex);
snd_cs4231_calibrate_mute(chip, 1);
if (chip->hardware == CS4231_HW_CS4231A ||
(chip->hardware & CS4231_HW_CS4232_MASK)) {
@@ -560,7 +560,7 @@ static void snd_cs4231_playback_format(struct snd_cs4231 *chip,
snd_cs4231_mce_down(chip);
}
snd_cs4231_calibrate_mute(chip, 0);
- up(&chip->mce_mutex);
+ mutex_unlock(&chip->mce_mutex);
}
static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
@@ -570,7 +570,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
unsigned long flags;
int full_calib = 1;
- down(&chip->mce_mutex);
+ mutex_lock(&chip->mce_mutex);
snd_cs4231_calibrate_mute(chip, 1);
if (chip->hardware == CS4231_HW_CS4231A ||
(chip->hardware & CS4231_HW_CS4232_MASK)) {
@@ -603,7 +603,7 @@ static void snd_cs4231_capture_format(struct snd_cs4231 *chip,
snd_cs4231_mce_down(chip);
}
snd_cs4231_calibrate_mute(chip, 0);
- up(&chip->mce_mutex);
+ mutex_unlock(&chip->mce_mutex);
}
/*
@@ -709,15 +709,15 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
{
unsigned long flags;
- down(&chip->open_mutex);
+ mutex_lock(&chip->open_mutex);
if ((chip->mode & mode) ||
((chip->mode & CS4231_MODE_OPEN) && chip->single_dma)) {
- up(&chip->open_mutex);
+ mutex_unlock(&chip->open_mutex);
return -EAGAIN;
}
if (chip->mode & CS4231_MODE_OPEN) {
chip->mode |= mode;
- up(&chip->open_mutex);
+ mutex_unlock(&chip->open_mutex);
return 0;
}
/* ok. now enable and ack CODEC IRQ */
@@ -737,7 +737,7 @@ static int snd_cs4231_open(struct snd_cs4231 *chip, unsigned int mode)
spin_unlock_irqrestore(&chip->reg_lock, flags);
chip->mode = mode;
- up(&chip->open_mutex);
+ mutex_unlock(&chip->open_mutex);
return 0;
}
@@ -745,10 +745,10 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
{
unsigned long flags;
- down(&chip->open_mutex);
+ mutex_lock(&chip->open_mutex);
chip->mode &= ~mode;
if (chip->mode & CS4231_MODE_OPEN) {
- up(&chip->open_mutex);
+ mutex_unlock(&chip->open_mutex);
return;
}
snd_cs4231_calibrate_mute(chip, 1);
@@ -785,7 +785,7 @@ static void snd_cs4231_close(struct snd_cs4231 *chip, unsigned int mode)
snd_cs4231_calibrate_mute(chip, 0);
chip->mode = 0;
- up(&chip->open_mutex);
+ mutex_unlock(&chip->open_mutex);
}
/*
@@ -1408,8 +1408,8 @@ static int snd_cs4231_new(struct snd_card *card,
chip->hwshare = hwshare;
spin_lock_init(&chip->reg_lock);
- init_MUTEX(&chip->mce_mutex);
- init_MUTEX(&chip->open_mutex);
+ mutex_init(&chip->mce_mutex);
+ mutex_init(&chip->open_mutex);
chip->card = card;
chip->rate_constraint = snd_cs4231_xrate;
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)
return err;
spin_lock_init(&chip->reg_lock);
- init_MUTEX(&chip->mce_mutex);
- init_MUTEX(&chip->open_mutex);
+ mutex_init(&chip->mce_mutex);
+ mutex_init(&chip->open_mutex);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_cs4231_playback_ops);
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 99a42138bea..4060918e032 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)
if ((err = platform_driver_register(&cs423x_nonpnp_driver)) < 0)
return err;
- for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
+ for (i = 0; i < SNDRV_CARDS; i++) {
struct platform_device *device;
- if (is_isapnp_selected(i))
+ if (! enable[i] || is_isapnp_selected(i))
continue;
device = platform_device_register_simple(CS423X_DRIVER,
i, NULL, 0);
diff --git a/sound/isa/cs423x/cs4236_lib.c b/sound/isa/cs423x/cs4236_lib.c
index e36981d64ec..7a5a6c71f5e 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
val2 = (chip->eimage[CS4236_REG(CS4236_RIGHT_MASTER)] & ~0x7f) | val2;
change = val1 != chip->eimage[CS4236_REG(CS4236_LEFT_MASTER)] || val2 != chip->eimage[CS4236_REG(CS4236_RIGHT_MASTER)];
snd_cs4236_ext_out(chip, CS4236_LEFT_MASTER, val1);
- snd_cs4236_ext_out(chip, CS4236_RIGHT_MASTER, val1);
+ snd_cs4236_ext_out(chip, CS4236_RIGHT_MASTER, val2);
spin_unlock_irqrestore(&chip->reg_lock, flags);
return change;
}
@@ -841,7 +841,7 @@ static int snd_cs4236_put_iec958_switch(struct snd_kcontrol *kcontrol, struct sn
enable = ucontrol->value.integer.value[0] & 1;
- down(&chip->mce_mutex);
+ mutex_lock(&chip->mce_mutex);
snd_cs4231_mce_up(chip);
spin_lock_irqsave(&chip->reg_lock, flags);
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
snd_cs4236_ctrl_out(chip, 4, val);
spin_unlock_irqrestore(&chip->reg_lock, flags);
snd_cs4231_mce_down(chip);
- up(&chip->mce_mutex);
+ mutex_unlock(&chip->mce_mutex);
#if 0
printk("set valid: ALT = 0x%x, C3 = 0x%x, C4 = 0x%x, C5 = 0x%x, C6 = 0x%x, C8 = 0x%x\n",