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
/
isa
/
sb
/
sb8_midi.c
diff --git
a/sound/isa/sb/sb8_midi.c
b/sound/isa/sb/sb8_midi.c
index
17e0f4d
..
0b67edd
100644
(file)
--- a/
sound/isa/sb/sb8_midi.c
+++ b/
sound/isa/sb/sb8_midi.c
@@
-32,48
+32,42
@@
#include <sound/core.h>
#include <sound/sb.h>
#include <sound/core.h>
#include <sound/sb.h>
-/*
-
- */
-irqreturn_t snd_sb8dsp_midi_interrupt(s
b_t *
chip)
+irqreturn_t snd_sb8dsp_midi_interrupt(s
truct snd_sb *
chip)
{
{
- s
nd_rawmidi_t
*rmidi;
+ s
truct snd_rawmidi
*rmidi;
int max = 64;
char byte;
int max = 64;
char byte;
- if (chip == NULL || (rmidi = chip->rmidi) == NULL) {
+ if (!chip)
+ return IRQ_NONE;
+
+ rmidi = chip->rmidi;
+ if (!rmidi) {
inb(SBP(chip, DATA_AVAIL)); /* ack interrupt */
return IRQ_NONE;
}
inb(SBP(chip, DATA_AVAIL)); /* ack interrupt */
return IRQ_NONE;
}
+
+ spin_lock(&chip->midi_input_lock);
while (max-- > 0) {
while (max-- > 0) {
- spin_lock(&chip->midi_input_lock);
if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
byte = inb(SBP(chip, READ));
if (chip->open & SB_OPEN_MIDI_INPUT_TRIGGER) {
if (inb(SBP(chip, DATA_AVAIL)) & 0x80) {
byte = inb(SBP(chip, READ));
if (chip->open & SB_OPEN_MIDI_INPUT_TRIGGER) {
- spin_unlock(&chip->midi_input_lock);
snd_rawmidi_receive(chip->midi_substream_input, &byte, 1);
snd_rawmidi_receive(chip->midi_substream_input, &byte, 1);
- } else {
- spin_unlock(&chip->midi_input_lock);
}
}
- } else {
- spin_unlock(&chip->midi_input_lock);
}
}
}
}
+ spin_unlock(&chip->midi_input_lock);
return IRQ_HANDLED;
}
return IRQ_HANDLED;
}
-/*
-
- */
-
-static int snd_sb8dsp_midi_input_open(snd_rawmidi_substream_t * substream)
+static int snd_sb8dsp_midi_input_open(struct snd_rawmidi_substream *substream)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
unsigned int valid_open_flags;
unsigned int valid_open_flags;
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return -ENXIO)
;
+ chip = s
ubstream->rmidi->private_data
;
valid_open_flags = chip->hardware >= SB_HW_20
? SB_OPEN_MIDI_OUTPUT | SB_OPEN_MIDI_OUTPUT_TRIGGER : 0;
spin_lock_irqsave(&chip->open_lock, flags);
valid_open_flags = chip->hardware >= SB_HW_20
? SB_OPEN_MIDI_OUTPUT | SB_OPEN_MIDI_OUTPUT_TRIGGER : 0;
spin_lock_irqsave(&chip->open_lock, flags);
@@
-94,13
+88,13
@@
static int snd_sb8dsp_midi_input_open(snd_rawmidi_substream_t * substream)
return 0;
}
return 0;
}
-static int snd_sb8dsp_midi_output_open(s
nd_rawmidi_substream_t *
substream)
+static int snd_sb8dsp_midi_output_open(s
truct snd_rawmidi_substream *
substream)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
unsigned int valid_open_flags;
unsigned int valid_open_flags;
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return -ENXIO)
;
+ chip = s
ubstream->rmidi->private_data
;
valid_open_flags = chip->hardware >= SB_HW_20
? SB_OPEN_MIDI_INPUT | SB_OPEN_MIDI_INPUT_TRIGGER : 0;
spin_lock_irqsave(&chip->open_lock, flags);
valid_open_flags = chip->hardware >= SB_HW_20
? SB_OPEN_MIDI_INPUT | SB_OPEN_MIDI_INPUT_TRIGGER : 0;
spin_lock_irqsave(&chip->open_lock, flags);
@@
-121,12
+115,12
@@
static int snd_sb8dsp_midi_output_open(snd_rawmidi_substream_t * substream)
return 0;
}
return 0;
}
-static int snd_sb8dsp_midi_input_close(s
nd_rawmidi_substream_t *
substream)
+static int snd_sb8dsp_midi_input_close(s
truct snd_rawmidi_substream *
substream)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return -ENXIO)
;
+ chip = s
ubstream->rmidi->private_data
;
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~(SB_OPEN_MIDI_INPUT | SB_OPEN_MIDI_INPUT_TRIGGER);
chip->midi_substream_input = NULL;
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~(SB_OPEN_MIDI_INPUT | SB_OPEN_MIDI_INPUT_TRIGGER);
chip->midi_substream_input = NULL;
@@
-139,12
+133,12
@@
static int snd_sb8dsp_midi_input_close(snd_rawmidi_substream_t * substream)
return 0;
}
return 0;
}
-static int snd_sb8dsp_midi_output_close(s
nd_rawmidi_substream_t *
substream)
+static int snd_sb8dsp_midi_output_close(s
truct snd_rawmidi_substream *
substream)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return -ENXIO)
;
+ chip = s
ubstream->rmidi->private_data
;
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~(SB_OPEN_MIDI_OUTPUT | SB_OPEN_MIDI_OUTPUT_TRIGGER);
chip->midi_substream_output = NULL;
spin_lock_irqsave(&chip->open_lock, flags);
chip->open &= ~(SB_OPEN_MIDI_OUTPUT | SB_OPEN_MIDI_OUTPUT_TRIGGER);
chip->midi_substream_output = NULL;
@@
-157,12
+151,12
@@
static int snd_sb8dsp_midi_output_close(snd_rawmidi_substream_t * substream)
return 0;
}
return 0;
}
-static void snd_sb8dsp_midi_input_trigger(s
nd_rawmidi_substream_t *
substream, int up)
+static void snd_sb8dsp_midi_input_trigger(s
truct snd_rawmidi_substream *
substream, int up)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return)
;
+ chip = s
ubstream->rmidi->private_data
;
spin_lock_irqsave(&chip->open_lock, flags);
if (up) {
if (!(chip->open & SB_OPEN_MIDI_INPUT_TRIGGER)) {
spin_lock_irqsave(&chip->open_lock, flags);
if (up) {
if (!(chip->open & SB_OPEN_MIDI_INPUT_TRIGGER)) {
@@
-180,15
+174,15
@@
static void snd_sb8dsp_midi_input_trigger(snd_rawmidi_substream_t * substream, i
spin_unlock_irqrestore(&chip->open_lock, flags);
}
spin_unlock_irqrestore(&chip->open_lock, flags);
}
-static void snd_sb8dsp_midi_output_write(s
nd_rawmidi_substream_t *
substream)
+static void snd_sb8dsp_midi_output_write(s
truct snd_rawmidi_substream *
substream)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
char byte;
int max = 32;
/* how big is Tx FIFO? */
char byte;
int max = 32;
/* how big is Tx FIFO? */
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return)
;
+ chip = s
ubstream->rmidi->private_data
;
while (max-- > 0) {
spin_lock_irqsave(&chip->open_lock, flags);
if (snd_rawmidi_transmit_peek(substream, &byte, 1) != 1) {
while (max-- > 0) {
spin_lock_irqsave(&chip->open_lock, flags);
if (snd_rawmidi_transmit_peek(substream, &byte, 1) != 1) {
@@
-218,8
+212,8
@@
static void snd_sb8dsp_midi_output_write(snd_rawmidi_substream_t * substream)
static void snd_sb8dsp_midi_output_timer(unsigned long data)
{
static void snd_sb8dsp_midi_output_timer(unsigned long data)
{
- s
nd_rawmidi_substream_t * substream = (snd_rawmidi_substream_t
*) data;
- s
b_t * chip = snd_magic_cast(sb_t, substream->rmidi->private_data, return)
;
+ s
truct snd_rawmidi_substream *substream = (struct snd_rawmidi_substream
*) data;
+ s
truct snd_sb * chip = substream->rmidi->private_data
;
unsigned long flags;
spin_lock_irqsave(&chip->open_lock, flags);
unsigned long flags;
spin_lock_irqsave(&chip->open_lock, flags);
@@
-229,12
+223,12
@@
static void snd_sb8dsp_midi_output_timer(unsigned long data)
snd_sb8dsp_midi_output_write(substream);
}
snd_sb8dsp_midi_output_write(substream);
}
-static void snd_sb8dsp_midi_output_trigger(s
nd_rawmidi_substream_t *
substream, int up)
+static void snd_sb8dsp_midi_output_trigger(s
truct snd_rawmidi_substream *
substream, int up)
{
unsigned long flags;
{
unsigned long flags;
- s
b_t
*chip;
+ s
truct snd_sb
*chip;
- chip = s
nd_magic_cast(sb_t, substream->rmidi->private_data, return)
;
+ chip = s
ubstream->rmidi->private_data
;
spin_lock_irqsave(&chip->open_lock, flags);
if (up) {
if (!(chip->open & SB_OPEN_MIDI_OUTPUT_TRIGGER)) {
spin_lock_irqsave(&chip->open_lock, flags);
if (up) {
if (!(chip->open & SB_OPEN_MIDI_OUTPUT_TRIGGER)) {
@@
-256,27
+250,23
@@
static void snd_sb8dsp_midi_output_trigger(snd_rawmidi_substream_t * substream,
snd_sb8dsp_midi_output_write(substream);
}
snd_sb8dsp_midi_output_write(substream);
}
-/*
-
- */
-
-static snd_rawmidi_ops_t snd_sb8dsp_midi_output =
+static struct snd_rawmidi_ops snd_sb8dsp_midi_output =
{
.open = snd_sb8dsp_midi_output_open,
.close = snd_sb8dsp_midi_output_close,
.trigger = snd_sb8dsp_midi_output_trigger,
};
{
.open = snd_sb8dsp_midi_output_open,
.close = snd_sb8dsp_midi_output_close,
.trigger = snd_sb8dsp_midi_output_trigger,
};
-static s
nd_rawmidi_ops_t
snd_sb8dsp_midi_input =
+static s
truct snd_rawmidi_ops
snd_sb8dsp_midi_input =
{
.open = snd_sb8dsp_midi_input_open,
.close = snd_sb8dsp_midi_input_close,
.trigger = snd_sb8dsp_midi_input_trigger,
};
{
.open = snd_sb8dsp_midi_input_open,
.close = snd_sb8dsp_midi_input_close,
.trigger = snd_sb8dsp_midi_input_trigger,
};
-int snd_sb8dsp_midi(s
b_t *chip, int device, snd_rawmidi_t
** rrawmidi)
+int snd_sb8dsp_midi(s
truct snd_sb *chip, int device, struct snd_rawmidi
** rrawmidi)
{
{
- s
nd_rawmidi_t
*rmidi;
+ s
truct snd_rawmidi
*rmidi;
int err;
if (rrawmidi)
int err;
if (rrawmidi)