Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mpu401.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include "sound_config.h"
#include "coproc.h"
#include "mpu401.h"
#include "midi_synth.h"

Go to the source code of this file.

Data Structures

struct  mpu_config
 

Macros

#define USE_SEQ_MACROS
 
#define USE_SIMPLE_MACROS
 
#define MODE_MIDI   1
 
#define MODE_SYNTH   2
 
#define MPU_CAP_INTLG   0x10000000
 
#define MPU_CAP_SYNC   0x00000010
 
#define MPU_CAP_FSK   0x00000020
 
#define MPU_CAP_CLS   0x00000040
 
#define MPU_CAP_SMPTE   0x00000080
 
#define MPU_CAP_2PORT   0x00000001
 
#define MBUF_MAX   10
 
#define BUFTEST(dc)
 
#define DATAPORT(base)   (base)
 
#define COMDPORT(base)   (base+1)
 
#define STATPORT(base)   (base+1)
 
#define input_avail(devc)   (!(mpu401_status(devc)&INPUT_AVAIL))
 
#define output_ready(devc)   (!(mpu401_status(devc)&OUTPUT_READY))
 
#define OUTPUT_READY   0x40
 
#define INPUT_AVAIL   0x80
 
#define MPU_ACK   0xFE
 
#define MPU_RESET   0xFF
 
#define UART_MODE_ON   0x3F
 
#define ST_INIT   0 /* Ready for timing byte or msg */
 
#define ST_TIMED   1 /* Leading timing byte rcvd */
 
#define ST_DATABYTE   2 /* Waiting for (nr_left) data bytes */
 
#define ST_SYSMSG   100 /* System message (sysx etc). */
 
#define ST_SYSEX   101 /* System exclusive msg */
 
#define ST_MTC   102 /* Midi Time Code (MTC) qframe msg */
 
#define ST_SONGSEL   103 /* Song select */
 
#define ST_SONGPOS   104 /* Song position pointer */
 
#define STORE(cmd)
 
#define _seqbuf   obuf
 
#define _seqbufptr   0
 
#define _SEQ_ADVBUF(x)   len=x
 
#define MIDI_SYNTH_NAME   "MPU-401 UART Midi"
 
#define MIDI_SYNTH_CAPS   SYNTH_CAP_INPUT
 

Functions

int attach_mpu401 (struct address_info *hw_config, struct module *owner)
 
int probe_mpu401 (struct address_info *hw_config, struct resource *ports)
 
void unload_mpu401 (struct address_info *hw_config)
 
 EXPORT_SYMBOL (probe_mpu401)
 
 EXPORT_SYMBOL (attach_mpu401)
 
 EXPORT_SYMBOL (unload_mpu401)
 
 module_param (irq, int, 0)
 
 module_param (io, int, 0)
 
 module_init (init_mpu401)
 
 module_exit (cleanup_mpu401)
 
 __setup ("mpu401=", setup_mpu401)
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define _SEQ_ADVBUF (   x)    len=x

Definition at line 173 of file mpu401.c.

#define _seqbuf   obuf

Definition at line 171 of file mpu401.c.

#define _seqbufptr   0

Definition at line 172 of file mpu401.c.

#define BUFTEST (   dc)
Value:
if (dc->m_ptr >= MBUF_MAX || dc->m_ptr < 0) \
{printk( "MPU: Invalid buffer pointer %d/%d, s=%d\n", dc->m_ptr, dc->m_left, dc->m_state);dc->m_ptr--;}

Definition at line 63 of file mpu401.c.

#define COMDPORT (   base)    (base+1)

Definition at line 78 of file mpu401.c.

#define DATAPORT (   base)    (base)

Definition at line 77 of file mpu401.c.

#define input_avail (   devc)    (!(mpu401_status(devc)&INPUT_AVAIL))

Definition at line 89 of file mpu401.c.

#define INPUT_AVAIL   0x80

Definition at line 108 of file mpu401.c.

#define MBUF_MAX   10

Definition at line 62 of file mpu401.c.

#define MIDI_SYNTH_CAPS   SYNTH_CAP_INPUT

Definition at line 879 of file mpu401.c.

#define MIDI_SYNTH_NAME   "MPU-401 UART Midi"

Definition at line 878 of file mpu401.c.

#define MODE_MIDI   1

Definition at line 50 of file mpu401.c.

#define MODE_SYNTH   2

Definition at line 51 of file mpu401.c.

#define MPU_ACK   0xFE

Definition at line 109 of file mpu401.c.

#define MPU_CAP_2PORT   0x00000001

Definition at line 59 of file mpu401.c.

#define MPU_CAP_CLS   0x00000040

Definition at line 57 of file mpu401.c.

#define MPU_CAP_FSK   0x00000020

Definition at line 56 of file mpu401.c.

#define MPU_CAP_INTLG   0x10000000

Definition at line 54 of file mpu401.c.

#define MPU_CAP_SMPTE   0x00000080

Definition at line 58 of file mpu401.c.

#define MPU_CAP_SYNC   0x00000010

Definition at line 55 of file mpu401.c.

#define MPU_RESET   0xFF

Definition at line 110 of file mpu401.c.

#define output_ready (   devc)    (!(mpu401_status(devc)&OUTPUT_READY))

Definition at line 90 of file mpu401.c.

#define OUTPUT_READY   0x40

Definition at line 107 of file mpu401.c.

#define ST_DATABYTE   2 /* Waiting for (nr_left) data bytes */

Definition at line 142 of file mpu401.c.

#define ST_INIT   0 /* Ready for timing byte or msg */

Definition at line 140 of file mpu401.c.

#define ST_MTC   102 /* Midi Time Code (MTC) qframe msg */

Definition at line 146 of file mpu401.c.

#define ST_SONGPOS   104 /* Song position pointer */

Definition at line 148 of file mpu401.c.

#define ST_SONGSEL   103 /* Song select */

Definition at line 147 of file mpu401.c.

#define ST_SYSEX   101 /* System exclusive msg */

Definition at line 145 of file mpu401.c.

#define ST_SYSMSG   100 /* System message (sysx etc). */

Definition at line 144 of file mpu401.c.

#define ST_TIMED   1 /* Leading timing byte rcvd */

Definition at line 141 of file mpu401.c.

#define STATPORT (   base)    (base+1)

Definition at line 79 of file mpu401.c.

#define STORE (   cmd)
Value:
{ \
int len; \
unsigned char obuf[8]; \
cmd; \
seq_input_event(obuf, len); \
}

Definition at line 163 of file mpu401.c.

#define UART_MODE_ON   0x3F

Definition at line 111 of file mpu401.c.

#define USE_SEQ_MACROS

Definition at line 26 of file mpu401.c.

#define USE_SIMPLE_MACROS

Definition at line 27 of file mpu401.c.

Function Documentation

__setup ( )
int attach_mpu401 ( struct address_info hw_config,
struct module owner 
)

Definition at line 947 of file mpu401.c.

EXPORT_SYMBOL ( probe_mpu401  )
EXPORT_SYMBOL ( attach_mpu401  )
EXPORT_SYMBOL ( unload_mpu401  )
module_exit ( cleanup_mpu401  )
module_init ( init_mpu401  )
MODULE_LICENSE ( "GPL"  )
module_param ( irq  ,
int  ,
 
)
module_param ( io  ,
int  ,
 
)
int probe_mpu401 ( struct address_info hw_config,
struct resource ports 
)

Definition at line 1186 of file mpu401.c.

void unload_mpu401 ( struct address_info hw_config)

Definition at line 1214 of file mpu401.c.