git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
sound
/
oss
/
hal2.c
diff --git
a/sound/oss/hal2.c
b/sound/oss/hal2.c
index
afe97c4
..
d18286c
100644
(file)
--- a/
sound/oss/hal2.c
+++ b/
sound/oss/hal2.c
@@
-32,6
+32,8
@@
#include <linux/dma-mapping.h>
#include <linux/sound.h>
#include <linux/soundcard.h>
#include <linux/dma-mapping.h>
#include <linux/sound.h>
#include <linux/soundcard.h>
+#include <linux/mutex.h>
+
#include <asm/io.h>
#include <asm/sgi/hpc3.h>
#include <asm/io.h>
#include <asm/sgi/hpc3.h>
@@
-92,7
+94,7
@@
struct hal2_codec {
wait_queue_head_t dma_wait;
spinlock_t lock;
wait_queue_head_t dma_wait;
spinlock_t lock;
- struct
semaphore
sem;
+ struct
mutex
sem;
int usecount; /* recording and playback are
* independent */
int usecount; /* recording and playback are
* independent */
@@
-368,9
+370,9
@@
static void hal2_adc_interrupt(struct hal2_codec *adc)
wake_up(&adc->dma_wait);
}
wake_up(&adc->dma_wait);
}
-static irqreturn_t hal2_interrupt(int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t hal2_interrupt(int irq, void *dev_id)
{
{
- struct hal2_card *hal2 =
(struct hal2_card*)
dev_id;
+ struct hal2_card *hal2 = dev_id;
irqreturn_t ret = IRQ_NONE;
/* decide what caused this interrupt */
irqreturn_t ret = IRQ_NONE;
/* decide what caused this interrupt */
@@
-1178,7
+1180,7
@@
static ssize_t hal2_read(struct file *file, char *buffer,
if (!count)
return 0;
if (!count)
return 0;
- if (
down
_interruptible(&adc->sem))
+ if (
mutex_lock
_interruptible(&adc->sem))
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
err = hal2_get_buffer(hal2, buffer, count);
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
err = hal2_get_buffer(hal2, buffer, count);
@@
-1217,7
+1219,7
@@
static ssize_t hal2_read(struct file *file, char *buffer,
}
} while (count > 0 && err >= 0);
}
}
} while (count > 0 && err >= 0);
}
-
up
(&adc->sem);
+
mutex_unlock
(&adc->sem);
return err;
}
return err;
}
@@
-1232,7
+1234,7
@@
static ssize_t hal2_write(struct file *file, const char *buffer,
if (!count)
return 0;
if (!count)
return 0;
- if (
down
_interruptible(&dac->sem))
+ if (
mutex_lock
_interruptible(&dac->sem))
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
err = hal2_add_buffer(hal2, buf, count);
return -EINTR;
if (file->f_flags & O_NONBLOCK) {
err = hal2_add_buffer(hal2, buf, count);
@@
-1271,7
+1273,7
@@
static ssize_t hal2_write(struct file *file, const char *buffer,
}
} while (count > 0 && err >= 0);
}
}
} while (count > 0 && err >= 0);
}
-
up
(&dac->sem);
+
mutex_unlock
(&dac->sem);
return err;
}
return err;
}
@@
-1356,20
+1358,20
@@
static int hal2_release(struct inode *inode, struct file *file)
if (file->f_mode & FMODE_READ) {
struct hal2_codec *adc = &hal2->adc;
if (file->f_mode & FMODE_READ) {
struct hal2_codec *adc = &hal2->adc;
-
down
(&adc->sem);
+
mutex_lock
(&adc->sem);
hal2_stop_adc(hal2);
hal2_free_adc_dmabuf(adc);
adc->usecount--;
hal2_stop_adc(hal2);
hal2_free_adc_dmabuf(adc);
adc->usecount--;
-
up
(&adc->sem);
+
mutex_unlock
(&adc->sem);
}
if (file->f_mode & FMODE_WRITE) {
struct hal2_codec *dac = &hal2->dac;
}
if (file->f_mode & FMODE_WRITE) {
struct hal2_codec *dac = &hal2->dac;
-
down
(&dac->sem);
+
mutex_lock
(&dac->sem);
hal2_sync_dac(hal2);
hal2_free_dac_dmabuf(dac);
dac->usecount--;
hal2_sync_dac(hal2);
hal2_free_dac_dmabuf(dac);
dac->usecount--;
-
up
(&dac->sem);
+
mutex_unlock
(&dac->sem);
}
return 0;
}
return 0;
@@
-1400,7
+1402,7
@@
static void hal2_init_codec(struct hal2_codec *codec, struct hpc3_regs *hpc3,
codec->pbus.pbusnr = index;
codec->pbus.pbus = &hpc3->pbdma[index];
init_waitqueue_head(&codec->dma_wait);
codec->pbus.pbusnr = index;
codec->pbus.pbus = &hpc3->pbdma[index];
init_waitqueue_head(&codec->dma_wait);
-
init_MUTEX
(&codec->sem);
+
mutex_init
(&codec->sem);
spin_lock_init(&codec->lock);
}
spin_lock_init(&codec->lock);
}
@@
-1433,7
+1435,7
@@
static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3)
int ret = 0;
struct hal2_card *hal2;
int ret = 0;
struct hal2_card *hal2;
- hal2 =
(struct hal2_card *)
kmalloc(sizeof(struct hal2_card), GFP_KERNEL);
+ hal2 = kmalloc(sizeof(struct hal2_card), GFP_KERNEL);
if (!hal2)
return -ENOMEM;
memset(hal2, 0, sizeof(struct hal2_card));
if (!hal2)
return -ENOMEM;
memset(hal2, 0, sizeof(struct hal2_card));
@@
-1477,7
+1479,7
@@
static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3)
hpc3->pbus_dmacfg[hal2->dac.pbus.pbusnr][0] = 0x8208844;
hpc3->pbus_dmacfg[hal2->adc.pbus.pbusnr][0] = 0x8208844;
hpc3->pbus_dmacfg[hal2->dac.pbus.pbusnr][0] = 0x8208844;
hpc3->pbus_dmacfg[hal2->adc.pbus.pbusnr][0] = 0x8208844;
- if (request_irq(SGI_HPCDMA_IRQ, hal2_interrupt,
SA_SHIRQ
,
+ if (request_irq(SGI_HPCDMA_IRQ, hal2_interrupt,
IRQF_SHARED
,
hal2str, hal2)) {
printk(KERN_ERR "HAL2: Can't get irq %d\n", SGI_HPCDMA_IRQ);
ret = -EAGAIN;
hal2str, hal2)) {
printk(KERN_ERR "HAL2: Can't get irq %d\n", SGI_HPCDMA_IRQ);
ret = -EAGAIN;