1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#include <linux/spinlock.h>
26#include <sound/rawmidi.h>
27#include <sound/mpu401.h>
28
29#define CA_MIDI_MODE_INPUT MPU401_MODE_INPUT
30#define CA_MIDI_MODE_OUTPUT MPU401_MODE_OUTPUT
31
32struct snd_ca_midi {
33
34 struct snd_rawmidi *rmidi;
35 struct snd_rawmidi_substream *substream_input;
36 struct snd_rawmidi_substream *substream_output;
37
38 void *dev_id;
39
40 spinlock_t input_lock;
41 spinlock_t output_lock;
42 spinlock_t open_lock;
43
44 unsigned int channel;
45
46 unsigned int midi_mode;
47 int port;
48 int tx_enable, rx_enable;
49 int ipr_tx, ipr_rx;
50
51 int input_avail, output_ready;
52 int ack, reset, enter_uart;
53
54 void (*interrupt)(struct snd_ca_midi *midi, unsigned int status);
55 void (*interrupt_enable)(struct snd_ca_midi *midi, int intr);
56 void (*interrupt_disable)(struct snd_ca_midi *midi, int intr);
57
58 unsigned char (*read)(struct snd_ca_midi *midi, int idx);
59 void (*write)(struct snd_ca_midi *midi, int data, int idx);
60
61
62 struct snd_card *(*get_dev_id_card)(void *dev_id);
63 int (*get_dev_id_port)(void *dev_id);
64};
65
66int ca_midi_init(void *card, struct snd_ca_midi *midi, int device, char *name);
67