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
/
drivers
/
opl4
/
opl4_seq.c
diff --git
a/sound/drivers/opl4/opl4_seq.c
b/sound/drivers/opl4/opl4_seq.c
index
cc0dee9
..
43d8a2b
100644
(file)
--- a/
sound/drivers/opl4/opl4_seq.c
+++ b/
sound/drivers/opl4/opl4_seq.c
@@
-39,35
+39,33
@@
MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
MODULE_DESCRIPTION("OPL4 wavetable synth driver");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
MODULE_DESCRIPTION("OPL4 wavetable synth driver");
MODULE_LICENSE("Dual BSD/GPL");
-MODULE_CLASSES("{sound}");
int volume_boost = 8;
module_param(volume_boost, int, 0644);
MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds.");
int volume_boost = 8;
module_param(volume_boost, int, 0644);
MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds.");
-MODULE_PARM_SYNTAX(volume_boost, "default:8");
-static int snd_opl4_seq_use_inc(
opl4_t
*opl4)
+static int snd_opl4_seq_use_inc(
struct snd_opl4
*opl4)
{
if (!try_module_get(opl4->card->module))
return -EFAULT;
return 0;
}
{
if (!try_module_get(opl4->card->module))
return -EFAULT;
return 0;
}
-static void snd_opl4_seq_use_dec(
opl4_t
*opl4)
+static void snd_opl4_seq_use_dec(
struct snd_opl4
*opl4)
{
module_put(opl4->card->module);
}
{
module_put(opl4->card->module);
}
-static int snd_opl4_seq_use(void *private_data, s
nd_seq_port_subscribe_t
*info)
+static int snd_opl4_seq_use(void *private_data, s
truct snd_seq_port_subscribe
*info)
{
{
-
opl4_t *opl4 = snd_magic_cast(opl4_t, private_data, return -ENXIO)
;
+
struct snd_opl4 *opl4 = private_data
;
int err;
int err;
-
down
(&opl4->access_mutex);
+
mutex_lock
(&opl4->access_mutex);
if (opl4->used) {
if (opl4->used) {
-
up
(&opl4->access_mutex);
+
mutex_unlock
(&opl4->access_mutex);
return -EBUSY;
}
opl4->used++;
return -EBUSY;
}
opl4->used++;
@@
-75,33
+73,33
@@
static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info)
if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) {
err = snd_opl4_seq_use_inc(opl4);
if (err < 0) {
if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM) {
err = snd_opl4_seq_use_inc(opl4);
if (err < 0) {
-
up
(&opl4->access_mutex);
+
mutex_unlock
(&opl4->access_mutex);
return err;
}
}
return err;
}
}
-
up
(&opl4->access_mutex);
+
mutex_unlock
(&opl4->access_mutex);
snd_opl4_synth_reset(opl4);
return 0;
}
snd_opl4_synth_reset(opl4);
return 0;
}
-static int snd_opl4_seq_unuse(void *private_data, s
nd_seq_port_subscribe_t
*info)
+static int snd_opl4_seq_unuse(void *private_data, s
truct snd_seq_port_subscribe
*info)
{
{
-
opl4_t *opl4 = snd_magic_cast(opl4_t, private_data, return -ENXIO)
;
+
struct snd_opl4 *opl4 = private_data
;
snd_opl4_synth_shutdown(opl4);
snd_opl4_synth_shutdown(opl4);
-
down
(&opl4->access_mutex);
+
mutex_lock
(&opl4->access_mutex);
opl4->used--;
opl4->used--;
-
up
(&opl4->access_mutex);
+
mutex_unlock
(&opl4->access_mutex);
if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM)
snd_opl4_seq_use_dec(opl4);
return 0;
}
if (info->sender.client != SNDRV_SEQ_CLIENT_SYSTEM)
snd_opl4_seq_use_dec(opl4);
return 0;
}
-static s
nd_midi_op_t
opl4_ops = {
+static s
truct snd_midi_op
opl4_ops = {
.note_on = snd_opl4_note_on,
.note_off = snd_opl4_note_off,
.note_terminate = snd_opl4_terminate_note,
.note_on = snd_opl4_note_on,
.note_off = snd_opl4_note_off,
.note_terminate = snd_opl4_terminate_note,
@@
-109,10
+107,10
@@
static snd_midi_op_t opl4_ops = {
.sysex = snd_opl4_sysex,
};
.sysex = snd_opl4_sysex,
};
-static int snd_opl4_seq_event_input(s
nd_seq_event_
t *ev, int direct,
+static int snd_opl4_seq_event_input(s
truct snd_seq_even
t *ev, int direct,
void *private_data, int atomic, int hop)
{
void *private_data, int atomic, int hop)
{
-
opl4_t *opl4 = snd_magic_cast(opl4_t, private_data, return -ENXIO)
;
+
struct snd_opl4 *opl4 = private_data
;
snd_midi_process_event(&opl4_ops, ev, opl4->chset);
return 0;
snd_midi_process_event(&opl4_ops, ev, opl4->chset);
return 0;
@@
-120,20
+118,18
@@
static int snd_opl4_seq_event_input(snd_seq_event_t *ev, int direct,
static void snd_opl4_seq_free_port(void *private_data)
{
static void snd_opl4_seq_free_port(void *private_data)
{
-
opl4_t *opl4 = snd_magic_cast(opl4_t, private_data, return)
;
+
struct snd_opl4 *opl4 = private_data
;
snd_midi_channel_free_set(opl4->chset);
}
snd_midi_channel_free_set(opl4->chset);
}
-static int snd_opl4_seq_new_device(s
nd_seq_device_t
*dev)
+static int snd_opl4_seq_new_device(s
truct snd_seq_device
*dev)
{
{
-
opl4_t
*opl4;
+
struct snd_opl4
*opl4;
int client;
int client;
- snd_seq_client_callback_t callbacks;
- snd_seq_client_info_t cinfo;
- snd_seq_port_callback_t pcallbacks;
+ struct snd_seq_port_callback pcallbacks;
- opl4 = *(
opl4_t
**)SNDRV_SEQ_DEVICE_ARGPTR(dev);
+ opl4 = *(
struct snd_opl4
**)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (!opl4)
return -EINVAL;
if (!opl4)
return -EINVAL;
@@
-146,10
+142,8
@@
static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
opl4->chset->private_data = opl4;
/* allocate new client */
opl4->chset->private_data = opl4;
/* allocate new client */
- memset(&callbacks, 0, sizeof(callbacks));
- callbacks.private_data = opl4;
- callbacks.allow_output = callbacks.allow_input = 1;
- client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num, &callbacks);
+ client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num,
+ "OPL4 Wavetable");
if (client < 0) {
snd_midi_channel_free_set(opl4->chset);
return client;
if (client < 0) {
snd_midi_channel_free_set(opl4->chset);
return client;
@@
-157,13
+151,6
@@
static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
opl4->seq_client = client;
opl4->chset->client = client;
opl4->seq_client = client;
opl4->chset->client = client;
- /* change name of client */
- memset(&cinfo, 0, sizeof(cinfo));
- cinfo.client = client;
- cinfo.type = KERNEL_CLIENT;
- strcpy(cinfo.name, "OPL4 Wavetable");
- snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
-
/* create new port */
memset(&pcallbacks, 0, sizeof(pcallbacks));
pcallbacks.owner = THIS_MODULE;
/* create new port */
memset(&pcallbacks, 0, sizeof(pcallbacks));
pcallbacks.owner = THIS_MODULE;
@@
-177,7
+164,9
@@
static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
SNDRV_SEQ_PORT_CAP_WRITE |
SNDRV_SEQ_PORT_CAP_SUBS_WRITE,
SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC |
SNDRV_SEQ_PORT_CAP_WRITE |
SNDRV_SEQ_PORT_CAP_SUBS_WRITE,
SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC |
- SNDRV_SEQ_PORT_TYPE_MIDI_GM,
+ SNDRV_SEQ_PORT_TYPE_MIDI_GM |
+ SNDRV_SEQ_PORT_TYPE_HARDWARE |
+ SNDRV_SEQ_PORT_TYPE_SYNTHESIZER,
16, 24,
"OPL4 Wavetable Port");
if (opl4->chset->port < 0) {
16, 24,
"OPL4 Wavetable Port");
if (opl4->chset->port < 0) {
@@
-190,11
+179,11
@@
static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
return 0;
}
return 0;
}
-static int snd_opl4_seq_delete_device(s
nd_seq_device_t
*dev)
+static int snd_opl4_seq_delete_device(s
truct snd_seq_device
*dev)
{
{
-
opl4_t
*opl4;
+
struct snd_opl4
*opl4;
- opl4 = *(
opl4_t
**)SNDRV_SEQ_DEVICE_ARGPTR(dev);
+ opl4 = *(
struct snd_opl4
**)SNDRV_SEQ_DEVICE_ARGPTR(dev);
if (!opl4)
return -EINVAL;
if (!opl4)
return -EINVAL;
@@
-207,13
+196,13
@@
static int snd_opl4_seq_delete_device(snd_seq_device_t *dev)
static int __init alsa_opl4_synth_init(void)
{
static int __init alsa_opl4_synth_init(void)
{
- static s
nd_seq_dev_ops_t
ops = {
+ static s
truct snd_seq_dev_ops
ops = {
snd_opl4_seq_new_device,
snd_opl4_seq_delete_device
};
return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL4, &ops,
snd_opl4_seq_new_device,
snd_opl4_seq_delete_device
};
return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL4, &ops,
- sizeof(
opl4_t
*));
+ sizeof(
struct snd_opl4
*));
}
static void __exit alsa_opl4_synth_exit(void)
}
static void __exit alsa_opl4_synth_exit(void)