Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
[linux-2.6-block.git] / sound / usb / line6 / midi.h
CommitLineData
705ececd 1/*
c078a4aa 2 * Line 6 Linux USB driver
705ececd 3 *
1027f476 4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
705ececd
MG
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
12#ifndef MIDI_H
13#define MIDI_H
14
705ececd
MG
15#include <sound/rawmidi.h>
16
17#include "midibuf.h"
18
705ececd
MG
19#define MIDI_BUFFER_SIZE 1024
20
a49e4838 21struct snd_line6_midi {
cddbd4f1 22 /* Pointer back to the Line 6 driver data structure */
705ececd
MG
23 struct usb_line6 *line6;
24
cddbd4f1 25 /* MIDI substream for receiving (or NULL if not active) */
705ececd
MG
26 struct snd_rawmidi_substream *substream_receive;
27
cddbd4f1 28 /* MIDI substream for transmitting (or NULL if not active) */
705ececd
MG
29 struct snd_rawmidi_substream *substream_transmit;
30
cddbd4f1 31 /* Number of currently active MIDI send URBs */
705ececd
MG
32 int num_active_send_urbs;
33
cddbd4f1 34 /* Spin lock to protect MIDI buffer handling */
bc518ba4 35 spinlock_t lock;
705ececd 36
cddbd4f1 37 /* Wait queue for MIDI transmission */
705ececd
MG
38 wait_queue_head_t send_wait;
39
cddbd4f1 40 /* Buffer for incoming MIDI stream */
269edc8e 41 struct midi_buffer midibuf_in;
705ececd 42
cddbd4f1 43 /* Buffer for outgoing MIDI stream */
269edc8e 44 struct midi_buffer midibuf_out;
705ececd
MG
45};
46
705ececd 47extern int line6_init_midi(struct usb_line6 *line6);
a49e4838
GKH
48extern void line6_midi_receive(struct usb_line6 *line6, unsigned char *data,
49 int length);
705ececd 50
705ececd 51#endif