Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
snd_wavefront.h
Go to the documentation of this file.
1 #ifndef __SOUND_SND_WAVEFRONT_H__
2 #define __SOUND_SND_WAVEFRONT_H__
3 
4 #include <sound/mpu401.h>
5 #include <sound/hwdep.h>
6 #include <sound/rawmidi.h>
7 #include <sound/wavefront.h> /* generic OSS/ALSA/user-level wavefront header */
8 
9 /* MIDI interface */
10 
11 struct _snd_wavefront_midi;
12 struct _snd_wavefront_card;
13 struct _snd_wavefront;
14 
18 
20 
22  unsigned long base; /* I/O port address */
23  char isvirtual; /* doing virtual MIDI stuff ? */
24  char istimer; /* timer is used */
25  snd_wavefront_mpu_id output_mpu; /* most-recently-used */
26  snd_wavefront_mpu_id input_mpu; /* most-recently-used */
27  unsigned int mode[2]; /* MPU401_MODE_XXX */
30  struct timer_list timer;
32  spinlock_t virtual; /* protects isvirtual */
33 };
34 
35 #define OUTPUT_READY 0x40
36 #define INPUT_AVAIL 0x80
37 #define MPU_ACK 0xFE
38 #define UART_MODE_ON 0x3F
39 
42 
47 
49  unsigned long irq; /* "you were one, one of the few ..." */
50  unsigned long base; /* low i/o port address */
51  struct resource *res_base; /* i/o port resource allocation */
52 
53 #define mpu_data_port base
54 #define mpu_command_port base + 1 /* write semantics */
55 #define mpu_status_port base + 1 /* read semantics */
56 #define data_port base + 2
57 #define status_port base + 3 /* read semantics */
58 #define control_port base + 3 /* write semantics */
59 #define block_port base + 4 /* 16 bit, writeonly */
60 #define last_block_port base + 6 /* 16 bit, writeonly */
61 
62  /* FX ports. These are mapped through the ICS2115 to the YS225.
63  The ICS2115 takes care of flipping the relevant pins on the
64  YS225 so that access to each of these ports does the right
65  thing. Note: these are NOT documented by Turtle Beach.
66  */
67 
68 #define fx_status base + 8
69 #define fx_op base + 8
70 #define fx_lcr base + 9
71 #define fx_dsp_addr base + 0xa
72 #define fx_dsp_page base + 0xb
73 #define fx_dsp_lsb base + 0xc
74 #define fx_dsp_msb base + 0xd
75 #define fx_mod_addr base + 0xe
76 #define fx_mod_data base + 0xf
77 
78  volatile int irq_ok; /* set by interrupt handler */
79  volatile int irq_cnt; /* ditto */
80  char debug; /* debugging flags */
81  int freemem; /* installed RAM, in bytes */
82 
83  char fw_version[2]; /* major = [0], minor = [1] */
84  char hw_version[2]; /* major = [0], minor = [1] */
85  char israw; /* needs Motorola microcode */
86  char has_fx; /* has FX processor (Tropez+) */
87  char fx_initialized; /* FX's register pages initialized */
88  char prog_status[WF_MAX_PROGRAM]; /* WF_SLOT_* */
89  char patch_status[WF_MAX_PATCH]; /* WF_SLOT_* */
90  char sample_status[WF_MAX_SAMPLE]; /* WF_ST_* | WF_SLOT_* */
91  int samples_used; /* how many */
92  char interrupts_are_midi; /* h/w MPU interrupts enabled ? */
93  char rom_samples_rdonly; /* can we write on ROM samples */
96  snd_wavefront_midi_t midi; /* ICS2115 MIDI interface */
97  struct snd_card *card;
98 };
99 
102 #ifdef CONFIG_PNP
103  struct pnp_dev *wss;
104  struct pnp_dev *ctrl;
105  struct pnp_dev *mpu;
106  struct pnp_dev *synth;
107 #endif /* CONFIG_PNP */
108 };
109 
112 extern int snd_wavefront_check_irq (snd_wavefront_t *dev, int irq);
117 extern int snd_wavefront_cmd (snd_wavefront_t *, int, unsigned char *,
118  unsigned char *);
119 
120 extern int snd_wavefront_synth_ioctl (struct snd_hwdep *,
121  struct file *,
122  unsigned int cmd,
123  unsigned long arg);
124 extern int snd_wavefront_synth_open (struct snd_hwdep *, struct file *);
125 extern int snd_wavefront_synth_release (struct snd_hwdep *, struct file *);
126 
127 /* FX processor - see also yss225.[ch] */
128 
131 extern int snd_wavefront_fx_ioctl (struct snd_hwdep *,
132  struct file *,
133  unsigned int cmd,
134  unsigned long arg);
135 extern int snd_wavefront_fx_open (struct snd_hwdep *, struct file *);
136 extern int snd_wavefront_fx_release (struct snd_hwdep *, struct file *);
137 
138 /* prefix in all snd_printk() delivered messages */
139 
140 #define LOGNAME "WaveFront: "
141 
142 #endif /* __SOUND_SND_WAVEFRONT_H__ */