/*1* Copyright 10/16/2005 Tilman Kranz <[email protected]>2* Creative Audio MIDI, for the CA0106 Driver3* Version: 0.0.14*5* Changelog:6* See ca_midi.c7*8* This program is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2 of the License, or11* (at your option) any later version.12*13* This program is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with this program; if not, write to the Free Software20* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA21*22*/2324#include <linux/spinlock.h>25#include <sound/rawmidi.h>26#include <sound/mpu401.h>2728#define CA_MIDI_MODE_INPUT MPU401_MODE_INPUT29#define CA_MIDI_MODE_OUTPUT MPU401_MODE_OUTPUT3031struct snd_ca_midi {3233struct snd_rawmidi *rmidi;34struct snd_rawmidi_substream *substream_input;35struct snd_rawmidi_substream *substream_output;3637void *dev_id;3839spinlock_t input_lock;40spinlock_t output_lock;41spinlock_t open_lock;4243unsigned int channel;4445unsigned int midi_mode;46int port;47int tx_enable, rx_enable;48int ipr_tx, ipr_rx;4950int input_avail, output_ready;51int ack, reset, enter_uart;5253void (*interrupt)(struct snd_ca_midi *midi, unsigned int status);54void (*interrupt_enable)(struct snd_ca_midi *midi, int intr);55void (*interrupt_disable)(struct snd_ca_midi *midi, int intr);5657unsigned char (*read)(struct snd_ca_midi *midi, int idx);58void (*write)(struct snd_ca_midi *midi, int data, int idx);5960/* get info from dev_id */61struct snd_card *(*get_dev_id_card)(void *dev_id);62int (*get_dev_id_port)(void *dev_id);63};6465int ca_midi_init(void *card, struct snd_ca_midi *midi, int device, char *name);666768