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 kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
sound
/
drivers
/
opl4
/
opl4_lib.c
diff --git
a/sound/drivers/opl4/opl4_lib.c
b/sound/drivers/opl4/opl4_lib.c
index
5ede428
..
4bc860a
100644
(file)
--- a/
sound/drivers/opl4/opl4_lib.c
+++ b/
sound/drivers/opl4/opl4_lib.c
@@
-27,14
+27,14
@@
MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
MODULE_DESCRIPTION("OPL4 driver");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("OPL4 driver");
MODULE_LICENSE("GPL");
-static void inline snd_opl4_wait(
opl4_t
*opl4)
+static void inline snd_opl4_wait(
struct snd_opl4
*opl4)
{
int timeout = 10;
while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0)
;
}
{
int timeout = 10;
while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0)
;
}
-void snd_opl4_write(
opl4_t
*opl4, u8 reg, u8 value)
+void snd_opl4_write(
struct snd_opl4
*opl4, u8 reg, u8 value)
{
snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port);
{
snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port);
@@
-43,7
+43,7
@@
void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value)
outb(value, opl4->pcm_port + 1);
}
outb(value, opl4->pcm_port + 1);
}
-u8 snd_opl4_read(
opl4_t
*opl4, u8 reg)
+u8 snd_opl4_read(
struct snd_opl4
*opl4, u8 reg)
{
snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port);
{
snd_opl4_wait(opl4);
outb(reg, opl4->pcm_port);
@@
-52,7
+52,7
@@
u8 snd_opl4_read(opl4_t *opl4, u8 reg)
return inb(opl4->pcm_port + 1);
}
return inb(opl4->pcm_port + 1);
}
-void snd_opl4_read_memory(
opl4_t
*opl4, char *buf, int offset, int size)
+void snd_opl4_read_memory(
struct snd_opl4
*opl4, char *buf, int offset, int size)
{
unsigned long flags;
u8 memcfg;
{
unsigned long flags;
u8 memcfg;
@@
-76,7
+76,7
@@
void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size)
spin_unlock_irqrestore(&opl4->reg_lock, flags);
}
spin_unlock_irqrestore(&opl4->reg_lock, flags);
}
-void snd_opl4_write_memory(
opl4_t
*opl4, const char *buf, int offset, int size)
+void snd_opl4_write_memory(
struct snd_opl4
*opl4, const char *buf, int offset, int size)
{
unsigned long flags;
u8 memcfg;
{
unsigned long flags;
u8 memcfg;
@@
-100,7
+100,7
@@
void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size)
spin_unlock_irqrestore(&opl4->reg_lock, flags);
}
spin_unlock_irqrestore(&opl4->reg_lock, flags);
}
-static void snd_opl4_enable_opl4(
opl4_t
*opl4)
+static void snd_opl4_enable_opl4(
struct snd_opl4
*opl4)
{
outb(OPL3_REG_MODE, opl4->fm_port + 2);
inb(opl4->fm_port);
{
outb(OPL3_REG_MODE, opl4->fm_port + 2);
inb(opl4->fm_port);
@@
-110,7
+110,7
@@
static void snd_opl4_enable_opl4(opl4_t *opl4)
inb(opl4->fm_port);
}
inb(opl4->fm_port);
}
-static int snd_opl4_detect(
opl4_t
*opl4)
+static int snd_opl4_detect(
struct snd_opl4
*opl4)
{
u8 id1, id2;
{
u8 id1, id2;
@@
-144,19
+144,19
@@
static int snd_opl4_detect(opl4_t *opl4)
}
#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
}
#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
-static void snd_opl4_seq_dev_free(s
nd_seq_device_t
*seq_dev)
+static void snd_opl4_seq_dev_free(s
truct snd_seq_device
*seq_dev)
{
{
-
opl4_t
*opl4 = seq_dev->private_data;
+
struct snd_opl4
*opl4 = seq_dev->private_data;
opl4->seq_dev = NULL;
}
opl4->seq_dev = NULL;
}
-static int snd_opl4_create_seq_dev(
opl4_t
*opl4, int seq_device)
+static int snd_opl4_create_seq_dev(
struct snd_opl4
*opl4, int seq_device)
{
opl4->seq_dev_num = seq_device;
if (snd_seq_device_new(opl4->card, seq_device, SNDRV_SEQ_DEV_ID_OPL4,
{
opl4->seq_dev_num = seq_device;
if (snd_seq_device_new(opl4->card, seq_device, SNDRV_SEQ_DEV_ID_OPL4,
- sizeof(
opl4_t
*), &opl4->seq_dev) >= 0) {
+ sizeof(
struct snd_opl4
*), &opl4->seq_dev) >= 0) {
strcpy(opl4->seq_dev->name, "OPL4 Wavetable");
strcpy(opl4->seq_dev->name, "OPL4 Wavetable");
- *(
opl4_t
**)SNDRV_SEQ_DEVICE_ARGPTR(opl4->seq_dev) = opl4;
+ *(
struct snd_opl4
**)SNDRV_SEQ_DEVICE_ARGPTR(opl4->seq_dev) = opl4;
opl4->seq_dev->private_data = opl4;
opl4->seq_dev->private_free = snd_opl4_seq_dev_free;
}
opl4->seq_dev->private_data = opl4;
opl4->seq_dev->private_free = snd_opl4_seq_dev_free;
}
@@
-164,38
+164,32
@@
static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device)
}
#endif
}
#endif
-static void snd_opl4_free(
opl4_t
*opl4)
+static void snd_opl4_free(
struct snd_opl4
*opl4)
{
#ifdef CONFIG_PROC_FS
snd_opl4_free_proc(opl4);
#endif
{
#ifdef CONFIG_PROC_FS
snd_opl4_free_proc(opl4);
#endif
- if (opl4->res_fm_port) {
- release_resource(opl4->res_fm_port);
- kfree_nocheck(opl4->res_fm_port);
- }
- if (opl4->res_pcm_port) {
- release_resource(opl4->res_pcm_port);
- kfree_nocheck(opl4->res_pcm_port);
- }
+ release_and_free_resource(opl4->res_fm_port);
+ release_and_free_resource(opl4->res_pcm_port);
kfree(opl4);
}
kfree(opl4);
}
-static int snd_opl4_dev_free(s
nd_device_t
*device)
+static int snd_opl4_dev_free(s
truct snd_device
*device)
{
{
-
opl4_t
*opl4 = device->device_data;
+
struct snd_opl4
*opl4 = device->device_data;
snd_opl4_free(opl4);
return 0;
}
snd_opl4_free(opl4);
return 0;
}
-int snd_opl4_create(s
nd_card_t
*card,
+int snd_opl4_create(s
truct snd_card
*card,
unsigned long fm_port, unsigned long pcm_port,
int seq_device,
unsigned long fm_port, unsigned long pcm_port,
int seq_device,
-
opl3_t **ropl3, opl4_t
**ropl4)
+
struct snd_opl3 **ropl3, struct snd_opl4
**ropl4)
{
{
-
opl4_t
*opl4;
-
opl3_t
*opl3;
+
struct snd_opl4
*opl4;
+
struct snd_opl3
*opl3;
int err;
int err;
- static s
nd_device_ops_t
ops = {
+ static s
truct snd_device_ops
ops = {
.dev_free = snd_opl4_dev_free
};
.dev_free = snd_opl4_dev_free
};
@@
-204,7
+198,7
@@
int snd_opl4_create(snd_card_t *card,
if (ropl4)
*ropl4 = NULL;
if (ropl4)
*ropl4 = NULL;
- opl4 = k
calloc(1,
sizeof(*opl4), GFP_KERNEL);
+ opl4 = k
zalloc(
sizeof(*opl4), GFP_KERNEL);
if (!opl4)
return -ENOMEM;
if (!opl4)
return -ENOMEM;
@@
-220,7
+214,7
@@
int snd_opl4_create(snd_card_t *card,
opl4->fm_port = fm_port;
opl4->pcm_port = pcm_port;
spin_lock_init(&opl4->reg_lock);
opl4->fm_port = fm_port;
opl4->pcm_port = pcm_port;
spin_lock_init(&opl4->reg_lock);
-
init_MUTEX
(&opl4->access_mutex);
+
mutex_init
(&opl4->access_mutex);
err = snd_opl4_detect(opl4);
if (err < 0) {
err = snd_opl4_detect(opl4);
if (err < 0) {
@@
-229,22
+223,21
@@
int snd_opl4_create(snd_card_t *card,
return err;
}
return err;
}
- err = snd_
opl3_create(card, fm_port, fm_port + 2, opl4->hardware, 1, &opl3
);
+ err = snd_
device_new(card, SNDRV_DEV_CODEC, opl4, &ops
);
if (err < 0) {
snd_opl4_free(opl4);
return err;
}
if (err < 0) {
snd_opl4_free(opl4);
return err;
}
- /* opl3 initialization disabled opl4, so reenable */
- snd_opl4_enable_opl4(opl4);
-
- err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, opl4, &ops);
+ err = snd_opl3_create(card, fm_port, fm_port + 2, opl4->hardware, 1, &opl3);
if (err < 0) {
if (err < 0) {
- snd_device_free(card, opl3);
- snd_opl4_free(opl4);
+ snd_device_free(card, opl4);
return err;
}
return err;
}
+ /* opl3 initialization disabled opl4, so reenable */
+ snd_opl4_enable_opl4(opl4);
+
snd_opl4_create_mixer(opl4);
#ifdef CONFIG_PROC_FS
snd_opl4_create_proc(opl4);
snd_opl4_create_mixer(opl4);
#ifdef CONFIG_PROC_FS
snd_opl4_create_proc(opl4);