aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers')
-rw-r--r--sound/drivers/Kconfig16
-rw-r--r--sound/drivers/dummy.c364
-rw-r--r--sound/drivers/mpu401/mpu401.c108
-rw-r--r--sound/drivers/mpu401/mpu401_uart.c78
-rw-r--r--sound/drivers/mtpav.c306
-rw-r--r--sound/drivers/opl3/opl3_drums.c45
-rw-r--r--sound/drivers/opl3/opl3_lib.c90
-rw-r--r--sound/drivers/opl3/opl3_midi.c75
-rw-r--r--sound/drivers/opl3/opl3_oss.c68
-rw-r--r--sound/drivers/opl3/opl3_seq.c65
-rw-r--r--sound/drivers/opl3/opl3_synth.c50
-rw-r--r--sound/drivers/opl3/opl3_voice.h24
-rw-r--r--sound/drivers/opl4/opl4_lib.c40
-rw-r--r--sound/drivers/opl4/opl4_local.h68
-rw-r--r--sound/drivers/opl4/opl4_mixer.c16
-rw-r--r--sound/drivers/opl4/opl4_proc.c24
-rw-r--r--sound/drivers/opl4/opl4_seq.c53
-rw-r--r--sound/drivers/opl4/opl4_synth.c76
-rw-r--r--sound/drivers/opl4/yrw801.c262
-rw-r--r--sound/drivers/serial-u16550.c122
-rw-r--r--sound/drivers/virmidi.c92
-rw-r--r--sound/drivers/vx/vx_core.c87
-rw-r--r--sound/drivers/vx/vx_hwdep.c24
-rw-r--r--sound/drivers/vx/vx_mixer.c162
-rw-r--r--sound/drivers/vx/vx_pcm.c200
-rw-r--r--sound/drivers/vx/vx_uer.c22
26 files changed, 1350 insertions, 1187 deletions
diff --git a/sound/drivers/Kconfig b/sound/drivers/Kconfig
index efcb4eb2d1a0..395c4ef52ac9 100644
--- a/sound/drivers/Kconfig
+++ b/sound/drivers/Kconfig
@@ -6,7 +6,6 @@ menu "Generic devices"
6 6
7config SND_MPU401_UART 7config SND_MPU401_UART
8 tristate 8 tristate
9 select SND_TIMER
10 select SND_RAWMIDI 9 select SND_RAWMIDI
11 10
12config SND_OPL3_LIB 11config SND_OPL3_LIB
@@ -24,12 +23,19 @@ config SND_VX_LIB
24 select SND_HWDEP 23 select SND_HWDEP
25 select SND_PCM 24 select SND_PCM
26 25
26config SND_AC97_CODEC
27 tristate
28 select SND_PCM
29 select SND_AC97_BUS
30
31config SND_AC97_BUS
32 tristate
33
27 34
28config SND_DUMMY 35config SND_DUMMY
29 tristate "Dummy (/dev/null) soundcard" 36 tristate "Dummy (/dev/null) soundcard"
30 depends on SND 37 depends on SND
31 select SND_PCM 38 select SND_PCM
32 select SND_GENERIC_DRIVER
33 help 39 help
34 Say Y here to include the dummy driver. This driver does 40 Say Y here to include the dummy driver. This driver does
35 nothing, but emulates various mixer controls and PCM devices. 41 nothing, but emulates various mixer controls and PCM devices.
@@ -45,7 +51,6 @@ config SND_VIRMIDI
45 depends on SND_SEQUENCER 51 depends on SND_SEQUENCER
46 select SND_TIMER 52 select SND_TIMER
47 select SND_RAWMIDI 53 select SND_RAWMIDI
48 select SND_GENERIC_DRIVER
49 help 54 help
50 Say Y here to include the virtual MIDI driver. This driver 55 Say Y here to include the virtual MIDI driver. This driver
51 allows to connect applications using raw MIDI devices to 56 allows to connect applications using raw MIDI devices to
@@ -59,9 +64,7 @@ config SND_VIRMIDI
59config SND_MTPAV 64config SND_MTPAV
60 tristate "MOTU MidiTimePiece AV multiport MIDI" 65 tristate "MOTU MidiTimePiece AV multiport MIDI"
61 depends on SND 66 depends on SND
62 select SND_TIMER
63 select SND_RAWMIDI 67 select SND_RAWMIDI
64 select SND_GENERIC_DRIVER
65 help 68 help
66 To use a MOTU MidiTimePiece AV multiport MIDI adapter 69 To use a MOTU MidiTimePiece AV multiport MIDI adapter
67 connected to the parallel port, say Y here and make sure that 70 connected to the parallel port, say Y here and make sure that
@@ -73,9 +76,7 @@ config SND_MTPAV
73config SND_SERIAL_U16550 76config SND_SERIAL_U16550
74 tristate "UART16550 serial MIDI driver" 77 tristate "UART16550 serial MIDI driver"
75 depends on SND 78 depends on SND
76 select SND_TIMER
77 select SND_RAWMIDI 79 select SND_RAWMIDI
78 select SND_GENERIC_DRIVER
79 help 80 help
80 To include support for MIDI serial port interfaces, say Y here 81 To include support for MIDI serial port interfaces, say Y here
81 and read <file:Documentation/sound/alsa/serial-u16550.txt>. 82 and read <file:Documentation/sound/alsa/serial-u16550.txt>.
@@ -92,7 +93,6 @@ config SND_MPU401
92 tristate "Generic MPU-401 UART driver" 93 tristate "Generic MPU-401 UART driver"
93 depends on SND 94 depends on SND
94 select SND_MPU401_UART 95 select SND_MPU401_UART
95 select SND_GENERIC_DRIVER
96 help 96 help
97 Say Y here to include support for MIDI ports compatible with 97 Say Y here to include support for MIDI ports compatible with
98 the Roland MPU-401 interface in UART mode. 98 the Roland MPU-401 interface in UART mode.
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index 64ef7f62851d..14e1a671b5cf 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -20,6 +20,8 @@
20 20
21#include <sound/driver.h> 21#include <sound/driver.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/err.h>
24#include <linux/platform_device.h>
23#include <linux/jiffies.h> 25#include <linux/jiffies.h>
24#include <linux/slab.h> 26#include <linux/slab.h>
25#include <linux/time.h> 27#include <linux/time.h>
@@ -42,7 +44,7 @@ MODULE_SUPPORTED_DEVICE("{{ALSA,Dummy soundcard}}");
42 44
43#if 0 /* emu10k1 emulation */ 45#if 0 /* emu10k1 emulation */
44#define MAX_BUFFER_SIZE (128 * 1024) 46#define MAX_BUFFER_SIZE (128 * 1024)
45static int emu10k1_playback_constraints(snd_pcm_runtime_t *runtime) 47static int emu10k1_playback_constraints(struct snd_pcm_runtime *runtime)
46{ 48{
47 int err; 49 int err;
48 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0) 50 if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
@@ -90,11 +92,27 @@ static int emu10k1_playback_constraints(snd_pcm_runtime_t *runtime)
90#define USE_RATE_MAX 48000 92#define USE_RATE_MAX 48000
91#endif 93#endif
92 94
95#if 0 /* CA0106 */
96#define USE_FORMATS SNDRV_PCM_FMTBIT_S16_LE
97#define USE_CHANNELS_MIN 2
98#define USE_CHANNELS_MAX 2
99#define USE_RATE (SNDRV_PCM_RATE_48000|SNDRV_PCM_RATE_96000|SNDRV_PCM_RATE_192000)
100#define USE_RATE_MIN 48000
101#define USE_RATE_MAX 192000
102#define MAX_BUFFER_SIZE ((65536-64)*8)
103#define MAX_PERIOD_SIZE (65536-64)
104#define USE_PERIODS_MIN 2
105#define USE_PERIODS_MAX 8
106#endif
107
93 108
94/* defaults */ 109/* defaults */
95#ifndef MAX_BUFFER_SIZE 110#ifndef MAX_BUFFER_SIZE
96#define MAX_BUFFER_SIZE (64*1024) 111#define MAX_BUFFER_SIZE (64*1024)
97#endif 112#endif
113#ifndef MAX_PERIOD_SIZE
114#define MAX_PERIOD_SIZE MAX_BUFFER_SIZE
115#endif
98#ifndef USE_FORMATS 116#ifndef USE_FORMATS
99#define USE_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE) 117#define USE_FORMATS (SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE)
100#endif 118#endif
@@ -142,6 +160,8 @@ MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
142//module_param_array(midi_devs, int, NULL, 0444); 160//module_param_array(midi_devs, int, NULL, 0444);
143//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver."); 161//MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver.");
144 162
163static struct platform_device *devices[SNDRV_CARDS];
164
145#define MIXER_ADDR_MASTER 0 165#define MIXER_ADDR_MASTER 0
146#define MIXER_ADDR_LINE 1 166#define MIXER_ADDR_LINE 1
147#define MIXER_ADDR_MIC 2 167#define MIXER_ADDR_MIC 2
@@ -149,15 +169,16 @@ MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-16) for dummy driver.");
149#define MIXER_ADDR_CD 4 169#define MIXER_ADDR_CD 4
150#define MIXER_ADDR_LAST 4 170#define MIXER_ADDR_LAST 4
151 171
152typedef struct snd_card_dummy { 172struct snd_dummy {
153 snd_card_t *card; 173 struct snd_card *card;
174 struct snd_pcm *pcm;
154 spinlock_t mixer_lock; 175 spinlock_t mixer_lock;
155 int mixer_volume[MIXER_ADDR_LAST+1][2]; 176 int mixer_volume[MIXER_ADDR_LAST+1][2];
156 int capture_source[MIXER_ADDR_LAST+1][2]; 177 int capture_source[MIXER_ADDR_LAST+1][2];
157} snd_card_dummy_t; 178};
158 179
159typedef struct snd_card_dummy_pcm { 180struct snd_dummy_pcm {
160 snd_card_dummy_t *dummy; 181 struct snd_dummy *dummy;
161 spinlock_t lock; 182 spinlock_t lock;
162 struct timer_list timer; 183 struct timer_list timer;
163 unsigned int pcm_size; 184 unsigned int pcm_size;
@@ -166,59 +187,49 @@ typedef struct snd_card_dummy_pcm {
166 unsigned int pcm_jiffie; /* bytes per one jiffie */ 187 unsigned int pcm_jiffie; /* bytes per one jiffie */
167 unsigned int pcm_irq_pos; /* IRQ position */ 188 unsigned int pcm_irq_pos; /* IRQ position */
168 unsigned int pcm_buf_pos; /* position in buffer */ 189 unsigned int pcm_buf_pos; /* position in buffer */
169 snd_pcm_substream_t *substream; 190 struct snd_pcm_substream *substream;
170} snd_card_dummy_pcm_t; 191};
171
172static snd_card_t *snd_dummy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR;
173 192
174 193
175static void snd_card_dummy_pcm_timer_start(snd_pcm_substream_t * substream) 194static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm)
176{ 195{
177 snd_pcm_runtime_t *runtime = substream->runtime;
178 snd_card_dummy_pcm_t *dpcm = runtime->private_data;
179
180 dpcm->timer.expires = 1 + jiffies; 196 dpcm->timer.expires = 1 + jiffies;
181 add_timer(&dpcm->timer); 197 add_timer(&dpcm->timer);
182} 198}
183 199
184static void snd_card_dummy_pcm_timer_stop(snd_pcm_substream_t * substream) 200static inline void snd_card_dummy_pcm_timer_stop(struct snd_dummy_pcm *dpcm)
185{ 201{
186 snd_pcm_runtime_t *runtime = substream->runtime;
187 snd_card_dummy_pcm_t *dpcm = runtime->private_data;
188
189 del_timer(&dpcm->timer); 202 del_timer(&dpcm->timer);
190} 203}
191 204
192static int snd_card_dummy_playback_trigger(snd_pcm_substream_t * substream, 205static int snd_card_dummy_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
193 int cmd)
194{
195 if (cmd == SNDRV_PCM_TRIGGER_START) {
196 snd_card_dummy_pcm_timer_start(substream);
197 } else if (cmd == SNDRV_PCM_TRIGGER_STOP) {
198 snd_card_dummy_pcm_timer_stop(substream);
199 } else {
200 return -EINVAL;
201 }
202 return 0;
203}
204
205static int snd_card_dummy_capture_trigger(snd_pcm_substream_t * substream,
206 int cmd)
207{ 206{
208 if (cmd == SNDRV_PCM_TRIGGER_START) { 207 struct snd_pcm_runtime *runtime = substream->runtime;
209 snd_card_dummy_pcm_timer_start(substream); 208 struct snd_dummy_pcm *dpcm = runtime->private_data;
210 } else if (cmd == SNDRV_PCM_TRIGGER_STOP) { 209 int err = 0;
211 snd_card_dummy_pcm_timer_stop(substream); 210
212 } else { 211 spin_lock(&dpcm->lock);
213 return -EINVAL; 212 switch (cmd) {
213 case SNDRV_PCM_TRIGGER_START:
214 case SNDRV_PCM_TRIGGER_RESUME:
215 snd_card_dummy_pcm_timer_start(dpcm);
216 break;
217 case SNDRV_PCM_TRIGGER_STOP:
218 case SNDRV_PCM_TRIGGER_SUSPEND:
219 snd_card_dummy_pcm_timer_stop(dpcm);
220 break;
221 default:
222 err = -EINVAL;
223 break;
214 } 224 }
225 spin_unlock(&dpcm->lock);
215 return 0; 226 return 0;
216} 227}
217 228
218static int snd_card_dummy_pcm_prepare(snd_pcm_substream_t * substream) 229static int snd_card_dummy_pcm_prepare(struct snd_pcm_substream *substream)
219{ 230{
220 snd_pcm_runtime_t *runtime = substream->runtime; 231 struct snd_pcm_runtime *runtime = substream->runtime;
221 snd_card_dummy_pcm_t *dpcm = runtime->private_data; 232 struct snd_dummy_pcm *dpcm = runtime->private_data;
222 unsigned int bps; 233 unsigned int bps;
223 234
224 bps = runtime->rate * runtime->channels; 235 bps = runtime->rate * runtime->channels;
@@ -235,53 +246,37 @@ static int snd_card_dummy_pcm_prepare(snd_pcm_substream_t * substream)
235 return 0; 246 return 0;
236} 247}
237 248
238static int snd_card_dummy_playback_prepare(snd_pcm_substream_t * substream)
239{
240 return snd_card_dummy_pcm_prepare(substream);
241}
242
243static int snd_card_dummy_capture_prepare(snd_pcm_substream_t * substream)
244{
245 return snd_card_dummy_pcm_prepare(substream);
246}
247
248static void snd_card_dummy_pcm_timer_function(unsigned long data) 249static void snd_card_dummy_pcm_timer_function(unsigned long data)
249{ 250{
250 snd_card_dummy_pcm_t *dpcm = (snd_card_dummy_pcm_t *)data; 251 struct snd_dummy_pcm *dpcm = (struct snd_dummy_pcm *)data;
252 unsigned long flags;
251 253
254 spin_lock_irqsave(&dpcm->lock, flags);
252 dpcm->timer.expires = 1 + jiffies; 255 dpcm->timer.expires = 1 + jiffies;
253 add_timer(&dpcm->timer); 256 add_timer(&dpcm->timer);
254 spin_lock_irq(&dpcm->lock);
255 dpcm->pcm_irq_pos += dpcm->pcm_jiffie; 257 dpcm->pcm_irq_pos += dpcm->pcm_jiffie;
256 dpcm->pcm_buf_pos += dpcm->pcm_jiffie; 258 dpcm->pcm_buf_pos += dpcm->pcm_jiffie;
257 dpcm->pcm_buf_pos %= dpcm->pcm_size; 259 dpcm->pcm_buf_pos %= dpcm->pcm_size;
258 if (dpcm->pcm_irq_pos >= dpcm->pcm_count) { 260 if (dpcm->pcm_irq_pos >= dpcm->pcm_count) {
259 dpcm->pcm_irq_pos %= dpcm->pcm_count; 261 dpcm->pcm_irq_pos %= dpcm->pcm_count;
262 spin_unlock_irqrestore(&dpcm->lock, flags);
260 snd_pcm_period_elapsed(dpcm->substream); 263 snd_pcm_period_elapsed(dpcm->substream);
261 } 264 } else
262 spin_unlock_irq(&dpcm->lock); 265 spin_unlock_irqrestore(&dpcm->lock, flags);
263} 266}
264 267
265static snd_pcm_uframes_t snd_card_dummy_playback_pointer(snd_pcm_substream_t * substream) 268static snd_pcm_uframes_t snd_card_dummy_pcm_pointer(struct snd_pcm_substream *substream)
266{ 269{
267 snd_pcm_runtime_t *runtime = substream->runtime; 270 struct snd_pcm_runtime *runtime = substream->runtime;
268 snd_card_dummy_pcm_t *dpcm = runtime->private_data; 271 struct snd_dummy_pcm *dpcm = runtime->private_data;
269 272
270 return bytes_to_frames(runtime, dpcm->pcm_buf_pos); 273 return bytes_to_frames(runtime, dpcm->pcm_buf_pos);
271} 274}
272 275
273static snd_pcm_uframes_t snd_card_dummy_capture_pointer(snd_pcm_substream_t * substream) 276static struct snd_pcm_hardware snd_card_dummy_playback =
274{
275 snd_pcm_runtime_t *runtime = substream->runtime;
276 snd_card_dummy_pcm_t *dpcm = runtime->private_data;
277
278 return bytes_to_frames(runtime, dpcm->pcm_buf_pos);
279}
280
281static snd_pcm_hardware_t snd_card_dummy_playback =
282{ 277{
283 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 278 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
284 SNDRV_PCM_INFO_MMAP_VALID), 279 SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
285 .formats = USE_FORMATS, 280 .formats = USE_FORMATS,
286 .rates = USE_RATE, 281 .rates = USE_RATE,
287 .rate_min = USE_RATE_MIN, 282 .rate_min = USE_RATE_MIN,
@@ -296,10 +291,10 @@ static snd_pcm_hardware_t snd_card_dummy_playback =
296 .fifo_size = 0, 291 .fifo_size = 0,
297}; 292};
298 293
299static snd_pcm_hardware_t snd_card_dummy_capture = 294static struct snd_pcm_hardware snd_card_dummy_capture =
300{ 295{
301 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 296 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
302 SNDRV_PCM_INFO_MMAP_VALID), 297 SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID),
303 .formats = USE_FORMATS, 298 .formats = USE_FORMATS,
304 .rates = USE_RATE, 299 .rates = USE_RATE,
305 .rate_min = USE_RATE_MIN, 300 .rate_min = USE_RATE_MIN,
@@ -308,43 +303,51 @@ static snd_pcm_hardware_t snd_card_dummy_capture =
308 .channels_max = USE_CHANNELS_MAX, 303 .channels_max = USE_CHANNELS_MAX,
309 .buffer_bytes_max = MAX_BUFFER_SIZE, 304 .buffer_bytes_max = MAX_BUFFER_SIZE,
310 .period_bytes_min = 64, 305 .period_bytes_min = 64,
311 .period_bytes_max = MAX_BUFFER_SIZE, 306 .period_bytes_max = MAX_PERIOD_SIZE,
312 .periods_min = USE_PERIODS_MIN, 307 .periods_min = USE_PERIODS_MIN,
313 .periods_max = USE_PERIODS_MAX, 308 .periods_max = USE_PERIODS_MAX,
314 .fifo_size = 0, 309 .fifo_size = 0,
315}; 310};
316 311
317static void snd_card_dummy_runtime_free(snd_pcm_runtime_t *runtime) 312static void snd_card_dummy_runtime_free(struct snd_pcm_runtime *runtime)
318{ 313{
319 snd_card_dummy_pcm_t *dpcm = runtime->private_data; 314 kfree(runtime->private_data);
320 kfree(dpcm);
321} 315}
322 316
323static int snd_card_dummy_hw_params(snd_pcm_substream_t * substream, 317static int snd_card_dummy_hw_params(struct snd_pcm_substream *substream,
324 snd_pcm_hw_params_t * hw_params) 318 struct snd_pcm_hw_params *hw_params)
325{ 319{
326 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 320 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
327} 321}
328 322
329static int snd_card_dummy_hw_free(snd_pcm_substream_t * substream) 323static int snd_card_dummy_hw_free(struct snd_pcm_substream *substream)
330{ 324{
331 return snd_pcm_lib_free_pages(substream); 325 return snd_pcm_lib_free_pages(substream);
332} 326}
333 327
334static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream) 328static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream)
335{ 329{
336 snd_pcm_runtime_t *runtime = substream->runtime; 330 struct snd_dummy_pcm *dpcm;
337 snd_card_dummy_pcm_t *dpcm;
338 int err;
339 331
340 dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); 332 dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL);
341 if (dpcm == NULL) 333 if (! dpcm)
342 return -ENOMEM; 334 return dpcm;
343 init_timer(&dpcm->timer); 335 init_timer(&dpcm->timer);
344 dpcm->timer.data = (unsigned long) dpcm; 336 dpcm->timer.data = (unsigned long) dpcm;
345 dpcm->timer.function = snd_card_dummy_pcm_timer_function; 337 dpcm->timer.function = snd_card_dummy_pcm_timer_function;
346 spin_lock_init(&dpcm->lock); 338 spin_lock_init(&dpcm->lock);
347 dpcm->substream = substream; 339 dpcm->substream = substream;
340 return dpcm;
341}
342
343static int snd_card_dummy_playback_open(struct snd_pcm_substream *substream)
344{
345 struct snd_pcm_runtime *runtime = substream->runtime;
346 struct snd_dummy_pcm *dpcm;
347 int err;
348
349 if ((dpcm = new_pcm_stream(substream)) == NULL)
350 return -ENOMEM;
348 runtime->private_data = dpcm; 351 runtime->private_data = dpcm;
349 runtime->private_free = snd_card_dummy_runtime_free; 352 runtime->private_free = snd_card_dummy_runtime_free;
350 runtime->hw = snd_card_dummy_playback; 353 runtime->hw = snd_card_dummy_playback;
@@ -362,20 +365,14 @@ static int snd_card_dummy_playback_open(snd_pcm_substream_t * substream)
362 return 0; 365 return 0;
363} 366}
364 367
365static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream) 368static int snd_card_dummy_capture_open(struct snd_pcm_substream *substream)
366{ 369{
367 snd_pcm_runtime_t *runtime = substream->runtime; 370 struct snd_pcm_runtime *runtime = substream->runtime;
368 snd_card_dummy_pcm_t *dpcm; 371 struct snd_dummy_pcm *dpcm;
369 int err; 372 int err;
370 373
371 dpcm = kzalloc(sizeof(*dpcm), GFP_KERNEL); 374 if ((dpcm = new_pcm_stream(substream)) == NULL)
372 if (dpcm == NULL)
373 return -ENOMEM; 375 return -ENOMEM;
374 init_timer(&dpcm->timer);
375 dpcm->timer.data = (unsigned long) dpcm;
376 dpcm->timer.function = snd_card_dummy_pcm_timer_function;
377 spin_lock_init(&dpcm->lock);
378 dpcm->substream = substream;
379 runtime->private_data = dpcm; 376 runtime->private_data = dpcm;
380 runtime->private_free = snd_card_dummy_runtime_free; 377 runtime->private_free = snd_card_dummy_runtime_free;
381 runtime->hw = snd_card_dummy_capture; 378 runtime->hw = snd_card_dummy_capture;
@@ -393,45 +390,47 @@ static int snd_card_dummy_capture_open(snd_pcm_substream_t * substream)
393 return 0; 390 return 0;
394} 391}
395 392
396static int snd_card_dummy_playback_close(snd_pcm_substream_t * substream) 393static int snd_card_dummy_playback_close(struct snd_pcm_substream *substream)
397{ 394{
398 return 0; 395 return 0;
399} 396}
400 397
401static int snd_card_dummy_capture_close(snd_pcm_substream_t * substream) 398static int snd_card_dummy_capture_close(struct snd_pcm_substream *substream)
402{ 399{
403 return 0; 400 return 0;
404} 401}
405 402
406static snd_pcm_ops_t snd_card_dummy_playback_ops = { 403static struct snd_pcm_ops snd_card_dummy_playback_ops = {
407 .open = snd_card_dummy_playback_open, 404 .open = snd_card_dummy_playback_open,
408 .close = snd_card_dummy_playback_close, 405 .close = snd_card_dummy_playback_close,
409 .ioctl = snd_pcm_lib_ioctl, 406 .ioctl = snd_pcm_lib_ioctl,
410 .hw_params = snd_card_dummy_hw_params, 407 .hw_params = snd_card_dummy_hw_params,
411 .hw_free = snd_card_dummy_hw_free, 408 .hw_free = snd_card_dummy_hw_free,
412 .prepare = snd_card_dummy_playback_prepare, 409 .prepare = snd_card_dummy_pcm_prepare,
413 .trigger = snd_card_dummy_playback_trigger, 410 .trigger = snd_card_dummy_pcm_trigger,
414 .pointer = snd_card_dummy_playback_pointer, 411 .pointer = snd_card_dummy_pcm_pointer,
415}; 412};
416 413
417static snd_pcm_ops_t snd_card_dummy_capture_ops = { 414static struct snd_pcm_ops snd_card_dummy_capture_ops = {
418 .open = snd_card_dummy_capture_open, 415 .open = snd_card_dummy_capture_open,
419 .close = snd_card_dummy_capture_close, 416 .close = snd_card_dummy_capture_close,
420 .ioctl = snd_pcm_lib_ioctl, 417 .ioctl = snd_pcm_lib_ioctl,
421 .hw_params = snd_card_dummy_hw_params, 418 .hw_params = snd_card_dummy_hw_params,
422 .hw_free = snd_card_dummy_hw_free, 419 .hw_free = snd_card_dummy_hw_free,
423 .prepare = snd_card_dummy_capture_prepare, 420 .prepare = snd_card_dummy_pcm_prepare,
424 .trigger = snd_card_dummy_capture_trigger, 421 .trigger = snd_card_dummy_pcm_trigger,
425 .pointer = snd_card_dummy_capture_pointer, 422 .pointer = snd_card_dummy_pcm_pointer,
426}; 423};
427 424
428static int __init snd_card_dummy_pcm(snd_card_dummy_t *dummy, int device, int substreams) 425static int __init snd_card_dummy_pcm(struct snd_dummy *dummy, int device, int substreams)
429{ 426{
430 snd_pcm_t *pcm; 427 struct snd_pcm *pcm;
431 int err; 428 int err;
432 429
433 if ((err = snd_pcm_new(dummy->card, "Dummy PCM", device, substreams, substreams, &pcm)) < 0) 430 if ((err = snd_pcm_new(dummy->card, "Dummy PCM", device,
431 substreams, substreams, &pcm)) < 0)
434 return err; 432 return err;
433 dummy->pcm = pcm;
435 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops); 434 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_card_dummy_playback_ops);
436 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_dummy_capture_ops); 435 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_card_dummy_capture_ops);
437 pcm->private_data = dummy; 436 pcm->private_data = dummy;
@@ -449,7 +448,8 @@ static int __init snd_card_dummy_pcm(snd_card_dummy_t *dummy, int device, int su
449 .get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \ 448 .get = snd_dummy_volume_get, .put = snd_dummy_volume_put, \
450 .private_value = addr } 449 .private_value = addr }
451 450
452static int snd_dummy_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) 451static int snd_dummy_volume_info(struct snd_kcontrol *kcontrol,
452 struct snd_ctl_elem_info *uinfo)
453{ 453{
454 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 454 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
455 uinfo->count = 2; 455 uinfo->count = 2;
@@ -458,23 +458,23 @@ static int snd_dummy_volume_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t
458 return 0; 458 return 0;
459} 459}
460 460
461static int snd_dummy_volume_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 461static int snd_dummy_volume_get(struct snd_kcontrol *kcontrol,
462 struct snd_ctl_elem_value *ucontrol)
462{ 463{
463 snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol); 464 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
464 unsigned long flags;
465 int addr = kcontrol->private_value; 465 int addr = kcontrol->private_value;
466 466
467 spin_lock_irqsave(&dummy->mixer_lock, flags); 467 spin_lock_irq(&dummy->mixer_lock);
468 ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0]; 468 ucontrol->value.integer.value[0] = dummy->mixer_volume[addr][0];
469 ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1]; 469 ucontrol->value.integer.value[1] = dummy->mixer_volume[addr][1];
470 spin_unlock_irqrestore(&dummy->mixer_lock, flags); 470 spin_unlock_irq(&dummy->mixer_lock);
471 return 0; 471 return 0;
472} 472}
473 473
474static int snd_dummy_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 474static int snd_dummy_volume_put(struct snd_kcontrol *kcontrol,
475 struct snd_ctl_elem_value *ucontrol)
475{ 476{
476 snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol); 477 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
477 unsigned long flags;
478 int change, addr = kcontrol->private_value; 478 int change, addr = kcontrol->private_value;
479 int left, right; 479 int left, right;
480 480
@@ -488,12 +488,12 @@ static int snd_dummy_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
488 right = -50; 488 right = -50;
489 if (right > 100) 489 if (right > 100)
490 right = 100; 490 right = 100;
491 spin_lock_irqsave(&dummy->mixer_lock, flags); 491 spin_lock_irq(&dummy->mixer_lock);
492 change = dummy->mixer_volume[addr][0] != left || 492 change = dummy->mixer_volume[addr][0] != left ||
493 dummy->mixer_volume[addr][1] != right; 493 dummy->mixer_volume[addr][1] != right;
494 dummy->mixer_volume[addr][0] = left; 494 dummy->mixer_volume[addr][0] = left;
495 dummy->mixer_volume[addr][1] = right; 495 dummy->mixer_volume[addr][1] = right;
496 spin_unlock_irqrestore(&dummy->mixer_lock, flags); 496 spin_unlock_irq(&dummy->mixer_lock);
497 return change; 497 return change;
498} 498}
499 499
@@ -503,7 +503,8 @@ static int snd_dummy_volume_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t
503 .get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \ 503 .get = snd_dummy_capsrc_get, .put = snd_dummy_capsrc_put, \
504 .private_value = addr } 504 .private_value = addr }
505 505
506static int snd_dummy_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo) 506static int snd_dummy_capsrc_info(struct snd_kcontrol *kcontrol,
507 struct snd_ctl_elem_info *uinfo)
507{ 508{
508 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 509 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
509 uinfo->count = 2; 510 uinfo->count = 2;
@@ -512,38 +513,37 @@ static int snd_dummy_capsrc_info(snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t
512 return 0; 513 return 0;
513} 514}
514 515
515static int snd_dummy_capsrc_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 516static int snd_dummy_capsrc_get(struct snd_kcontrol *kcontrol,
517 struct snd_ctl_elem_value *ucontrol)
516{ 518{
517 snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol); 519 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
518 unsigned long flags;
519 int addr = kcontrol->private_value; 520 int addr = kcontrol->private_value;
520 521
521 spin_lock_irqsave(&dummy->mixer_lock, flags); 522 spin_lock_irq(&dummy->mixer_lock);
522 ucontrol->value.integer.value[0] = dummy->capture_source[addr][0]; 523 ucontrol->value.integer.value[0] = dummy->capture_source[addr][0];
523 ucontrol->value.integer.value[1] = dummy->capture_source[addr][1]; 524 ucontrol->value.integer.value[1] = dummy->capture_source[addr][1];
524 spin_unlock_irqrestore(&dummy->mixer_lock, flags); 525 spin_unlock_irq(&dummy->mixer_lock);
525 return 0; 526 return 0;
526} 527}
527 528
528static int snd_dummy_capsrc_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 529static int snd_dummy_capsrc_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
529{ 530{
530 snd_card_dummy_t *dummy = snd_kcontrol_chip(kcontrol); 531 struct snd_dummy *dummy = snd_kcontrol_chip(kcontrol);
531 unsigned long flags;
532 int change, addr = kcontrol->private_value; 532 int change, addr = kcontrol->private_value;
533 int left, right; 533 int left, right;
534 534
535 left = ucontrol->value.integer.value[0] & 1; 535 left = ucontrol->value.integer.value[0] & 1;
536 right = ucontrol->value.integer.value[1] & 1; 536 right = ucontrol->value.integer.value[1] & 1;
537 spin_lock_irqsave(&dummy->mixer_lock, flags); 537 spin_lock_irq(&dummy->mixer_lock);
538 change = dummy->capture_source[addr][0] != left && 538 change = dummy->capture_source[addr][0] != left &&
539 dummy->capture_source[addr][1] != right; 539 dummy->capture_source[addr][1] != right;
540 dummy->capture_source[addr][0] = left; 540 dummy->capture_source[addr][0] = left;
541 dummy->capture_source[addr][1] = right; 541 dummy->capture_source[addr][1] = right;
542 spin_unlock_irqrestore(&dummy->mixer_lock, flags); 542 spin_unlock_irq(&dummy->mixer_lock);
543 return change; 543 return change;
544} 544}
545 545
546static snd_kcontrol_new_t snd_dummy_controls[] = { 546static struct snd_kcontrol_new snd_dummy_controls[] = {
547DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER), 547DUMMY_VOLUME("Master Volume", 0, MIXER_ADDR_MASTER),
548DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER), 548DUMMY_CAPSRC("Master Capture Switch", 0, MIXER_ADDR_MASTER),
549DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH), 549DUMMY_VOLUME("Synth Volume", 0, MIXER_ADDR_SYNTH),
@@ -556,9 +556,9 @@ DUMMY_VOLUME("CD Volume", 0, MIXER_ADDR_CD),
556DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_MASTER) 556DUMMY_CAPSRC("CD Capture Switch", 0, MIXER_ADDR_MASTER)
557}; 557};
558 558
559static int __init snd_card_dummy_new_mixer(snd_card_dummy_t * dummy) 559static int __init snd_card_dummy_new_mixer(struct snd_dummy *dummy)
560{ 560{
561 snd_card_t *card = dummy->card; 561 struct snd_card *card = dummy->card;
562 unsigned int idx; 562 unsigned int idx;
563 int err; 563 int err;
564 564
@@ -573,19 +573,18 @@ static int __init snd_card_dummy_new_mixer(snd_card_dummy_t * dummy)
573 return 0; 573 return 0;
574} 574}
575 575
576static int __init snd_card_dummy_probe(int dev) 576static int __init snd_dummy_probe(struct platform_device *devptr)
577{ 577{
578 snd_card_t *card; 578 struct snd_card *card;
579 struct snd_card_dummy *dummy; 579 struct snd_dummy *dummy;
580 int idx, err; 580 int idx, err;
581 int dev = devptr->id;
581 582
582 if (!enable[dev])
583 return -ENODEV;
584 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 583 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
585 sizeof(struct snd_card_dummy)); 584 sizeof(struct snd_dummy));
586 if (card == NULL) 585 if (card == NULL)
587 return -ENOMEM; 586 return -ENOMEM;
588 dummy = (struct snd_card_dummy *)card->private_data; 587 dummy = card->private_data;
589 dummy->card = card; 588 dummy->card = card;
590 for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) { 589 for (idx = 0; idx < MAX_PCM_DEVICES && idx < pcm_devs[dev]; idx++) {
591 if (pcm_substreams[dev] < 1) 590 if (pcm_substreams[dev] < 1)
@@ -601,11 +600,10 @@ static int __init snd_card_dummy_probe(int dev)
601 strcpy(card->shortname, "Dummy"); 600 strcpy(card->shortname, "Dummy");
602 sprintf(card->longname, "Dummy %i", dev + 1); 601 sprintf(card->longname, "Dummy %i", dev + 1);
603 602
604 if ((err = snd_card_set_generic_dev(card)) < 0) 603 snd_card_set_dev(card, &devptr->dev);
605 goto __nodev;
606 604
607 if ((err = snd_card_register(card)) == 0) { 605 if ((err = snd_card_register(card)) == 0) {
608 snd_dummy_cards[dev] = card; 606 platform_set_drvdata(devptr, card);
609 return 0; 607 return 0;
610 } 608 }
611 __nodev: 609 __nodev:
@@ -613,34 +611,92 @@ static int __init snd_card_dummy_probe(int dev)
613 return err; 611 return err;
614} 612}
615 613
616static int __init alsa_card_dummy_init(void) 614static int snd_dummy_remove(struct platform_device *devptr)
617{ 615{
618 int dev, cards; 616 snd_card_free(platform_get_drvdata(devptr));
617 platform_set_drvdata(devptr, NULL);
618 return 0;
619}
619 620
620 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { 621#ifdef CONFIG_PM
621 if (snd_card_dummy_probe(dev) < 0) { 622static int snd_dummy_suspend(struct platform_device *pdev, pm_message_t state)
622#ifdef MODULE 623{
623 printk(KERN_ERR "Dummy soundcard #%i not found or device busy\n", dev + 1); 624 struct snd_card *card = platform_get_drvdata(pdev);
625 struct snd_dummy *dummy = card->private_data;
626
627 snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
628 snd_pcm_suspend_all(dummy->pcm);
629 return 0;
630}
631
632static int snd_dummy_resume(struct platform_device *pdev)
633{
634 struct snd_card *card = platform_get_drvdata(pdev);
635
636 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
637 return 0;
638}
639#endif
640
641#define SND_DUMMY_DRIVER "snd_dummy"
642
643static struct platform_driver snd_dummy_driver = {
644 .probe = snd_dummy_probe,
645 .remove = snd_dummy_remove,
646#ifdef CONFIG_PM
647 .suspend = snd_dummy_suspend,
648 .resume = snd_dummy_resume,
624#endif 649#endif
625 break; 650 .driver = {
651 .name = SND_DUMMY_DRIVER
652 },
653};
654
655static void __init_or_module snd_dummy_unregister_all(void)
656{
657 int i;
658
659 for (i = 0; i < ARRAY_SIZE(devices); ++i)
660 platform_device_unregister(devices[i]);
661 platform_driver_unregister(&snd_dummy_driver);
662}
663
664static int __init alsa_card_dummy_init(void)
665{
666 int i, cards, err;
667
668 if ((err = platform_driver_register(&snd_dummy_driver)) < 0)
669 return err;
670
671 cards = 0;
672 for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
673 struct platform_device *device;
674 device = platform_device_register_simple(SND_DUMMY_DRIVER,
675 i, NULL, 0);
676 if (IS_ERR(device)) {
677 err = PTR_ERR(device);
678 goto errout;
626 } 679 }
680 devices[i] = device;
627 cards++; 681 cards++;
628 } 682 }
629 if (!cards) { 683 if (!cards) {
630#ifdef MODULE 684#ifdef MODULE
631 printk(KERN_ERR "Dummy soundcard not found or device busy\n"); 685 printk(KERN_ERR "Dummy soundcard not found or device busy\n");
632#endif 686#endif
633 return -ENODEV; 687 err = -ENODEV;
688 goto errout;
634 } 689 }
635 return 0; 690 return 0;
691
692 errout:
693 snd_dummy_unregister_all();
694 return err;
636} 695}
637 696
638static void __exit alsa_card_dummy_exit(void) 697static void __exit alsa_card_dummy_exit(void)
639{ 698{
640 int idx; 699 snd_dummy_unregister_all();
641
642 for (idx = 0; idx < SNDRV_CARDS; idx++)
643 snd_card_free(snd_dummy_cards[idx]);
644} 700}
645 701
646module_init(alsa_card_dummy_init) 702module_init(alsa_card_dummy_init)
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c
index 54e2ff9b5ca1..915589a402ab 100644
--- a/sound/drivers/mpu401/mpu401.c
+++ b/sound/drivers/mpu401/mpu401.c
@@ -23,6 +23,8 @@
23#include <sound/driver.h> 23#include <sound/driver.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/pnp.h> 25#include <linux/pnp.h>
26#include <linux/err.h>
27#include <linux/platform_device.h>
26#include <linux/moduleparam.h> 28#include <linux/moduleparam.h>
27#include <sound/core.h> 29#include <sound/core.h>
28#include <sound/mpu401.h> 30#include <sound/mpu401.h>
@@ -56,12 +58,12 @@ MODULE_PARM_DESC(port, "Port # for MPU-401 device.");
56module_param_array(irq, int, NULL, 0444); 58module_param_array(irq, int, NULL, 0444);
57MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device."); 59MODULE_PARM_DESC(irq, "IRQ # for MPU-401 device.");
58 60
59static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 61static struct platform_device *platform_devices[SNDRV_CARDS];
60static int pnp_registered = 0; 62static int pnp_registered = 0;
61 63
62static int snd_mpu401_create(int dev, snd_card_t **rcard) 64static int snd_mpu401_create(int dev, struct snd_card **rcard)
63{ 65{
64 snd_card_t *card; 66 struct snd_card *card;
65 int err; 67 int err;
66 68
67 *rcard = NULL; 69 *rcard = NULL;
@@ -85,12 +87,6 @@ static int snd_mpu401_create(int dev, snd_card_t **rcard)
85 goto _err; 87 goto _err;
86 } 88 }
87 89
88 if ((err = snd_card_set_generic_dev(card)) < 0)
89 goto _err;
90
91 if ((err = snd_card_register(card)) < 0)
92 goto _err;
93
94 *rcard = card; 90 *rcard = card;
95 return 0; 91 return 0;
96 92
@@ -99,8 +95,12 @@ static int snd_mpu401_create(int dev, snd_card_t **rcard)
99 return err; 95 return err;
100} 96}
101 97
102static int __devinit snd_mpu401_probe(int dev) 98static int __devinit snd_mpu401_probe(struct platform_device *devptr)
103{ 99{
100 int dev = devptr->id;
101 int err;
102 struct snd_card *card;
103
104 if (port[dev] == SNDRV_AUTO_PORT) { 104 if (port[dev] == SNDRV_AUTO_PORT) {
105 snd_printk(KERN_ERR "specify port\n"); 105 snd_printk(KERN_ERR "specify port\n");
106 return -EINVAL; 106 return -EINVAL;
@@ -109,9 +109,36 @@ static int __devinit snd_mpu401_probe(int dev)
109 snd_printk(KERN_ERR "specify or disable IRQ\n"); 109 snd_printk(KERN_ERR "specify or disable IRQ\n");
110 return -EINVAL; 110 return -EINVAL;
111 } 111 }
112 return snd_mpu401_create(dev, &snd_mpu401_legacy_cards[dev]); 112 err = snd_mpu401_create(dev, &card);
113 if (err < 0)
114 return err;
115 snd_card_set_dev(card, &devptr->dev);
116 if ((err = snd_card_register(card)) < 0) {
117 snd_card_free(card);
118 return err;
119 }
120 platform_set_drvdata(devptr, card);
121 return 0;
113} 122}
114 123
124static int __devexit snd_mpu401_remove(struct platform_device *devptr)
125{
126 snd_card_free(platform_get_drvdata(devptr));
127 platform_set_drvdata(devptr, NULL);
128 return 0;
129}
130
131#define SND_MPU401_DRIVER "snd_mpu401"
132
133static struct platform_driver snd_mpu401_driver = {
134 .probe = snd_mpu401_probe,
135 .remove = __devexit_p(snd_mpu401_remove),
136 .driver = {
137 .name = SND_MPU401_DRIVER
138 },
139};
140
141
115#ifdef CONFIG_PNP 142#ifdef CONFIG_PNP
116 143
117#define IO_EXTENT 2 144#define IO_EXTENT 2
@@ -152,7 +179,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
152 const struct pnp_device_id *id) 179 const struct pnp_device_id *id)
153{ 180{
154 static int dev; 181 static int dev;
155 snd_card_t *card; 182 struct snd_card *card;
156 int err; 183 int err;
157 184
158 for ( ; dev < SNDRV_CARDS; ++dev) { 185 for ( ; dev < SNDRV_CARDS; ++dev) {
@@ -164,6 +191,10 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
164 err = snd_mpu401_create(dev, &card); 191 err = snd_mpu401_create(dev, &card);
165 if (err < 0) 192 if (err < 0)
166 return err; 193 return err;
194 if ((err = snd_card_register(card)) < 0) {
195 snd_card_free(card);
196 return err;
197 }
167 snd_card_set_dev(card, &pnp_dev->dev); 198 snd_card_set_dev(card, &pnp_dev->dev);
168 pnp_set_drvdata(pnp_dev, card); 199 pnp_set_drvdata(pnp_dev, card);
169 ++dev; 200 ++dev;
@@ -174,7 +205,7 @@ static int __devinit snd_mpu401_pnp_probe(struct pnp_dev *pnp_dev,
174 205
175static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev) 206static void __devexit snd_mpu401_pnp_remove(struct pnp_dev *dev)
176{ 207{
177 snd_card_t *card = (snd_card_t *) pnp_get_drvdata(dev); 208 struct snd_card *card = (struct snd_card *) pnp_get_drvdata(dev);
178 209
179 snd_card_disconnect(card); 210 snd_card_disconnect(card);
180 snd_card_free_in_thread(card); 211 snd_card_free_in_thread(card);
@@ -190,20 +221,39 @@ static struct pnp_driver snd_mpu401_pnp_driver = {
190static struct pnp_driver snd_mpu401_pnp_driver; 221static struct pnp_driver snd_mpu401_pnp_driver;
191#endif 222#endif
192 223
224static void __init_or_module snd_mpu401_unregister_all(void)
225{
226 int i;
227
228 if (pnp_registered)
229 pnp_unregister_driver(&snd_mpu401_pnp_driver);
230 for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
231 platform_device_unregister(platform_devices[i]);
232 platform_driver_unregister(&snd_mpu401_driver);
233}
234
193static int __init alsa_card_mpu401_init(void) 235static int __init alsa_card_mpu401_init(void)
194{ 236{
195 int dev, devices = 0; 237 int i, err, devices;
196 int err;
197 238
198 for (dev = 0; dev < SNDRV_CARDS; dev++) { 239 if ((err = platform_driver_register(&snd_mpu401_driver)) < 0)
199 if (!enable[dev]) 240 return err;
200 continue; 241
242 devices = 0;
243 for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
244 struct platform_device *device;
201#ifdef CONFIG_PNP 245#ifdef CONFIG_PNP
202 if (pnp[dev]) 246 if (pnp[i])
203 continue; 247 continue;
204#endif 248#endif
205 if (snd_mpu401_probe(dev) >= 0) 249 device = platform_device_register_simple(SND_MPU401_DRIVER,
206 devices++; 250 i, NULL, 0);
251 if (IS_ERR(device)) {
252 err = PTR_ERR(device);
253 goto errout;
254 }
255 platform_devices[i] = device;
256 devices++;
207 } 257 }
208 if ((err = pnp_register_driver(&snd_mpu401_pnp_driver)) >= 0) { 258 if ((err = pnp_register_driver(&snd_mpu401_pnp_driver)) >= 0) {
209 pnp_registered = 1; 259 pnp_registered = 1;
@@ -214,21 +264,19 @@ static int __init alsa_card_mpu401_init(void)
214#ifdef MODULE 264#ifdef MODULE
215 printk(KERN_ERR "MPU-401 device not found or device busy\n"); 265 printk(KERN_ERR "MPU-401 device not found or device busy\n");
216#endif 266#endif
217 if (pnp_registered) 267 err = -ENODEV;
218 pnp_unregister_driver(&snd_mpu401_pnp_driver); 268 goto errout;
219 return -ENODEV;
220 } 269 }
221 return 0; 270 return 0;
271
272 errout:
273 snd_mpu401_unregister_all();
274 return err;
222} 275}
223 276
224static void __exit alsa_card_mpu401_exit(void) 277static void __exit alsa_card_mpu401_exit(void)
225{ 278{
226 int idx; 279 snd_mpu401_unregister_all();
227
228 if (pnp_registered)
229 pnp_unregister_driver(&snd_mpu401_pnp_driver);
230 for (idx = 0; idx < SNDRV_CARDS; idx++)
231 snd_card_free(snd_mpu401_legacy_cards[idx]);
232} 280}
233 281
234module_init(alsa_card_mpu401_init) 282module_init(alsa_card_mpu401_init)
diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
index bdeb2c00dac5..8687ae3c66b8 100644
--- a/sound/drivers/mpu401/mpu401_uart.c
+++ b/sound/drivers/mpu401/mpu401_uart.c
@@ -43,8 +43,8 @@ MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>");
43MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode"); 43MODULE_DESCRIPTION("Routines for control of MPU-401 in UART mode");
44MODULE_LICENSE("GPL"); 44MODULE_LICENSE("GPL");
45 45
46static void snd_mpu401_uart_input_read(mpu401_t * mpu); 46static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu);
47static void snd_mpu401_uart_output_write(mpu401_t * mpu); 47static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu);
48 48
49/* 49/*
50 50
@@ -58,28 +58,28 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu);
58#define MPU401_ACK 0xfe 58#define MPU401_ACK 0xfe
59 59
60/* Build in lowlevel io */ 60/* Build in lowlevel io */
61static void mpu401_write_port(mpu401_t *mpu, unsigned char data, unsigned long addr) 61static void mpu401_write_port(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr)
62{ 62{
63 outb(data, addr); 63 outb(data, addr);
64} 64}
65 65
66static unsigned char mpu401_read_port(mpu401_t *mpu, unsigned long addr) 66static unsigned char mpu401_read_port(struct snd_mpu401 *mpu, unsigned long addr)
67{ 67{
68 return inb(addr); 68 return inb(addr);
69} 69}
70 70
71static void mpu401_write_mmio(mpu401_t *mpu, unsigned char data, unsigned long addr) 71static void mpu401_write_mmio(struct snd_mpu401 *mpu, unsigned char data, unsigned long addr)
72{ 72{
73 writeb(data, (void __iomem *)addr); 73 writeb(data, (void __iomem *)addr);
74} 74}
75 75
76static unsigned char mpu401_read_mmio(mpu401_t *mpu, unsigned long addr) 76static unsigned char mpu401_read_mmio(struct snd_mpu401 *mpu, unsigned long addr)
77{ 77{
78 return readb((void __iomem *)addr); 78 return readb((void __iomem *)addr);
79} 79}
80/* */ 80/* */
81 81
82static void snd_mpu401_uart_clear_rx(mpu401_t *mpu) 82static void snd_mpu401_uart_clear_rx(struct snd_mpu401 *mpu)
83{ 83{
84 int timeout = 100000; 84 int timeout = 100000;
85 for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--) 85 for (; timeout > 0 && snd_mpu401_input_avail(mpu); timeout--)
@@ -90,7 +90,7 @@ static void snd_mpu401_uart_clear_rx(mpu401_t *mpu)
90#endif 90#endif
91} 91}
92 92
93static void _snd_mpu401_uart_interrupt(mpu401_t *mpu) 93static void _snd_mpu401_uart_interrupt(struct snd_mpu401 *mpu)
94{ 94{
95 spin_lock(&mpu->input_lock); 95 spin_lock(&mpu->input_lock);
96 if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) { 96 if (test_bit(MPU401_MODE_BIT_INPUT, &mpu->mode)) {
@@ -118,7 +118,7 @@ static void _snd_mpu401_uart_interrupt(mpu401_t *mpu)
118 */ 118 */
119irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs) 119irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs)
120{ 120{
121 mpu401_t *mpu = dev_id; 121 struct snd_mpu401 *mpu = dev_id;
122 122
123 if (mpu == NULL) 123 if (mpu == NULL)
124 return IRQ_NONE; 124 return IRQ_NONE;
@@ -132,13 +132,14 @@ irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *reg
132 */ 132 */
133static void snd_mpu401_uart_timer(unsigned long data) 133static void snd_mpu401_uart_timer(unsigned long data)
134{ 134{
135 mpu401_t *mpu = (mpu401_t *)data; 135 struct snd_mpu401 *mpu = (struct snd_mpu401 *)data;
136 unsigned long flags;
136 137
137 spin_lock(&mpu->timer_lock); 138 spin_lock_irqsave(&mpu->timer_lock, flags);
138 /*mpu->mode |= MPU401_MODE_TIMER;*/ 139 /*mpu->mode |= MPU401_MODE_TIMER;*/
139 mpu->timer.expires = 1 + jiffies; 140 mpu->timer.expires = 1 + jiffies;
140 add_timer(&mpu->timer); 141 add_timer(&mpu->timer);
141 spin_unlock(&mpu->timer_lock); 142 spin_unlock_irqrestore(&mpu->timer_lock, flags);
142 if (mpu->rmidi) 143 if (mpu->rmidi)
143 _snd_mpu401_uart_interrupt(mpu); 144 _snd_mpu401_uart_interrupt(mpu);
144} 145}
@@ -146,7 +147,7 @@ static void snd_mpu401_uart_timer(unsigned long data)
146/* 147/*
147 * initialize the timer callback if not programmed yet 148 * initialize the timer callback if not programmed yet
148 */ 149 */
149static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input) 150static void snd_mpu401_uart_add_timer (struct snd_mpu401 *mpu, int input)
150{ 151{
151 unsigned long flags; 152 unsigned long flags;
152 153
@@ -165,7 +166,7 @@ static void snd_mpu401_uart_add_timer (mpu401_t *mpu, int input)
165/* 166/*
166 * remove the timer callback if still active 167 * remove the timer callback if still active
167 */ 168 */
168static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input) 169static void snd_mpu401_uart_remove_timer (struct snd_mpu401 *mpu, int input)
169{ 170{
170 unsigned long flags; 171 unsigned long flags;
171 172
@@ -182,7 +183,7 @@ static void snd_mpu401_uart_remove_timer (mpu401_t *mpu, int input)
182 183
183 */ 184 */
184 185
185static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack) 186static void snd_mpu401_uart_cmd(struct snd_mpu401 * mpu, unsigned char cmd, int ack)
186{ 187{
187 unsigned long flags; 188 unsigned long flags;
188 int timeout, ok; 189 int timeout, ok;
@@ -225,9 +226,9 @@ static void snd_mpu401_uart_cmd(mpu401_t * mpu, unsigned char cmd, int ack)
225/* 226/*
226 * input/output open/close - protected by open_mutex in rawmidi.c 227 * input/output open/close - protected by open_mutex in rawmidi.c
227 */ 228 */
228static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream) 229static int snd_mpu401_uart_input_open(struct snd_rawmidi_substream *substream)
229{ 230{
230 mpu401_t *mpu; 231 struct snd_mpu401 *mpu;
231 int err; 232 int err;
232 233
233 mpu = substream->rmidi->private_data; 234 mpu = substream->rmidi->private_data;
@@ -242,9 +243,9 @@ static int snd_mpu401_uart_input_open(snd_rawmidi_substream_t * substream)
242 return 0; 243 return 0;
243} 244}
244 245
245static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream) 246static int snd_mpu401_uart_output_open(struct snd_rawmidi_substream *substream)
246{ 247{
247 mpu401_t *mpu; 248 struct snd_mpu401 *mpu;
248 int err; 249 int err;
249 250
250 mpu = substream->rmidi->private_data; 251 mpu = substream->rmidi->private_data;
@@ -259,9 +260,9 @@ static int snd_mpu401_uart_output_open(snd_rawmidi_substream_t * substream)
259 return 0; 260 return 0;
260} 261}
261 262
262static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream) 263static int snd_mpu401_uart_input_close(struct snd_rawmidi_substream *substream)
263{ 264{
264 mpu401_t *mpu; 265 struct snd_mpu401 *mpu;
265 266
266 mpu = substream->rmidi->private_data; 267 mpu = substream->rmidi->private_data;
267 clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode); 268 clear_bit(MPU401_MODE_BIT_INPUT, &mpu->mode);
@@ -273,9 +274,9 @@ static int snd_mpu401_uart_input_close(snd_rawmidi_substream_t * substream)
273 return 0; 274 return 0;
274} 275}
275 276
276static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream) 277static int snd_mpu401_uart_output_close(struct snd_rawmidi_substream *substream)
277{ 278{
278 mpu401_t *mpu; 279 struct snd_mpu401 *mpu;
279 280
280 mpu = substream->rmidi->private_data; 281 mpu = substream->rmidi->private_data;
281 clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode); 282 clear_bit(MPU401_MODE_BIT_OUTPUT, &mpu->mode);
@@ -290,10 +291,10 @@ static int snd_mpu401_uart_output_close(snd_rawmidi_substream_t * substream)
290/* 291/*
291 * trigger input callback 292 * trigger input callback
292 */ 293 */
293static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, int up) 294static void snd_mpu401_uart_input_trigger(struct snd_rawmidi_substream *substream, int up)
294{ 295{
295 unsigned long flags; 296 unsigned long flags;
296 mpu401_t *mpu; 297 struct snd_mpu401 *mpu;
297 int max = 64; 298 int max = 64;
298 299
299 mpu = substream->rmidi->private_data; 300 mpu = substream->rmidi->private_data;
@@ -321,7 +322,7 @@ static void snd_mpu401_uart_input_trigger(snd_rawmidi_substream_t * substream, i
321 * transfer input pending data 322 * transfer input pending data
322 * call with input_lock spinlock held 323 * call with input_lock spinlock held
323 */ 324 */
324static void snd_mpu401_uart_input_read(mpu401_t * mpu) 325static void snd_mpu401_uart_input_read(struct snd_mpu401 * mpu)
325{ 326{
326 int max = 128; 327 int max = 128;
327 unsigned char byte; 328 unsigned char byte;
@@ -349,7 +350,7 @@ static void snd_mpu401_uart_input_read(mpu401_t * mpu)
349 * write output pending bytes 350 * write output pending bytes
350 * call with output_lock spinlock held 351 * call with output_lock spinlock held
351 */ 352 */
352static void snd_mpu401_uart_output_write(mpu401_t * mpu) 353static void snd_mpu401_uart_output_write(struct snd_mpu401 * mpu)
353{ 354{
354 unsigned char byte; 355 unsigned char byte;
355 int max = 256, timeout; 356 int max = 256, timeout;
@@ -375,10 +376,10 @@ static void snd_mpu401_uart_output_write(mpu401_t * mpu)
375/* 376/*
376 * output trigger callback 377 * output trigger callback
377 */ 378 */
378static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream, int up) 379static void snd_mpu401_uart_output_trigger(struct snd_rawmidi_substream *substream, int up)
379{ 380{
380 unsigned long flags; 381 unsigned long flags;
381 mpu401_t *mpu; 382 struct snd_mpu401 *mpu;
382 383
383 mpu = substream->rmidi->private_data; 384 mpu = substream->rmidi->private_data;
384 if (up) { 385 if (up) {
@@ -404,23 +405,23 @@ static void snd_mpu401_uart_output_trigger(snd_rawmidi_substream_t * substream,
404 405
405 */ 406 */
406 407
407static snd_rawmidi_ops_t snd_mpu401_uart_output = 408static struct snd_rawmidi_ops snd_mpu401_uart_output =
408{ 409{
409 .open = snd_mpu401_uart_output_open, 410 .open = snd_mpu401_uart_output_open,
410 .close = snd_mpu401_uart_output_close, 411 .close = snd_mpu401_uart_output_close,
411 .trigger = snd_mpu401_uart_output_trigger, 412 .trigger = snd_mpu401_uart_output_trigger,
412}; 413};
413 414
414static snd_rawmidi_ops_t snd_mpu401_uart_input = 415static struct snd_rawmidi_ops snd_mpu401_uart_input =
415{ 416{
416 .open = snd_mpu401_uart_input_open, 417 .open = snd_mpu401_uart_input_open,
417 .close = snd_mpu401_uart_input_close, 418 .close = snd_mpu401_uart_input_close,
418 .trigger = snd_mpu401_uart_input_trigger, 419 .trigger = snd_mpu401_uart_input_trigger,
419}; 420};
420 421
421static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi) 422static void snd_mpu401_uart_free(struct snd_rawmidi *rmidi)
422{ 423{
423 mpu401_t *mpu = rmidi->private_data; 424 struct snd_mpu401 *mpu = rmidi->private_data;
424 if (mpu->irq_flags && mpu->irq >= 0) 425 if (mpu->irq_flags && mpu->irq >= 0)
425 free_irq(mpu->irq, (void *) mpu); 426 free_irq(mpu->irq, (void *) mpu);
426 release_and_free_resource(mpu->res); 427 release_and_free_resource(mpu->res);
@@ -442,18 +443,18 @@ static void snd_mpu401_uart_free(snd_rawmidi_t *rmidi)
442 * 443 *
443 * Note that the rawmidi instance is returned on the rrawmidi argument, 444 * Note that the rawmidi instance is returned on the rrawmidi argument,
444 * not the mpu401 instance itself. To access to the mpu401 instance, 445 * not the mpu401 instance itself. To access to the mpu401 instance,
445 * cast from rawmidi->private_data (with mpu401_t magic-cast). 446 * cast from rawmidi->private_data (with struct snd_mpu401 magic-cast).
446 * 447 *
447 * Returns zero if successful, or a negative error code. 448 * Returns zero if successful, or a negative error code.
448 */ 449 */
449int snd_mpu401_uart_new(snd_card_t * card, int device, 450int snd_mpu401_uart_new(struct snd_card *card, int device,
450 unsigned short hardware, 451 unsigned short hardware,
451 unsigned long port, int integrated, 452 unsigned long port, int integrated,
452 int irq, int irq_flags, 453 int irq, int irq_flags,
453 snd_rawmidi_t ** rrawmidi) 454 struct snd_rawmidi ** rrawmidi)
454{ 455{
455 mpu401_t *mpu; 456 struct snd_mpu401 *mpu;
456 snd_rawmidi_t *rmidi; 457 struct snd_rawmidi *rmidi;
457 int err; 458 int err;
458 459
459 if (rrawmidi) 460 if (rrawmidi)
@@ -462,6 +463,7 @@ int snd_mpu401_uart_new(snd_card_t * card, int device,
462 return err; 463 return err;
463 mpu = kzalloc(sizeof(*mpu), GFP_KERNEL); 464 mpu = kzalloc(sizeof(*mpu), GFP_KERNEL);
464 if (mpu == NULL) { 465 if (mpu == NULL) {
466 snd_printk(KERN_ERR "mpu401_uart: cannot allocate\n");
465 snd_device_free(card, rmidi); 467 snd_device_free(card, rmidi);
466 return -ENOMEM; 468 return -ENOMEM;
467 } 469 }
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index e9d52c668edc..b7a0b42813e1 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -53,6 +53,8 @@
53#include <sound/driver.h> 53#include <sound/driver.h>
54#include <linux/init.h> 54#include <linux/init.h>
55#include <linux/interrupt.h> 55#include <linux/interrupt.h>
56#include <linux/err.h>
57#include <linux/platform_device.h>
56#include <linux/slab.h> 58#include <linux/slab.h>
57#include <linux/ioport.h> 59#include <linux/ioport.h>
58#include <linux/moduleparam.h> 60#include <linux/moduleparam.h>
@@ -93,6 +95,8 @@ MODULE_PARM_DESC(irq, "Parallel IRQ # for MotuMTPAV MIDI.");
93module_param(hwports, int, 0444); 95module_param(hwports, int, 0444);
94MODULE_PARM_DESC(hwports, "Hardware ports # for MotuMTPAV MIDI."); 96MODULE_PARM_DESC(hwports, "Hardware ports # for MotuMTPAV MIDI.");
95 97
98static struct platform_device *device;
99
96/* 100/*
97 * defines 101 * defines
98 */ 102 */
@@ -125,17 +129,17 @@ MODULE_PARM_DESC(hwports, "Hardware ports # for MotuMTPAV MIDI.");
125/* 129/*
126 */ 130 */
127 131
128typedef struct mtpav_port { 132struct mtpav_port {
129 u8 number; 133 u8 number;
130 u8 hwport; 134 u8 hwport;
131 u8 mode; 135 u8 mode;
132 u8 running_status; 136 u8 running_status;
133 snd_rawmidi_substream_t *input; 137 struct snd_rawmidi_substream *input;
134 snd_rawmidi_substream_t *output; 138 struct snd_rawmidi_substream *output;
135} mtpav_port_t; 139};
136 140
137typedef struct mtpav { 141struct mtpav {
138 snd_card_t *card; 142 struct snd_card *card;
139 unsigned long port; 143 unsigned long port;
140 struct resource *res_port; 144 struct resource *res_port;
141 int irq; /* interrupt (for inputs) */ 145 int irq; /* interrupt (for inputs) */
@@ -143,24 +147,18 @@ typedef struct mtpav {
143 int share_irq; /* number of accesses to input interrupts */ 147 int share_irq; /* number of accesses to input interrupts */
144 int istimer; /* number of accesses to timer interrupts */ 148 int istimer; /* number of accesses to timer interrupts */
145 struct timer_list timer; /* timer interrupts for outputs */ 149 struct timer_list timer; /* timer interrupts for outputs */
146 snd_rawmidi_t *rmidi; 150 struct snd_rawmidi *rmidi;
147 int num_ports; /* number of hw ports (1-8) */ 151 int num_ports; /* number of hw ports (1-8) */
148 mtpav_port_t ports[NUMPORTS]; /* all ports including computer, adat and bc */ 152 struct mtpav_port ports[NUMPORTS]; /* all ports including computer, adat and bc */
149 153
150 u32 inmidiport; /* selected input midi port */ 154 u32 inmidiport; /* selected input midi port */
151 u32 inmidistate; /* during midi command 0xf5 */ 155 u32 inmidistate; /* during midi command 0xf5 */
152 156
153 u32 outmidihwport; /* selected output midi hw port */ 157 u32 outmidihwport; /* selected output midi hw port */
154} mtpav_t; 158};
155 159
156 160
157/* 161/*
158 * global instance
159 * hey, we handle at most only one card..
160 */
161static mtpav_t *mtp_card;
162
163/*
164 * possible hardware ports (selected by 0xf5 port message) 162 * possible hardware ports (selected by 0xf5 port message)
165 * 0x00 all ports 163 * 0x00 all ports
166 * 0x01 .. 0x08 this MTP's ports 1..8 164 * 0x01 .. 0x08 this MTP's ports 1..8
@@ -183,7 +181,7 @@ static mtpav_t *mtp_card;
183#define MTPAV_PIDX_BROADCAST 2 181#define MTPAV_PIDX_BROADCAST 2
184 182
185 183
186static int translate_subdevice_to_hwport(mtpav_t *chip, int subdev) 184static int translate_subdevice_to_hwport(struct mtpav *chip, int subdev)
187{ 185{
188 if (subdev < 0) 186 if (subdev < 0)
189 return 0x01; /* invalid - use port 0 as default */ 187 return 0x01; /* invalid - use port 0 as default */
@@ -198,7 +196,7 @@ static int translate_subdevice_to_hwport(mtpav_t *chip, int subdev)
198 return 0; /* all ports */ 196 return 0; /* all ports */
199} 197}
200 198
201static int translate_hwport_to_subdevice(mtpav_t *chip, int hwport) 199static int translate_hwport_to_subdevice(struct mtpav *chip, int hwport)
202{ 200{
203 int p; 201 int p;
204 if (hwport <= 0x00) /* all ports */ 202 if (hwport <= 0x00) /* all ports */
@@ -223,7 +221,7 @@ static int translate_hwport_to_subdevice(mtpav_t *chip, int hwport)
223/* 221/*
224 */ 222 */
225 223
226static u8 snd_mtpav_getreg(mtpav_t *chip, u16 reg) 224static u8 snd_mtpav_getreg(struct mtpav *chip, u16 reg)
227{ 225{
228 u8 rval = 0; 226 u8 rval = 0;
229 227
@@ -241,19 +239,16 @@ static u8 snd_mtpav_getreg(mtpav_t *chip, u16 reg)
241/* 239/*
242 */ 240 */
243 241
244static void snd_mtpav_mputreg(mtpav_t *chip, u16 reg, u8 val) 242static inline void snd_mtpav_mputreg(struct mtpav *chip, u16 reg, u8 val)
245{ 243{
246 if (reg == DREG) { 244 if (reg == DREG || reg == CREG)
247 outb(val, chip->port + DREG); 245 outb(val, chip->port + reg);
248 } else if (reg == CREG) {
249 outb(val, chip->port + CREG);
250 }
251} 246}
252 247
253/* 248/*
254 */ 249 */
255 250
256static void snd_mtpav_wait_rfdhi(mtpav_t *chip) 251static void snd_mtpav_wait_rfdhi(struct mtpav *chip)
257{ 252{
258 int counts = 10000; 253 int counts = 10000;
259 u8 sbyte; 254 u8 sbyte;
@@ -265,7 +260,7 @@ static void snd_mtpav_wait_rfdhi(mtpav_t *chip)
265 } 260 }
266} 261}
267 262
268static void snd_mtpav_send_byte(mtpav_t *chip, u8 byte) 263static void snd_mtpav_send_byte(struct mtpav *chip, u8 byte)
269{ 264{
270 u8 tcbyt; 265 u8 tcbyt;
271 u8 clrwrite; 266 u8 clrwrite;
@@ -291,8 +286,9 @@ static void snd_mtpav_send_byte(mtpav_t *chip, u8 byte)
291 */ 286 */
292 287
293/* call this with spin lock held */ 288/* call this with spin lock held */
294static void snd_mtpav_output_port_write(mtpav_port_t *port, 289static void snd_mtpav_output_port_write(struct mtpav *mtp_card,
295 snd_rawmidi_substream_t *substream) 290 struct mtpav_port *portp,
291 struct snd_rawmidi_substream *substream)
296{ 292{
297 u8 outbyte; 293 u8 outbyte;
298 294
@@ -303,34 +299,35 @@ static void snd_mtpav_output_port_write(mtpav_port_t *port,
303 299
304 // send port change command if necessary 300 // send port change command if necessary
305 301
306 if (port->hwport != mtp_card->outmidihwport) { 302 if (portp->hwport != mtp_card->outmidihwport) {
307 mtp_card->outmidihwport = port->hwport; 303 mtp_card->outmidihwport = portp->hwport;
308 304
309 snd_mtpav_send_byte(mtp_card, 0xf5); 305 snd_mtpav_send_byte(mtp_card, 0xf5);
310 snd_mtpav_send_byte(mtp_card, port->hwport); 306 snd_mtpav_send_byte(mtp_card, portp->hwport);
311 //snd_printk("new outport: 0x%x\n", (unsigned int) port->hwport); 307 //snd_printk("new outport: 0x%x\n", (unsigned int) portp->hwport);
312 308
313 if (!(outbyte & 0x80) && port->running_status) 309 if (!(outbyte & 0x80) && portp->running_status)
314 snd_mtpav_send_byte(mtp_card, port->running_status); 310 snd_mtpav_send_byte(mtp_card, portp->running_status);
315 } 311 }
316 312
317 // send data 313 // send data
318 314
319 do { 315 do {
320 if (outbyte & 0x80) 316 if (outbyte & 0x80)
321 port->running_status = outbyte; 317 portp->running_status = outbyte;
322 318
323 snd_mtpav_send_byte(mtp_card, outbyte); 319 snd_mtpav_send_byte(mtp_card, outbyte);
324 } while (snd_rawmidi_transmit(substream, &outbyte, 1) == 1); 320 } while (snd_rawmidi_transmit(substream, &outbyte, 1) == 1);
325} 321}
326 322
327static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream) 323static void snd_mtpav_output_write(struct snd_rawmidi_substream *substream)
328{ 324{
329 mtpav_port_t *port = &mtp_card->ports[substream->number]; 325 struct mtpav *mtp_card = substream->rmidi->private_data;
326 struct mtpav_port *portp = &mtp_card->ports[substream->number];
330 unsigned long flags; 327 unsigned long flags;
331 328
332 spin_lock_irqsave(&mtp_card->spinlock, flags); 329 spin_lock_irqsave(&mtp_card->spinlock, flags);
333 snd_mtpav_output_port_write(port, substream); 330 snd_mtpav_output_port_write(mtp_card, portp, substream);
334 spin_unlock_irqrestore(&mtp_card->spinlock, flags); 331 spin_unlock_irqrestore(&mtp_card->spinlock, flags);
335} 332}
336 333
@@ -339,7 +336,7 @@ static void snd_mtpav_output_write(snd_rawmidi_substream_t * substream)
339 * mtpav control 336 * mtpav control
340 */ 337 */
341 338
342static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode 339static void snd_mtpav_portscan(struct mtpav *chip) // put mtp into smart routing mode
343{ 340{
344 u8 p; 341 u8 p;
345 342
@@ -353,12 +350,12 @@ static void snd_mtpav_portscan(mtpav_t *chip) // put mtp into smart routing mode
353/* 350/*
354 */ 351 */
355 352
356static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream) 353static int snd_mtpav_input_open(struct snd_rawmidi_substream *substream)
357{ 354{
355 struct mtpav *mtp_card = substream->rmidi->private_data;
356 struct mtpav_port *portp = &mtp_card->ports[substream->number];
358 unsigned long flags; 357 unsigned long flags;
359 mtpav_port_t *portp = &mtp_card->ports[substream->number];
360 358
361 //printk("mtpav port: %d opened\n", (int) substream->number);
362 spin_lock_irqsave(&mtp_card->spinlock, flags); 359 spin_lock_irqsave(&mtp_card->spinlock, flags);
363 portp->mode |= MTPAV_MODE_INPUT_OPENED; 360 portp->mode |= MTPAV_MODE_INPUT_OPENED;
364 portp->input = substream; 361 portp->input = substream;
@@ -371,20 +368,17 @@ static int snd_mtpav_input_open(snd_rawmidi_substream_t * substream)
371/* 368/*
372 */ 369 */
373 370
374static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream) 371static int snd_mtpav_input_close(struct snd_rawmidi_substream *substream)
375{ 372{
373 struct mtpav *mtp_card = substream->rmidi->private_data;
374 struct mtpav_port *portp = &mtp_card->ports[substream->number];
376 unsigned long flags; 375 unsigned long flags;
377 mtpav_port_t *portp = &mtp_card->ports[substream->number];
378
379 //printk("mtpav port: %d closed\n", (int) portp);
380 376
381 spin_lock_irqsave(&mtp_card->spinlock, flags); 377 spin_lock_irqsave(&mtp_card->spinlock, flags);
382 378 portp->mode &= ~MTPAV_MODE_INPUT_OPENED;
383 portp->mode &= (~MTPAV_MODE_INPUT_OPENED);
384 portp->input = NULL; 379 portp->input = NULL;
385 if (--mtp_card->share_irq == 0) 380 if (--mtp_card->share_irq == 0)
386 snd_mtpav_mputreg(mtp_card, CREG, 0); // disable pport interrupts 381 snd_mtpav_mputreg(mtp_card, CREG, 0); // disable pport interrupts
387
388 spin_unlock_irqrestore(&mtp_card->spinlock, flags); 382 spin_unlock_irqrestore(&mtp_card->spinlock, flags);
389 return 0; 383 return 0;
390} 384}
@@ -392,10 +386,11 @@ static int snd_mtpav_input_close(snd_rawmidi_substream_t *substream)
392/* 386/*
393 */ 387 */
394 388
395static void snd_mtpav_input_trigger(snd_rawmidi_substream_t * substream, int up) 389static void snd_mtpav_input_trigger(struct snd_rawmidi_substream *substream, int up)
396{ 390{
391 struct mtpav *mtp_card = substream->rmidi->private_data;
392 struct mtpav_port *portp = &mtp_card->ports[substream->number];
397 unsigned long flags; 393 unsigned long flags;
398 mtpav_port_t *portp = &mtp_card->ports[substream->number];
399 394
400 spin_lock_irqsave(&mtp_card->spinlock, flags); 395 spin_lock_irqsave(&mtp_card->spinlock, flags);
401 if (up) 396 if (up)
@@ -414,7 +409,7 @@ static void snd_mtpav_input_trigger(snd_rawmidi_substream_t * substream, int up)
414static void snd_mtpav_output_timer(unsigned long data) 409static void snd_mtpav_output_timer(unsigned long data)
415{ 410{
416 unsigned long flags; 411 unsigned long flags;
417 mtpav_t *chip = (mtpav_t *)data; 412 struct mtpav *chip = (struct mtpav *)data;
418 int p; 413 int p;
419 414
420 spin_lock_irqsave(&chip->spinlock, flags); 415 spin_lock_irqsave(&chip->spinlock, flags);
@@ -423,25 +418,22 @@ static void snd_mtpav_output_timer(unsigned long data)
423 add_timer(&chip->timer); 418 add_timer(&chip->timer);
424 /* process each port */ 419 /* process each port */
425 for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) { 420 for (p = 0; p <= chip->num_ports * 2 + MTPAV_PIDX_BROADCAST; p++) {
426 mtpav_port_t *portp = &mtp_card->ports[p]; 421 struct mtpav_port *portp = &chip->ports[p];
427 if ((portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED) && portp->output) 422 if ((portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED) && portp->output)
428 snd_mtpav_output_port_write(portp, portp->output); 423 snd_mtpav_output_port_write(chip, portp, portp->output);
429 } 424 }
430 spin_unlock_irqrestore(&chip->spinlock, flags); 425 spin_unlock_irqrestore(&chip->spinlock, flags);
431} 426}
432 427
433/* spinlock held! */ 428/* spinlock held! */
434static void snd_mtpav_add_output_timer(mtpav_t *chip) 429static void snd_mtpav_add_output_timer(struct mtpav *chip)
435{ 430{
436 init_timer(&chip->timer);
437 chip->timer.function = snd_mtpav_output_timer;
438 chip->timer.data = (unsigned long) mtp_card;
439 chip->timer.expires = 1 + jiffies; 431 chip->timer.expires = 1 + jiffies;
440 add_timer(&chip->timer); 432 add_timer(&chip->timer);
441} 433}
442 434
443/* spinlock held! */ 435/* spinlock held! */
444static void snd_mtpav_remove_output_timer(mtpav_t *chip) 436static void snd_mtpav_remove_output_timer(struct mtpav *chip)
445{ 437{
446 del_timer(&chip->timer); 438 del_timer(&chip->timer);
447} 439}
@@ -449,10 +441,11 @@ static void snd_mtpav_remove_output_timer(mtpav_t *chip)
449/* 441/*
450 */ 442 */
451 443
452static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream) 444static int snd_mtpav_output_open(struct snd_rawmidi_substream *substream)
453{ 445{
446 struct mtpav *mtp_card = substream->rmidi->private_data;
447 struct mtpav_port *portp = &mtp_card->ports[substream->number];
454 unsigned long flags; 448 unsigned long flags;
455 mtpav_port_t *portp = &mtp_card->ports[substream->number];
456 449
457 spin_lock_irqsave(&mtp_card->spinlock, flags); 450 spin_lock_irqsave(&mtp_card->spinlock, flags);
458 portp->mode |= MTPAV_MODE_OUTPUT_OPENED; 451 portp->mode |= MTPAV_MODE_OUTPUT_OPENED;
@@ -464,13 +457,14 @@ static int snd_mtpav_output_open(snd_rawmidi_substream_t * substream)
464/* 457/*
465 */ 458 */
466 459
467static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream) 460static int snd_mtpav_output_close(struct snd_rawmidi_substream *substream)
468{ 461{
462 struct mtpav *mtp_card = substream->rmidi->private_data;
463 struct mtpav_port *portp = &mtp_card->ports[substream->number];
469 unsigned long flags; 464 unsigned long flags;
470 mtpav_port_t *portp = &mtp_card->ports[substream->number];
471 465
472 spin_lock_irqsave(&mtp_card->spinlock, flags); 466 spin_lock_irqsave(&mtp_card->spinlock, flags);
473 portp->mode &= (~MTPAV_MODE_OUTPUT_OPENED); 467 portp->mode &= ~MTPAV_MODE_OUTPUT_OPENED;
474 portp->output = NULL; 468 portp->output = NULL;
475 spin_unlock_irqrestore(&mtp_card->spinlock, flags); 469 spin_unlock_irqrestore(&mtp_card->spinlock, flags);
476 return 0; 470 return 0;
@@ -479,14 +473,15 @@ static int snd_mtpav_output_close(snd_rawmidi_substream_t * substream)
479/* 473/*
480 */ 474 */
481 475
482static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up) 476static void snd_mtpav_output_trigger(struct snd_rawmidi_substream *substream, int up)
483{ 477{
478 struct mtpav *mtp_card = substream->rmidi->private_data;
479 struct mtpav_port *portp = &mtp_card->ports[substream->number];
484 unsigned long flags; 480 unsigned long flags;
485 mtpav_port_t *portp = &mtp_card->ports[substream->number];
486 481
487 spin_lock_irqsave(&mtp_card->spinlock, flags); 482 spin_lock_irqsave(&mtp_card->spinlock, flags);
488 if (up) { 483 if (up) {
489 if (! (portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED)) { 484 if (! (portp->mode & MTPAV_MODE_OUTPUT_TRIGGERED)) {
490 if (mtp_card->istimer++ == 0) 485 if (mtp_card->istimer++ == 0)
491 snd_mtpav_add_output_timer(mtp_card); 486 snd_mtpav_add_output_timer(mtp_card);
492 portp->mode |= MTPAV_MODE_OUTPUT_TRIGGERED; 487 portp->mode |= MTPAV_MODE_OUTPUT_TRIGGERED;
@@ -506,23 +501,20 @@ static void snd_mtpav_output_trigger(snd_rawmidi_substream_t * substream, int up
506 * midi interrupt for inputs 501 * midi interrupt for inputs
507 */ 502 */
508 503
509static void snd_mtpav_inmidi_process(mtpav_t *mcrd, u8 inbyte) 504static void snd_mtpav_inmidi_process(struct mtpav *mcrd, u8 inbyte)
510{ 505{
511 mtpav_port_t *portp; 506 struct mtpav_port *portp;
512 507
513 if ((int)mcrd->inmidiport > mcrd->num_ports * 2 + MTPAV_PIDX_BROADCAST) 508 if ((int)mcrd->inmidiport > mcrd->num_ports * 2 + MTPAV_PIDX_BROADCAST)
514 return; 509 return;
515 510
516 portp = &mcrd->ports[mcrd->inmidiport]; 511 portp = &mcrd->ports[mcrd->inmidiport];
517 if (portp->mode & MTPAV_MODE_INPUT_TRIGGERED) { 512 if (portp->mode & MTPAV_MODE_INPUT_TRIGGERED)
518 snd_rawmidi_receive(portp->input, &inbyte, 1); 513 snd_rawmidi_receive(portp->input, &inbyte, 1);
519 }
520} 514}
521 515
522static void snd_mtpav_inmidi_h(mtpav_t * mcrd, u8 inbyte) 516static void snd_mtpav_inmidi_h(struct mtpav *mcrd, u8 inbyte)
523{ 517{
524 snd_assert(mcrd, return);
525
526 if (inbyte >= 0xf8) { 518 if (inbyte >= 0xf8) {
527 /* real-time midi code */ 519 /* real-time midi code */
528 snd_mtpav_inmidi_process(mcrd, inbyte); 520 snd_mtpav_inmidi_process(mcrd, inbyte);
@@ -540,7 +532,7 @@ static void snd_mtpav_inmidi_h(mtpav_t * mcrd, u8 inbyte)
540 } 532 }
541} 533}
542 534
543static void snd_mtpav_read_bytes(mtpav_t * mcrd) 535static void snd_mtpav_read_bytes(struct mtpav *mcrd)
544{ 536{
545 u8 clrread, setread; 537 u8 clrread, setread;
546 u8 mtp_read_byte; 538 u8 mtp_read_byte;
@@ -580,9 +572,8 @@ static void snd_mtpav_read_bytes(mtpav_t * mcrd)
580 572
581static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs) 573static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs)
582{ 574{
583 mtpav_t *mcard = dev_id; 575 struct mtpav *mcard = dev_id;
584 576
585 //printk("irqh()\n");
586 spin_lock(&mcard->spinlock); 577 spin_lock(&mcard->spinlock);
587 snd_mtpav_read_bytes(mcard); 578 snd_mtpav_read_bytes(mcard);
588 spin_unlock(&mcard->spinlock); 579 spin_unlock(&mcard->spinlock);
@@ -592,14 +583,14 @@ static irqreturn_t snd_mtpav_irqh(int irq, void *dev_id, struct pt_regs *regs)
592/* 583/*
593 * get ISA resources 584 * get ISA resources
594 */ 585 */
595static int snd_mtpav_get_ISA(mtpav_t * mcard) 586static int __init snd_mtpav_get_ISA(struct mtpav * mcard)
596{ 587{
597 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) { 588 if ((mcard->res_port = request_region(port, 3, "MotuMTPAV MIDI")) == NULL) {
598 snd_printk("MTVAP port 0x%lx is busy\n", port); 589 snd_printk("MTVAP port 0x%lx is busy\n", port);
599 return -EBUSY; 590 return -EBUSY;
600 } 591 }
601 mcard->port = port; 592 mcard->port = port;
602 if (request_irq(irq, snd_mtpav_irqh, SA_INTERRUPT, "MOTU MTPAV", (void *)mcard)) { 593 if (request_irq(irq, snd_mtpav_irqh, SA_INTERRUPT, "MOTU MTPAV", mcard)) {
603 snd_printk("MTVAP IRQ %d busy\n", irq); 594 snd_printk("MTVAP IRQ %d busy\n", irq);
604 return -EBUSY; 595 return -EBUSY;
605 } 596 }
@@ -611,13 +602,13 @@ static int snd_mtpav_get_ISA(mtpav_t * mcard)
611/* 602/*
612 */ 603 */
613 604
614static snd_rawmidi_ops_t snd_mtpav_output = { 605static struct snd_rawmidi_ops snd_mtpav_output = {
615 .open = snd_mtpav_output_open, 606 .open = snd_mtpav_output_open,
616 .close = snd_mtpav_output_close, 607 .close = snd_mtpav_output_close,
617 .trigger = snd_mtpav_output_trigger, 608 .trigger = snd_mtpav_output_trigger,
618}; 609};
619 610
620static snd_rawmidi_ops_t snd_mtpav_input = { 611static struct snd_rawmidi_ops snd_mtpav_input = {
621 .open = snd_mtpav_input_open, 612 .open = snd_mtpav_input_open,
622 .close = snd_mtpav_input_close, 613 .close = snd_mtpav_input_close,
623 .trigger = snd_mtpav_input_trigger, 614 .trigger = snd_mtpav_input_trigger,
@@ -628,7 +619,8 @@ static snd_rawmidi_ops_t snd_mtpav_input = {
628 * get RAWMIDI resources 619 * get RAWMIDI resources
629 */ 620 */
630 621
631static void snd_mtpav_set_name(mtpav_t *chip, snd_rawmidi_substream_t *substream) 622static void __init snd_mtpav_set_name(struct mtpav *chip,
623 struct snd_rawmidi_substream *substream)
632{ 624{
633 if (substream->number >= 0 && substream->number < chip->num_ports) 625 if (substream->number >= 0 && substream->number < chip->num_ports)
634 sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1); 626 sprintf(substream->name, "MTP direct %d", (substream->number % chip->num_ports) + 1);
@@ -642,21 +634,18 @@ static void snd_mtpav_set_name(mtpav_t *chip, snd_rawmidi_substream_t *substream
642 strcpy(substream->name, "MTP broadcast"); 634 strcpy(substream->name, "MTP broadcast");
643} 635}
644 636
645static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard) 637static int __init snd_mtpav_get_RAWMIDI(struct mtpav *mcard)
646{ 638{
647 int rval = 0; 639 int rval;
648 snd_rawmidi_t *rawmidi; 640 struct snd_rawmidi *rawmidi;
649 snd_rawmidi_substream_t *substream; 641 struct snd_rawmidi_substream *substream;
650 struct list_head *list; 642 struct list_head *list;
651 643
652 //printk("entering snd_mtpav_get_RAWMIDI\n");
653
654 if (hwports < 1) 644 if (hwports < 1)
655 mcard->num_ports = 1; 645 hwports = 1;
656 else if (hwports > 8) 646 else if (hwports > 8)
657 mcard->num_ports = 8; 647 hwports = 8;
658 else 648 mcard->num_ports = hwports;
659 mcard->num_ports = hwports;
660 649
661 if ((rval = snd_rawmidi_new(mcard->card, "MotuMIDI", 0, 650 if ((rval = snd_rawmidi_new(mcard->card, "MotuMIDI", 0,
662 mcard->num_ports * 2 + MTPAV_PIDX_BROADCAST + 1, 651 mcard->num_ports * 2 + MTPAV_PIDX_BROADCAST + 1,
@@ -664,14 +653,15 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
664 &mcard->rmidi)) < 0) 653 &mcard->rmidi)) < 0)
665 return rval; 654 return rval;
666 rawmidi = mcard->rmidi; 655 rawmidi = mcard->rmidi;
656 rawmidi->private_data = mcard;
667 657
668 list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) { 658 list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) {
669 substream = list_entry(list, snd_rawmidi_substream_t, list); 659 substream = list_entry(list, struct snd_rawmidi_substream, list);
670 snd_mtpav_set_name(mcard, substream); 660 snd_mtpav_set_name(mcard, substream);
671 substream->ops = &snd_mtpav_input; 661 substream->ops = &snd_mtpav_input;
672 } 662 }
673 list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) { 663 list_for_each(list, &rawmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
674 substream = list_entry(list, snd_rawmidi_substream_t, list); 664 substream = list_entry(list, struct snd_rawmidi_substream, list);
675 snd_mtpav_set_name(mcard, substream); 665 snd_mtpav_set_name(mcard, substream);
676 substream->ops = &snd_mtpav_output; 666 substream->ops = &snd_mtpav_output;
677 mcard->ports[substream->number].hwport = translate_subdevice_to_hwport(mcard, substream->number); 667 mcard->ports[substream->number].hwport = translate_subdevice_to_hwport(mcard, substream->number);
@@ -679,36 +669,15 @@ static int snd_mtpav_get_RAWMIDI(mtpav_t * mcard)
679 rawmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT | 669 rawmidi->info_flags |= SNDRV_RAWMIDI_INFO_OUTPUT | SNDRV_RAWMIDI_INFO_INPUT |
680 SNDRV_RAWMIDI_INFO_DUPLEX; 670 SNDRV_RAWMIDI_INFO_DUPLEX;
681 sprintf(rawmidi->name, "MTP AV MIDI"); 671 sprintf(rawmidi->name, "MTP AV MIDI");
682 //printk("exiting snd_mtpav_get_RAWMIDI() \n");
683 return 0; 672 return 0;
684} 673}
685 674
686/* 675/*
687 */ 676 */
688 677
689static mtpav_t *new_mtpav(void) 678static void snd_mtpav_free(struct snd_card *card)
690{
691 mtpav_t *ncrd = kzalloc(sizeof(*ncrd), GFP_KERNEL);
692 if (ncrd != NULL) {
693 spin_lock_init(&ncrd->spinlock);
694
695 init_timer(&ncrd->timer);
696 ncrd->card = NULL;
697 ncrd->irq = -1;
698 ncrd->share_irq = 0;
699
700 ncrd->inmidiport = 0xffffffff;
701 ncrd->inmidistate = 0;
702 ncrd->outmidihwport = 0xffffffff;
703 }
704 return ncrd;
705}
706
707/*
708 */
709
710static void free_mtpav(mtpav_t * crd)
711{ 679{
680 struct mtpav *crd = card->private_data;
712 unsigned long flags; 681 unsigned long flags;
713 682
714 spin_lock_irqsave(&crd->spinlock, flags); 683 spin_lock_irqsave(&crd->spinlock, flags);
@@ -718,78 +687,101 @@ static void free_mtpav(mtpav_t * crd)
718 if (crd->irq >= 0) 687 if (crd->irq >= 0)
719 free_irq(crd->irq, (void *)crd); 688 free_irq(crd->irq, (void *)crd);
720 release_and_free_resource(crd->res_port); 689 release_and_free_resource(crd->res_port);
721 kfree(crd);
722} 690}
723 691
724/* 692/*
725 */ 693 */
726 694static int __init snd_mtpav_probe(struct platform_device *dev)
727static int __init alsa_card_mtpav_init(void)
728{ 695{
729 int err = 0; 696 struct snd_card *card;
730 char longname_buffer[80]; 697 int err;
698 struct mtpav *mtp_card;
731 699
732 mtp_card = new_mtpav(); 700 card = snd_card_new(index, id, THIS_MODULE, sizeof(*mtp_card));
733 if (mtp_card == NULL) 701 if (! card)
734 return -ENOMEM; 702 return -ENOMEM;
735 703
736 mtp_card->card = snd_card_new(index, id, THIS_MODULE, 0); 704 mtp_card = card->private_data;
737 if (mtp_card->card == NULL) { 705 spin_lock_init(&mtp_card->spinlock);
738 free_mtpav(mtp_card); 706 init_timer(&mtp_card->timer);
739 return -ENOMEM; 707 mtp_card->card = card;
740 } 708 mtp_card->irq = -1;
709 mtp_card->share_irq = 0;
710 mtp_card->inmidiport = 0xffffffff;
711 mtp_card->inmidistate = 0;
712 mtp_card->outmidihwport = 0xffffffff;
713 init_timer(&mtp_card->timer);
714 mtp_card->timer.function = snd_mtpav_output_timer;
715 mtp_card->timer.data = (unsigned long) mtp_card;
716
717 card->private_free = snd_mtpav_free;
741 718
742 err = snd_mtpav_get_ISA(mtp_card); 719 err = snd_mtpav_get_ISA(mtp_card);
743 //printk("snd_mtpav_get_ISA returned: %d\n", err);
744 if (err < 0) 720 if (err < 0)
745 goto __error; 721 goto __error;
746 722
747 strcpy(mtp_card->card->driver, "MTPAV"); 723 strcpy(card->driver, "MTPAV");
748 strcpy(mtp_card->card->shortname, "MTPAV on parallel port"); 724 strcpy(card->shortname, "MTPAV on parallel port");
749 memset(longname_buffer, 0, sizeof(longname_buffer)); 725 snprintf(card->longname, sizeof(card->longname),
750 sprintf(longname_buffer, "MTPAV on parallel port at"); 726 "MTPAV on parallel port at 0x%lx", port);
751 727
752 err = snd_mtpav_get_RAWMIDI(mtp_card); 728 err = snd_mtpav_get_RAWMIDI(mtp_card);
753 //snd_printk("snd_mtapv_get_RAWMIDI returned: %d\n", err);
754 if (err < 0) 729 if (err < 0)
755 goto __error; 730 goto __error;
756 731
757 if ((err = snd_card_set_generic_dev(mtp_card->card)) < 0) 732 snd_mtpav_portscan(mtp_card);
758 goto __error;
759
760 err = snd_card_register(mtp_card->card); // don't snd_card_register until AFTER all cards reources done!
761 733
762 //printk("snd_card_register returned %d\n", err); 734 snd_card_set_dev(card, &dev->dev);
735 err = snd_card_register(mtp_card->card);
763 if (err < 0) 736 if (err < 0)
764 goto __error; 737 goto __error;
765 738
766 739 platform_set_drvdata(dev, card);
767 snd_mtpav_portscan(mtp_card);
768
769 printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", irq, port); 740 printk(KERN_INFO "Motu MidiTimePiece on parallel port irq: %d ioport: 0x%lx\n", irq, port);
770
771 return 0; 741 return 0;
772 742
773 __error: 743 __error:
774 snd_card_free(mtp_card->card); 744 snd_card_free(card);
775 free_mtpav(mtp_card);
776 return err; 745 return err;
777} 746}
778 747
779/* 748static int snd_mtpav_remove(struct platform_device *devptr)
780 */ 749{
750 snd_card_free(platform_get_drvdata(devptr));
751 platform_set_drvdata(devptr, NULL);
752 return 0;
753}
781 754
782static void __exit alsa_card_mtpav_exit(void) 755#define SND_MTPAV_DRIVER "snd_mtpav"
756
757static struct platform_driver snd_mtpav_driver = {
758 .probe = snd_mtpav_probe,
759 .remove = snd_mtpav_remove,
760 .driver = {
761 .name = SND_MTPAV_DRIVER
762 },
763};
764
765static int __init alsa_card_mtpav_init(void)
783{ 766{
784 if (mtp_card == NULL) 767 int err;
785 return; 768
786 if (mtp_card->card) 769 if ((err = platform_driver_register(&snd_mtpav_driver)) < 0)
787 snd_card_free(mtp_card->card); 770 return err;
788 free_mtpav(mtp_card); 771
772 device = platform_device_register_simple(SND_MTPAV_DRIVER, -1, NULL, 0);
773 if (IS_ERR(device)) {
774 platform_driver_unregister(&snd_mtpav_driver);
775 return PTR_ERR(device);
776 }
777 return 0;
789} 778}
790 779
791/* 780static void __exit alsa_card_mtpav_exit(void)
792 */ 781{
782 platform_device_unregister(device);
783 platform_driver_unregister(&snd_mtpav_driver);
784}
793 785
794module_init(alsa_card_mtpav_init) 786module_init(alsa_card_mtpav_init)
795module_exit(alsa_card_mtpav_exit) 787module_exit(alsa_card_mtpav_exit)
diff --git a/sound/drivers/opl3/opl3_drums.c b/sound/drivers/opl3/opl3_drums.c
index f26332680c19..73694380734a 100644
--- a/sound/drivers/opl3/opl3_drums.c
+++ b/sound/drivers/opl3/opl3_drums.c
@@ -45,7 +45,7 @@ static char snd_opl3_drum_table[47] =
45 OPL3_CYMBAL_ON, OPL3_CYMBAL_ON /* 80 - 81 */ 45 OPL3_CYMBAL_ON, OPL3_CYMBAL_ON /* 80 - 81 */
46}; 46};
47 47
48typedef struct snd_opl3_drum_voice { 48struct snd_opl3_drum_voice {
49 int voice; 49 int voice;
50 int op; 50 int op;
51 unsigned char am_vib; 51 unsigned char am_vib;
@@ -54,33 +54,34 @@ typedef struct snd_opl3_drum_voice {
54 unsigned char sustain_release; 54 unsigned char sustain_release;
55 unsigned char feedback_connection; 55 unsigned char feedback_connection;
56 unsigned char wave_select; 56 unsigned char wave_select;
57} snd_opl3_drum_voice_t; 57};
58 58
59typedef struct snd_opl3_drum_note { 59struct snd_opl3_drum_note {
60 int voice; 60 int voice;
61 unsigned char fnum; 61 unsigned char fnum;
62 unsigned char octave_f; 62 unsigned char octave_f;
63 unsigned char feedback_connection; 63 unsigned char feedback_connection;
64} snd_opl3_drum_note_t; 64};
65 65
66static snd_opl3_drum_voice_t bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00}; 66static struct snd_opl3_drum_voice bass_op0 = {6, 0, 0x00, 0x32, 0xf8, 0x66, 0x30, 0x00};
67static snd_opl3_drum_voice_t bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00}; 67static struct snd_opl3_drum_voice bass_op1 = {6, 1, 0x00, 0x03, 0xf6, 0x57, 0x30, 0x00};
68static snd_opl3_drum_note_t bass_note = {6, 0x90, 0x09}; 68static struct snd_opl3_drum_note bass_note = {6, 0x90, 0x09};
69 69
70static snd_opl3_drum_voice_t hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00}; 70static struct snd_opl3_drum_voice hihat = {7, 0, 0x00, 0x03, 0xf0, 0x06, 0x20, 0x00};
71 71
72static snd_opl3_drum_voice_t snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02}; 72static struct snd_opl3_drum_voice snare = {7, 1, 0x00, 0x03, 0xf0, 0x07, 0x20, 0x02};
73static snd_opl3_drum_note_t snare_note = {7, 0xf4, 0x0d}; 73static struct snd_opl3_drum_note snare_note = {7, 0xf4, 0x0d};
74 74
75static snd_opl3_drum_voice_t tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00}; 75static struct snd_opl3_drum_voice tomtom = {8, 0, 0x02, 0x03, 0xf0, 0x06, 0x10, 0x00};
76static snd_opl3_drum_note_t tomtom_note = {8, 0xf4, 0x09}; 76static struct snd_opl3_drum_note tomtom_note = {8, 0xf4, 0x09};
77 77
78static snd_opl3_drum_voice_t cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00}; 78static struct snd_opl3_drum_voice cymbal = {8, 1, 0x04, 0x03, 0xf0, 0x06, 0x10, 0x00};
79 79
80/* 80/*
81 * set drum voice characteristics 81 * set drum voice characteristics
82 */ 82 */
83static void snd_opl3_drum_voice_set(opl3_t *opl3, snd_opl3_drum_voice_t *data) 83static void snd_opl3_drum_voice_set(struct snd_opl3 *opl3,
84 struct snd_opl3_drum_voice *data)
84{ 85{
85 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op]; 86 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
86 unsigned char voice_offset = data->voice; 87 unsigned char voice_offset = data->voice;
@@ -114,7 +115,8 @@ static void snd_opl3_drum_voice_set(opl3_t *opl3, snd_opl3_drum_voice_t *data)
114/* 115/*
115 * Set drum voice pitch 116 * Set drum voice pitch
116 */ 117 */
117static void snd_opl3_drum_note_set(opl3_t *opl3, snd_opl3_drum_note_t *data) 118static void snd_opl3_drum_note_set(struct snd_opl3 *opl3,
119 struct snd_opl3_drum_note *data)
118{ 120{
119 unsigned char voice_offset = data->voice; 121 unsigned char voice_offset = data->voice;
120 unsigned short opl3_reg; 122 unsigned short opl3_reg;
@@ -131,8 +133,9 @@ static void snd_opl3_drum_note_set(opl3_t *opl3, snd_opl3_drum_note_t *data)
131/* 133/*
132 * Set drum voice volume and position 134 * Set drum voice volume and position
133 */ 135 */
134static void snd_opl3_drum_vol_set(opl3_t *opl3, snd_opl3_drum_voice_t *data, 136static void snd_opl3_drum_vol_set(struct snd_opl3 *opl3,
135 int vel, snd_midi_channel_t *chan) 137 struct snd_opl3_drum_voice *data,
138 int vel, struct snd_midi_channel *chan)
136{ 139{
137 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op]; 140 unsigned char op_offset = snd_opl3_regmap[data->voice][data->op];
138 unsigned char voice_offset = data->voice; 141 unsigned char voice_offset = data->voice;
@@ -159,7 +162,7 @@ static void snd_opl3_drum_vol_set(opl3_t *opl3, snd_opl3_drum_voice_t *data,
159/* 162/*
160 * Loads drum voices at init time 163 * Loads drum voices at init time
161 */ 164 */
162void snd_opl3_load_drums(opl3_t *opl3) 165void snd_opl3_load_drums(struct snd_opl3 *opl3)
163{ 166{
164 snd_opl3_drum_voice_set(opl3, &bass_op0); 167 snd_opl3_drum_voice_set(opl3, &bass_op0);
165 snd_opl3_drum_voice_set(opl3, &bass_op1); 168 snd_opl3_drum_voice_set(opl3, &bass_op1);
@@ -179,11 +182,11 @@ void snd_opl3_load_drums(opl3_t *opl3)
179/* 182/*
180 * Switch drum voice on or off 183 * Switch drum voice on or off
181 */ 184 */
182void snd_opl3_drum_switch(opl3_t *opl3, int note, int vel, int on_off, 185void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int vel, int on_off,
183 snd_midi_channel_t *chan) 186 struct snd_midi_channel *chan)
184{ 187{
185 unsigned char drum_mask; 188 unsigned char drum_mask;
186 snd_opl3_drum_voice_t *drum_voice; 189 struct snd_opl3_drum_voice *drum_voice;
187 190
188 if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE)) 191 if (!(opl3->drum_reg & OPL3_PERCUSSION_ENABLE))
189 return; 192 return;
diff --git a/sound/drivers/opl3/opl3_lib.c b/sound/drivers/opl3/opl3_lib.c
index 06246503083c..1e0c76b9acfc 100644
--- a/sound/drivers/opl3/opl3_lib.c
+++ b/sound/drivers/opl3/opl3_lib.c
@@ -37,7 +37,7 @@ MODULE_LICENSE("GPL");
37 37
38extern char snd_opl3_regmap[MAX_OPL2_VOICES][4]; 38extern char snd_opl3_regmap[MAX_OPL2_VOICES][4];
39 39
40static void snd_opl2_command(opl3_t * opl3, unsigned short cmd, unsigned char val) 40static void snd_opl2_command(struct snd_opl3 * opl3, unsigned short cmd, unsigned char val)
41{ 41{
42 unsigned long flags; 42 unsigned long flags;
43 unsigned long port; 43 unsigned long port;
@@ -60,7 +60,7 @@ static void snd_opl2_command(opl3_t * opl3, unsigned short cmd, unsigned char va
60 spin_unlock_irqrestore(&opl3->reg_lock, flags); 60 spin_unlock_irqrestore(&opl3->reg_lock, flags);
61} 61}
62 62
63static void snd_opl3_command(opl3_t * opl3, unsigned short cmd, unsigned char val) 63static void snd_opl3_command(struct snd_opl3 * opl3, unsigned short cmd, unsigned char val)
64{ 64{
65 unsigned long flags; 65 unsigned long flags;
66 unsigned long port; 66 unsigned long port;
@@ -85,7 +85,7 @@ static void snd_opl3_command(opl3_t * opl3, unsigned short cmd, unsigned char va
85 spin_unlock_irqrestore(&opl3->reg_lock, flags); 85 spin_unlock_irqrestore(&opl3->reg_lock, flags);
86} 86}
87 87
88static int snd_opl3_detect(opl3_t * opl3) 88static int snd_opl3_detect(struct snd_opl3 * opl3)
89{ 89{
90 /* 90 /*
91 * This function returns 1 if the FM chip is present at the given I/O port 91 * This function returns 1 if the FM chip is present at the given I/O port
@@ -153,12 +153,12 @@ static int snd_opl3_detect(opl3_t * opl3)
153 * Timer 1 - 80us 153 * Timer 1 - 80us
154 */ 154 */
155 155
156static int snd_opl3_timer1_start(snd_timer_t * timer) 156static int snd_opl3_timer1_start(struct snd_timer * timer)
157{ 157{
158 unsigned long flags; 158 unsigned long flags;
159 unsigned char tmp; 159 unsigned char tmp;
160 unsigned int ticks; 160 unsigned int ticks;
161 opl3_t *opl3; 161 struct snd_opl3 *opl3;
162 162
163 opl3 = snd_timer_chip(timer); 163 opl3 = snd_timer_chip(timer);
164 spin_lock_irqsave(&opl3->timer_lock, flags); 164 spin_lock_irqsave(&opl3->timer_lock, flags);
@@ -171,11 +171,11 @@ static int snd_opl3_timer1_start(snd_timer_t * timer)
171 return 0; 171 return 0;
172} 172}
173 173
174static int snd_opl3_timer1_stop(snd_timer_t * timer) 174static int snd_opl3_timer1_stop(struct snd_timer * timer)
175{ 175{
176 unsigned long flags; 176 unsigned long flags;
177 unsigned char tmp; 177 unsigned char tmp;
178 opl3_t *opl3; 178 struct snd_opl3 *opl3;
179 179
180 opl3 = snd_timer_chip(timer); 180 opl3 = snd_timer_chip(timer);
181 spin_lock_irqsave(&opl3->timer_lock, flags); 181 spin_lock_irqsave(&opl3->timer_lock, flags);
@@ -190,12 +190,12 @@ static int snd_opl3_timer1_stop(snd_timer_t * timer)
190 * Timer 2 - 320us 190 * Timer 2 - 320us
191 */ 191 */
192 192
193static int snd_opl3_timer2_start(snd_timer_t * timer) 193static int snd_opl3_timer2_start(struct snd_timer * timer)
194{ 194{
195 unsigned long flags; 195 unsigned long flags;
196 unsigned char tmp; 196 unsigned char tmp;
197 unsigned int ticks; 197 unsigned int ticks;
198 opl3_t *opl3; 198 struct snd_opl3 *opl3;
199 199
200 opl3 = snd_timer_chip(timer); 200 opl3 = snd_timer_chip(timer);
201 spin_lock_irqsave(&opl3->timer_lock, flags); 201 spin_lock_irqsave(&opl3->timer_lock, flags);
@@ -208,11 +208,11 @@ static int snd_opl3_timer2_start(snd_timer_t * timer)
208 return 0; 208 return 0;
209} 209}
210 210
211static int snd_opl3_timer2_stop(snd_timer_t * timer) 211static int snd_opl3_timer2_stop(struct snd_timer * timer)
212{ 212{
213 unsigned long flags; 213 unsigned long flags;
214 unsigned char tmp; 214 unsigned char tmp;
215 opl3_t *opl3; 215 struct snd_opl3 *opl3;
216 216
217 opl3 = snd_timer_chip(timer); 217 opl3 = snd_timer_chip(timer);
218 spin_lock_irqsave(&opl3->timer_lock, flags); 218 spin_lock_irqsave(&opl3->timer_lock, flags);
@@ -227,7 +227,7 @@ static int snd_opl3_timer2_stop(snd_timer_t * timer)
227 227
228 */ 228 */
229 229
230static struct _snd_timer_hardware snd_opl3_timer1 = 230static struct snd_timer_hardware snd_opl3_timer1 =
231{ 231{
232 .flags = SNDRV_TIMER_HW_STOP, 232 .flags = SNDRV_TIMER_HW_STOP,
233 .resolution = 80000, 233 .resolution = 80000,
@@ -236,7 +236,7 @@ static struct _snd_timer_hardware snd_opl3_timer1 =
236 .stop = snd_opl3_timer1_stop, 236 .stop = snd_opl3_timer1_stop,
237}; 237};
238 238
239static struct _snd_timer_hardware snd_opl3_timer2 = 239static struct snd_timer_hardware snd_opl3_timer2 =
240{ 240{
241 .flags = SNDRV_TIMER_HW_STOP, 241 .flags = SNDRV_TIMER_HW_STOP,
242 .resolution = 320000, 242 .resolution = 320000,
@@ -245,10 +245,10 @@ static struct _snd_timer_hardware snd_opl3_timer2 =
245 .stop = snd_opl3_timer2_stop, 245 .stop = snd_opl3_timer2_stop,
246}; 246};
247 247
248static int snd_opl3_timer1_init(opl3_t * opl3, int timer_no) 248static int snd_opl3_timer1_init(struct snd_opl3 * opl3, int timer_no)
249{ 249{
250 snd_timer_t *timer = NULL; 250 struct snd_timer *timer = NULL;
251 snd_timer_id_t tid; 251 struct snd_timer_id tid;
252 int err; 252 int err;
253 253
254 tid.dev_class = SNDRV_TIMER_CLASS_CARD; 254 tid.dev_class = SNDRV_TIMER_CLASS_CARD;
@@ -265,10 +265,10 @@ static int snd_opl3_timer1_init(opl3_t * opl3, int timer_no)
265 return err; 265 return err;
266} 266}
267 267
268static int snd_opl3_timer2_init(opl3_t * opl3, int timer_no) 268static int snd_opl3_timer2_init(struct snd_opl3 * opl3, int timer_no)
269{ 269{
270 snd_timer_t *timer = NULL; 270 struct snd_timer *timer = NULL;
271 snd_timer_id_t tid; 271 struct snd_timer_id tid;
272 int err; 272 int err;
273 273
274 tid.dev_class = SNDRV_TIMER_CLASS_CARD; 274 tid.dev_class = SNDRV_TIMER_CLASS_CARD;
@@ -289,11 +289,11 @@ static int snd_opl3_timer2_init(opl3_t * opl3, int timer_no)
289 289
290 */ 290 */
291 291
292void snd_opl3_interrupt(snd_hwdep_t * hw) 292void snd_opl3_interrupt(struct snd_hwdep * hw)
293{ 293{
294 unsigned char status; 294 unsigned char status;
295 opl3_t *opl3; 295 struct snd_opl3 *opl3;
296 snd_timer_t *timer; 296 struct snd_timer *timer;
297 297
298 if (hw == NULL) 298 if (hw == NULL)
299 return; 299 return;
@@ -320,7 +320,7 @@ void snd_opl3_interrupt(snd_hwdep_t * hw)
320 320
321 */ 321 */
322 322
323static int snd_opl3_free(opl3_t *opl3) 323static int snd_opl3_free(struct snd_opl3 *opl3)
324{ 324{
325 snd_assert(opl3 != NULL, return -ENXIO); 325 snd_assert(opl3 != NULL, return -ENXIO);
326 if (opl3->private_free) 326 if (opl3->private_free)
@@ -331,26 +331,28 @@ static int snd_opl3_free(opl3_t *opl3)
331 return 0; 331 return 0;
332} 332}
333 333
334static int snd_opl3_dev_free(snd_device_t *device) 334static int snd_opl3_dev_free(struct snd_device *device)
335{ 335{
336 opl3_t *opl3 = device->device_data; 336 struct snd_opl3 *opl3 = device->device_data;
337 return snd_opl3_free(opl3); 337 return snd_opl3_free(opl3);
338} 338}
339 339
340int snd_opl3_new(snd_card_t *card, 340int snd_opl3_new(struct snd_card *card,
341 unsigned short hardware, 341 unsigned short hardware,
342 opl3_t **ropl3) 342 struct snd_opl3 **ropl3)
343{ 343{
344 static snd_device_ops_t ops = { 344 static struct snd_device_ops ops = {
345 .dev_free = snd_opl3_dev_free, 345 .dev_free = snd_opl3_dev_free,
346 }; 346 };
347 opl3_t *opl3; 347 struct snd_opl3 *opl3;
348 int err; 348 int err;
349 349
350 *ropl3 = NULL; 350 *ropl3 = NULL;
351 opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL); 351 opl3 = kzalloc(sizeof(*opl3), GFP_KERNEL);
352 if (opl3 == NULL) 352 if (opl3 == NULL) {
353 snd_printk(KERN_ERR "opl3: cannot allocate\n");
353 return -ENOMEM; 354 return -ENOMEM;
355 }
354 356
355 opl3->card = card; 357 opl3->card = card;
356 opl3->hardware = hardware; 358 opl3->hardware = hardware;
@@ -367,7 +369,7 @@ int snd_opl3_new(snd_card_t *card,
367 return 0; 369 return 0;
368} 370}
369 371
370int snd_opl3_init(opl3_t *opl3) 372int snd_opl3_init(struct snd_opl3 *opl3)
371{ 373{
372 if (! opl3->command) { 374 if (! opl3->command) {
373 printk(KERN_ERR "snd_opl3_init: command not defined!\n"); 375 printk(KERN_ERR "snd_opl3_init: command not defined!\n");
@@ -391,14 +393,14 @@ int snd_opl3_init(opl3_t *opl3)
391 return 0; 393 return 0;
392} 394}
393 395
394int snd_opl3_create(snd_card_t * card, 396int snd_opl3_create(struct snd_card *card,
395 unsigned long l_port, 397 unsigned long l_port,
396 unsigned long r_port, 398 unsigned long r_port,
397 unsigned short hardware, 399 unsigned short hardware,
398 int integrated, 400 int integrated,
399 opl3_t ** ropl3) 401 struct snd_opl3 ** ropl3)
400{ 402{
401 opl3_t *opl3; 403 struct snd_opl3 *opl3;
402 int err; 404 int err;
403 405
404 *ropl3 = NULL; 406 *ropl3 = NULL;
@@ -407,13 +409,13 @@ int snd_opl3_create(snd_card_t * card,
407 if (! integrated) { 409 if (! integrated) {
408 if ((opl3->res_l_port = request_region(l_port, 2, "OPL2/3 (left)")) == NULL) { 410 if ((opl3->res_l_port = request_region(l_port, 2, "OPL2/3 (left)")) == NULL) {
409 snd_printk(KERN_ERR "opl3: can't grab left port 0x%lx\n", l_port); 411 snd_printk(KERN_ERR "opl3: can't grab left port 0x%lx\n", l_port);
410 snd_opl3_free(opl3); 412 snd_device_free(card, opl3);
411 return -EBUSY; 413 return -EBUSY;
412 } 414 }
413 if (r_port != 0 && 415 if (r_port != 0 &&
414 (opl3->res_r_port = request_region(r_port, 2, "OPL2/3 (right)")) == NULL) { 416 (opl3->res_r_port = request_region(r_port, 2, "OPL2/3 (right)")) == NULL) {
415 snd_printk(KERN_ERR "opl3: can't grab right port 0x%lx\n", r_port); 417 snd_printk(KERN_ERR "opl3: can't grab right port 0x%lx\n", r_port);
416 snd_opl3_free(opl3); 418 snd_device_free(card, opl3);
417 return -EBUSY; 419 return -EBUSY;
418 } 420 }
419 } 421 }
@@ -432,7 +434,7 @@ int snd_opl3_create(snd_card_t * card,
432 if ((err = snd_opl3_detect(opl3)) < 0) { 434 if ((err = snd_opl3_detect(opl3)) < 0) {
433 snd_printd("OPL2/3 chip not detected at 0x%lx/0x%lx\n", 435 snd_printd("OPL2/3 chip not detected at 0x%lx/0x%lx\n",
434 opl3->l_port, opl3->r_port); 436 opl3->l_port, opl3->r_port);
435 snd_opl3_free(opl3); 437 snd_device_free(card, opl3);
436 return err; 438 return err;
437 } 439 }
438 /* detect routine returns correct hardware type */ 440 /* detect routine returns correct hardware type */
@@ -449,7 +451,7 @@ int snd_opl3_create(snd_card_t * card,
449 return 0; 451 return 0;
450} 452}
451 453
452int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev) 454int snd_opl3_timer_new(struct snd_opl3 * opl3, int timer1_dev, int timer2_dev)
453{ 455{
454 int err; 456 int err;
455 457
@@ -466,12 +468,12 @@ int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev)
466 return 0; 468 return 0;
467} 469}
468 470
469int snd_opl3_hwdep_new(opl3_t * opl3, 471int snd_opl3_hwdep_new(struct snd_opl3 * opl3,
470 int device, int seq_device, 472 int device, int seq_device,
471 snd_hwdep_t ** rhwdep) 473 struct snd_hwdep ** rhwdep)
472{ 474{
473 snd_hwdep_t *hw; 475 struct snd_hwdep *hw;
474 snd_card_t *card = opl3->card; 476 struct snd_card *card = opl3->card;
475 int err; 477 int err;
476 478
477 if (rhwdep) 479 if (rhwdep)
@@ -514,9 +516,9 @@ int snd_opl3_hwdep_new(opl3_t * opl3,
514 opl3->seq_dev_num = seq_device; 516 opl3->seq_dev_num = seq_device;
515#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) 517#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
516 if (snd_seq_device_new(card, seq_device, SNDRV_SEQ_DEV_ID_OPL3, 518 if (snd_seq_device_new(card, seq_device, SNDRV_SEQ_DEV_ID_OPL3,
517 sizeof(opl3_t*), &opl3->seq_dev) >= 0) { 519 sizeof(struct snd_opl3 *), &opl3->seq_dev) >= 0) {
518 strcpy(opl3->seq_dev->name, hw->name); 520 strcpy(opl3->seq_dev->name, hw->name);
519 *(opl3_t**)SNDRV_SEQ_DEVICE_ARGPTR(opl3->seq_dev) = opl3; 521 *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(opl3->seq_dev) = opl3;
520 } 522 }
521#endif 523#endif
522 if (rhwdep) 524 if (rhwdep)
diff --git a/sound/drivers/opl3/opl3_midi.c b/sound/drivers/opl3/opl3_midi.c
index 93d674070b71..1b6f227af370 100644
--- a/sound/drivers/opl3/opl3_midi.c
+++ b/sound/drivers/opl3/opl3_midi.c
@@ -60,7 +60,7 @@ static char opl3_volume_table[128] =
60}; 60};
61 61
62void snd_opl3_calc_volume(unsigned char *volbyte, int vel, 62void snd_opl3_calc_volume(unsigned char *volbyte, int vel,
63 snd_midi_channel_t *chan) 63 struct snd_midi_channel *chan)
64{ 64{
65 int oldvol, newvol, n; 65 int oldvol, newvol, n;
66 int volume; 66 int volume;
@@ -93,7 +93,7 @@ static short opl3_note_table[16] =
93}; 93};
94 94
95static void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum, 95static void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum,
96 int note, snd_midi_channel_t *chan) 96 int note, struct snd_midi_channel *chan)
97{ 97{
98 int block = ((note / 12) & 0x07) - 1; 98 int block = ((note / 12) & 0x07) - 1;
99 int idx = (note % 12) + 2; 99 int idx = (note % 12) + 2;
@@ -121,7 +121,7 @@ static void snd_opl3_calc_pitch(unsigned char *fnum, unsigned char *blocknum,
121 121
122 122
123#ifdef DEBUG_ALLOC 123#ifdef DEBUG_ALLOC
124static void debug_alloc(opl3_t *opl3, char *s, int voice) { 124static void debug_alloc(struct snd_opl3 *opl3, char *s, int voice) {
125 int i; 125 int i;
126 char *str = "x.24"; 126 char *str = "x.24";
127 127
@@ -135,12 +135,12 @@ static void debug_alloc(opl3_t *opl3, char *s, int voice) {
135/* 135/*
136 * Get a FM voice (channel) to play a note on. 136 * Get a FM voice (channel) to play a note on.
137 */ 137 */
138static int opl3_get_voice(opl3_t *opl3, int instr_4op, 138static int opl3_get_voice(struct snd_opl3 *opl3, int instr_4op,
139 snd_midi_channel_t *chan) { 139 struct snd_midi_channel *chan) {
140 int chan_4op_1; /* first voice for 4op instrument */ 140 int chan_4op_1; /* first voice for 4op instrument */
141 int chan_4op_2; /* second voice for 4op instrument */ 141 int chan_4op_2; /* second voice for 4op instrument */
142 142
143 snd_opl3_voice_t *vp, *vp2; 143 struct snd_opl3_voice *vp, *vp2;
144 unsigned int voice_time; 144 unsigned int voice_time;
145 int i; 145 int i;
146 146
@@ -237,13 +237,14 @@ static int opl3_get_voice(opl3_t *opl3, int instr_4op,
237void snd_opl3_timer_func(unsigned long data) 237void snd_opl3_timer_func(unsigned long data)
238{ 238{
239 239
240 opl3_t *opl3 = (opl3_t *)data; 240 struct snd_opl3 *opl3 = (struct snd_opl3 *)data;
241 unsigned long flags;
241 int again = 0; 242 int again = 0;
242 int i; 243 int i;
243 244
244 spin_lock(&opl3->sys_timer_lock); 245 spin_lock_irqsave(&opl3->sys_timer_lock, flags);
245 for (i = 0; i < opl3->max_voices; i++) { 246 for (i = 0; i < opl3->max_voices; i++) {
246 snd_opl3_voice_t *vp = &opl3->voices[i]; 247 struct snd_opl3_voice *vp = &opl3->voices[i];
247 if (vp->state > 0 && vp->note_off_check) { 248 if (vp->state > 0 && vp->note_off_check) {
248 if (vp->note_off == jiffies) 249 if (vp->note_off == jiffies)
249 snd_opl3_note_off(opl3, vp->note, 0, vp->chan); 250 snd_opl3_note_off(opl3, vp->note, 0, vp->chan);
@@ -257,13 +258,13 @@ void snd_opl3_timer_func(unsigned long data)
257 } else { 258 } else {
258 opl3->sys_timer_status = 0; 259 opl3->sys_timer_status = 0;
259 } 260 }
260 spin_unlock(&opl3->sys_timer_lock); 261 spin_unlock_irqrestore(&opl3->sys_timer_lock, flags);
261} 262}
262 263
263/* 264/*
264 * Start system timer 265 * Start system timer
265 */ 266 */
266static void snd_opl3_start_timer(opl3_t *opl3) 267static void snd_opl3_start_timer(struct snd_opl3 *opl3)
267{ 268{
268 unsigned long flags; 269 unsigned long flags;
269 spin_lock_irqsave(&opl3->sys_timer_lock, flags); 270 spin_lock_irqsave(&opl3->sys_timer_lock, flags);
@@ -285,15 +286,15 @@ static int snd_opl3_oss_map[MAX_OPL3_VOICES] = {
285/* 286/*
286 * Start a note. 287 * Start a note.
287 */ 288 */
288void snd_opl3_note_on(void *p, int note, int vel, snd_midi_channel_t *chan) 289void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan)
289{ 290{
290 opl3_t *opl3; 291 struct snd_opl3 *opl3;
291 snd_seq_instr_t wanted; 292 struct snd_seq_instr wanted;
292 snd_seq_kinstr_t *kinstr; 293 struct snd_seq_kinstr *kinstr;
293 int instr_4op; 294 int instr_4op;
294 295
295 int voice; 296 int voice;
296 snd_opl3_voice_t *vp, *vp2; 297 struct snd_opl3_voice *vp, *vp2;
297 unsigned short connect_mask; 298 unsigned short connect_mask;
298 unsigned char connection; 299 unsigned char connection;
299 unsigned char vol_op[4]; 300 unsigned char vol_op[4];
@@ -310,7 +311,7 @@ void snd_opl3_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
310 unsigned char fnum, blocknum; 311 unsigned char fnum, blocknum;
311 int i; 312 int i;
312 313
313 fm_instrument_t *fm; 314 struct fm_instrument *fm;
314 unsigned long flags; 315 unsigned long flags;
315 316
316 opl3 = p; 317 opl3 = p;
@@ -615,13 +616,13 @@ void snd_opl3_note_on(void *p, int note, int vel, snd_midi_channel_t *chan)
615 spin_unlock_irqrestore(&opl3->voice_lock, flags); 616 spin_unlock_irqrestore(&opl3->voice_lock, flags);
616} 617}
617 618
618static void snd_opl3_kill_voice(opl3_t *opl3, int voice) 619static void snd_opl3_kill_voice(struct snd_opl3 *opl3, int voice)
619{ 620{
620 unsigned short reg_side; 621 unsigned short reg_side;
621 unsigned char voice_offset; 622 unsigned char voice_offset;
622 unsigned short opl3_reg; 623 unsigned short opl3_reg;
623 624
624 snd_opl3_voice_t *vp, *vp2; 625 struct snd_opl3_voice *vp, *vp2;
625 626
626 snd_assert(voice < MAX_OPL3_VOICES, return); 627 snd_assert(voice < MAX_OPL3_VOICES, return);
627 628
@@ -663,12 +664,12 @@ static void snd_opl3_kill_voice(opl3_t *opl3, int voice)
663/* 664/*
664 * Release a note in response to a midi note off. 665 * Release a note in response to a midi note off.
665 */ 666 */
666void snd_opl3_note_off(void *p, int note, int vel, snd_midi_channel_t *chan) 667void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan)
667{ 668{
668 opl3_t *opl3; 669 struct snd_opl3 *opl3;
669 670
670 int voice; 671 int voice;
671 snd_opl3_voice_t *vp; 672 struct snd_opl3_voice *vp;
672 673
673 unsigned long flags; 674 unsigned long flags;
674 675
@@ -708,9 +709,9 @@ void snd_opl3_note_off(void *p, int note, int vel, snd_midi_channel_t *chan)
708/* 709/*
709 * key pressure change 710 * key pressure change
710 */ 711 */
711void snd_opl3_key_press(void *p, int note, int vel, snd_midi_channel_t *chan) 712void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan)
712{ 713{
713 opl3_t *opl3; 714 struct snd_opl3 *opl3;
714 715
715 opl3 = p; 716 opl3 = p;
716#ifdef DEBUG_MIDI 717#ifdef DEBUG_MIDI
@@ -722,9 +723,9 @@ void snd_opl3_key_press(void *p, int note, int vel, snd_midi_channel_t *chan)
722/* 723/*
723 * terminate note 724 * terminate note
724 */ 725 */
725void snd_opl3_terminate_note(void *p, int note, snd_midi_channel_t *chan) 726void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan)
726{ 727{
727 opl3_t *opl3; 728 struct snd_opl3 *opl3;
728 729
729 opl3 = p; 730 opl3 = p;
730#ifdef DEBUG_MIDI 731#ifdef DEBUG_MIDI
@@ -733,7 +734,7 @@ void snd_opl3_terminate_note(void *p, int note, snd_midi_channel_t *chan)
733#endif 734#endif
734} 735}
735 736
736static void snd_opl3_update_pitch(opl3_t *opl3, int voice) 737static void snd_opl3_update_pitch(struct snd_opl3 *opl3, int voice)
737{ 738{
738 unsigned short reg_side; 739 unsigned short reg_side;
739 unsigned char voice_offset; 740 unsigned char voice_offset;
@@ -741,7 +742,7 @@ static void snd_opl3_update_pitch(opl3_t *opl3, int voice)
741 742
742 unsigned char fnum, blocknum; 743 unsigned char fnum, blocknum;
743 744
744 snd_opl3_voice_t *vp; 745 struct snd_opl3_voice *vp;
745 746
746 snd_assert(voice < MAX_OPL3_VOICES, return); 747 snd_assert(voice < MAX_OPL3_VOICES, return);
747 748
@@ -780,10 +781,10 @@ static void snd_opl3_update_pitch(opl3_t *opl3, int voice)
780/* 781/*
781 * Update voice pitch controller 782 * Update voice pitch controller
782 */ 783 */
783static void snd_opl3_pitch_ctrl(opl3_t *opl3, snd_midi_channel_t *chan) 784static void snd_opl3_pitch_ctrl(struct snd_opl3 *opl3, struct snd_midi_channel *chan)
784{ 785{
785 int voice; 786 int voice;
786 snd_opl3_voice_t *vp; 787 struct snd_opl3_voice *vp;
787 788
788 unsigned long flags; 789 unsigned long flags;
789 790
@@ -810,9 +811,9 @@ static void snd_opl3_pitch_ctrl(opl3_t *opl3, snd_midi_channel_t *chan)
810 * Deal with a controler type event. This includes all types of 811 * Deal with a controler type event. This includes all types of
811 * control events, not just the midi controllers 812 * control events, not just the midi controllers
812 */ 813 */
813void snd_opl3_control(void *p, int type, snd_midi_channel_t *chan) 814void snd_opl3_control(void *p, int type, struct snd_midi_channel *chan)
814{ 815{
815 opl3_t *opl3; 816 struct snd_opl3 *opl3;
816 817
817 opl3 = p; 818 opl3 = p;
818#ifdef DEBUG_MIDI 819#ifdef DEBUG_MIDI
@@ -846,10 +847,10 @@ void snd_opl3_control(void *p, int type, snd_midi_channel_t *chan)
846/* 847/*
847 * NRPN events 848 * NRPN events
848 */ 849 */
849void snd_opl3_nrpn(void *p, snd_midi_channel_t *chan, 850void snd_opl3_nrpn(void *p, struct snd_midi_channel *chan,
850 snd_midi_channel_set_t *chset) 851 struct snd_midi_channel_set *chset)
851{ 852{
852 opl3_t *opl3; 853 struct snd_opl3 *opl3;
853 854
854 opl3 = p; 855 opl3 = p;
855#ifdef DEBUG_MIDI 856#ifdef DEBUG_MIDI
@@ -862,9 +863,9 @@ void snd_opl3_nrpn(void *p, snd_midi_channel_t *chan,
862 * receive sysex 863 * receive sysex
863 */ 864 */
864void snd_opl3_sysex(void *p, unsigned char *buf, int len, 865void snd_opl3_sysex(void *p, unsigned char *buf, int len,
865 int parsed, snd_midi_channel_set_t *chset) 866 int parsed, struct snd_midi_channel_set *chset)
866{ 867{
867 opl3_t *opl3; 868 struct snd_opl3 *opl3;
868 869
869 opl3 = p; 870 opl3 = p;
870#ifdef DEBUG_MIDI 871#ifdef DEBUG_MIDI
diff --git a/sound/drivers/opl3/opl3_oss.c b/sound/drivers/opl3/opl3_oss.c
index 21a2b409d6d3..31f1f2e25aa0 100644
--- a/sound/drivers/opl3/opl3_oss.c
+++ b/sound/drivers/opl3/opl3_oss.c
@@ -21,11 +21,11 @@
21#include "opl3_voice.h" 21#include "opl3_voice.h"
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure); 24static int snd_opl3_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure);
25static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg); 25static int snd_opl3_close_seq_oss(struct snd_seq_oss_arg *arg);
26static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, unsigned long ioarg); 26static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd, unsigned long ioarg);
27static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, const char __user *buf, int offs, int count); 27static int snd_opl3_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format, const char __user *buf, int offs, int count);
28static int snd_opl3_reset_seq_oss(snd_seq_oss_arg_t *arg); 28static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg);
29 29
30/* */ 30/* */
31 31
@@ -43,9 +43,9 @@ static inline void snd_leave_user(mm_segment_t fs)
43 43
44/* operators */ 44/* operators */
45 45
46extern snd_midi_op_t opl3_ops; 46extern struct snd_midi_op opl3_ops;
47 47
48static snd_seq_oss_callback_t oss_callback = { 48static struct snd_seq_oss_callback oss_callback = {
49 .owner = THIS_MODULE, 49 .owner = THIS_MODULE,
50 .open = snd_opl3_open_seq_oss, 50 .open = snd_opl3_open_seq_oss,
51 .close = snd_opl3_close_seq_oss, 51 .close = snd_opl3_close_seq_oss,
@@ -54,10 +54,10 @@ static snd_seq_oss_callback_t oss_callback = {
54 .reset = snd_opl3_reset_seq_oss, 54 .reset = snd_opl3_reset_seq_oss,
55}; 55};
56 56
57static int snd_opl3_oss_event_input(snd_seq_event_t *ev, int direct, 57static int snd_opl3_oss_event_input(struct snd_seq_event *ev, int direct,
58 void *private_data, int atomic, int hop) 58 void *private_data, int atomic, int hop)
59{ 59{
60 opl3_t *opl3 = private_data; 60 struct snd_opl3 *opl3 = private_data;
61 61
62 if (ev->type != SNDRV_SEQ_EVENT_OSS) 62 if (ev->type != SNDRV_SEQ_EVENT_OSS)
63 snd_midi_process_event(&opl3_ops, ev, opl3->oss_chset); 63 snd_midi_process_event(&opl3_ops, ev, opl3->oss_chset);
@@ -68,14 +68,14 @@ static int snd_opl3_oss_event_input(snd_seq_event_t *ev, int direct,
68 68
69static void snd_opl3_oss_free_port(void *private_data) 69static void snd_opl3_oss_free_port(void *private_data)
70{ 70{
71 opl3_t *opl3 = private_data; 71 struct snd_opl3 *opl3 = private_data;
72 72
73 snd_midi_channel_free_set(opl3->oss_chset); 73 snd_midi_channel_free_set(opl3->oss_chset);
74} 74}
75 75
76static int snd_opl3_oss_create_port(opl3_t * opl3) 76static int snd_opl3_oss_create_port(struct snd_opl3 * opl3)
77{ 77{
78 snd_seq_port_callback_t callbacks; 78 struct snd_seq_port_callback callbacks;
79 char name[32]; 79 char name[32];
80 int voices, opl_ver; 80 int voices, opl_ver;
81 81
@@ -113,13 +113,13 @@ static int snd_opl3_oss_create_port(opl3_t * opl3)
113/* ------------------------------ */ 113/* ------------------------------ */
114 114
115/* register OSS synth */ 115/* register OSS synth */
116void snd_opl3_init_seq_oss(opl3_t *opl3, char *name) 116void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name)
117{ 117{
118 snd_seq_oss_reg_t *arg; 118 struct snd_seq_oss_reg *arg;
119 snd_seq_device_t *dev; 119 struct snd_seq_device *dev;
120 120
121 if (snd_seq_device_new(opl3->card, 0, SNDRV_SEQ_DEV_ID_OSS, 121 if (snd_seq_device_new(opl3->card, 0, SNDRV_SEQ_DEV_ID_OSS,
122 sizeof(snd_seq_oss_reg_t), &dev) < 0) 122 sizeof(struct snd_seq_oss_reg), &dev) < 0)
123 return; 123 return;
124 124
125 opl3->oss_seq_dev = dev; 125 opl3->oss_seq_dev = dev;
@@ -143,7 +143,7 @@ void snd_opl3_init_seq_oss(opl3_t *opl3, char *name)
143} 143}
144 144
145/* unregister */ 145/* unregister */
146void snd_opl3_free_seq_oss(opl3_t *opl3) 146void snd_opl3_free_seq_oss(struct snd_opl3 *opl3)
147{ 147{
148 if (opl3->oss_seq_dev) { 148 if (opl3->oss_seq_dev) {
149 snd_device_free(opl3->card, opl3->oss_seq_dev); 149 snd_device_free(opl3->card, opl3->oss_seq_dev);
@@ -154,9 +154,9 @@ void snd_opl3_free_seq_oss(opl3_t *opl3)
154/* ------------------------------ */ 154/* ------------------------------ */
155 155
156/* open OSS sequencer */ 156/* open OSS sequencer */
157static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure) 157static int snd_opl3_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
158{ 158{
159 opl3_t *opl3 = closure; 159 struct snd_opl3 *opl3 = closure;
160 int err; 160 int err;
161 161
162 snd_assert(arg != NULL, return -ENXIO); 162 snd_assert(arg != NULL, return -ENXIO);
@@ -177,9 +177,9 @@ static int snd_opl3_open_seq_oss(snd_seq_oss_arg_t *arg, void *closure)
177} 177}
178 178
179/* close OSS sequencer */ 179/* close OSS sequencer */
180static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg) 180static int snd_opl3_close_seq_oss(struct snd_seq_oss_arg *arg)
181{ 181{
182 opl3_t *opl3; 182 struct snd_opl3 *opl3;
183 183
184 snd_assert(arg != NULL, return -ENXIO); 184 snd_assert(arg != NULL, return -ENXIO);
185 opl3 = arg->private_data; 185 opl3 = arg->private_data;
@@ -206,10 +206,10 @@ static int snd_opl3_close_seq_oss(snd_seq_oss_arg_t *arg)
206/* from sound_config.h */ 206/* from sound_config.h */
207#define SBFM_MAXINSTR 256 207#define SBFM_MAXINSTR 256
208 208
209static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format, 209static int snd_opl3_load_patch_seq_oss(struct snd_seq_oss_arg *arg, int format,
210 const char __user *buf, int offs, int count) 210 const char __user *buf, int offs, int count)
211{ 211{
212 opl3_t *opl3; 212 struct snd_opl3 *opl3;
213 int err = -EINVAL; 213 int err = -EINVAL;
214 214
215 snd_assert(arg != NULL, return -ENXIO); 215 snd_assert(arg != NULL, return -ENXIO);
@@ -219,11 +219,11 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
219 struct sbi_instrument sbi; 219 struct sbi_instrument sbi;
220 220
221 size_t size; 221 size_t size;
222 snd_seq_instr_header_t *put; 222 struct snd_seq_instr_header *put;
223 snd_seq_instr_data_t *data; 223 struct snd_seq_instr_data *data;
224 fm_xinstrument_t *xinstr; 224 struct fm_xinstrument *xinstr;
225 225
226 snd_seq_event_t ev; 226 struct snd_seq_event ev;
227 int i; 227 int i;
228 228
229 mm_segment_t fs; 229 mm_segment_t fs;
@@ -240,7 +240,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
240 return -EINVAL; 240 return -EINVAL;
241 } 241 }
242 242
243 size = sizeof(*put) + sizeof(fm_xinstrument_t); 243 size = sizeof(*put) + sizeof(struct fm_xinstrument);
244 put = kzalloc(size, GFP_KERNEL); 244 put = kzalloc(size, GFP_KERNEL);
245 if (put == NULL) 245 if (put == NULL)
246 return -ENOMEM; 246 return -ENOMEM;
@@ -249,7 +249,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
249 data->type = SNDRV_SEQ_INSTR_ATYPE_DATA; 249 data->type = SNDRV_SEQ_INSTR_ATYPE_DATA;
250 strcpy(data->data.format, SNDRV_SEQ_INSTR_ID_OPL2_3); 250 strcpy(data->data.format, SNDRV_SEQ_INSTR_ID_OPL2_3);
251 /* build data section */ 251 /* build data section */
252 xinstr = (fm_xinstrument_t *)(data + 1); 252 xinstr = (struct fm_xinstrument *)(data + 1);
253 xinstr->stype = FM_STRU_INSTR; 253 xinstr->stype = FM_STRU_INSTR;
254 254
255 for (i = 0; i < 2; i++) { 255 for (i = 0; i < 2; i++) {
@@ -296,7 +296,7 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
296 err = snd_seq_instr_event(&opl3->fm_ops, opl3->ilist, &ev, 296 err = snd_seq_instr_event(&opl3->fm_ops, opl3->ilist, &ev,
297 opl3->seq_client, 0, 0); 297 opl3->seq_client, 0, 0);
298 if (err == -EBUSY) { 298 if (err == -EBUSY) {
299 snd_seq_instr_header_t remove; 299 struct snd_seq_instr_header remove;
300 300
301 memset (&remove, 0, sizeof(remove)); 301 memset (&remove, 0, sizeof(remove));
302 remove.cmd = SNDRV_SEQ_INSTR_FREE_CMD_SINGLE; 302 remove.cmd = SNDRV_SEQ_INSTR_FREE_CMD_SINGLE;
@@ -319,10 +319,10 @@ static int snd_opl3_load_patch_seq_oss(snd_seq_oss_arg_t *arg, int format,
319} 319}
320 320
321/* ioctl */ 321/* ioctl */
322static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd, 322static int snd_opl3_ioctl_seq_oss(struct snd_seq_oss_arg *arg, unsigned int cmd,
323 unsigned long ioarg) 323 unsigned long ioarg)
324{ 324{
325 opl3_t *opl3; 325 struct snd_opl3 *opl3;
326 326
327 snd_assert(arg != NULL, return -ENXIO); 327 snd_assert(arg != NULL, return -ENXIO);
328 opl3 = arg->private_data; 328 opl3 = arg->private_data;
@@ -345,9 +345,9 @@ static int snd_opl3_ioctl_seq_oss(snd_seq_oss_arg_t *arg, unsigned int cmd,
345} 345}
346 346
347/* reset device */ 347/* reset device */
348static int snd_opl3_reset_seq_oss(snd_seq_oss_arg_t *arg) 348static int snd_opl3_reset_seq_oss(struct snd_seq_oss_arg *arg)
349{ 349{
350 opl3_t *opl3; 350 struct snd_opl3 *opl3;
351 351
352 snd_assert(arg != NULL, return -ENXIO); 352 snd_assert(arg != NULL, return -ENXIO);
353 opl3 = arg->private_data; 353 opl3 = arg->private_data;
diff --git a/sound/drivers/opl3/opl3_seq.c b/sound/drivers/opl3/opl3_seq.c
index 136964b844de..c4ead790008a 100644
--- a/sound/drivers/opl3/opl3_seq.c
+++ b/sound/drivers/opl3/opl3_seq.c
@@ -35,7 +35,7 @@ int use_internal_drums = 0;
35module_param(use_internal_drums, bool, 0444); 35module_param(use_internal_drums, bool, 0444);
36MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums."); 36MODULE_PARM_DESC(use_internal_drums, "Enable internal OPL2/3 drums.");
37 37
38int snd_opl3_synth_use_inc(opl3_t * opl3) 38int snd_opl3_synth_use_inc(struct snd_opl3 * opl3)
39{ 39{
40 if (!try_module_get(opl3->card->module)) 40 if (!try_module_get(opl3->card->module))
41 return -EFAULT; 41 return -EFAULT;
@@ -43,12 +43,12 @@ int snd_opl3_synth_use_inc(opl3_t * opl3)
43 43
44} 44}
45 45
46void snd_opl3_synth_use_dec(opl3_t * opl3) 46void snd_opl3_synth_use_dec(struct snd_opl3 * opl3)
47{ 47{
48 module_put(opl3->card->module); 48 module_put(opl3->card->module);
49} 49}
50 50
51int snd_opl3_synth_setup(opl3_t * opl3) 51int snd_opl3_synth_setup(struct snd_opl3 * opl3)
52{ 52{
53 int idx; 53 int idx;
54 54
@@ -78,7 +78,7 @@ int snd_opl3_synth_setup(opl3_t * opl3)
78 return 0; 78 return 0;
79} 79}
80 80
81void snd_opl3_synth_cleanup(opl3_t * opl3) 81void snd_opl3_synth_cleanup(struct snd_opl3 * opl3)
82{ 82{
83 unsigned long flags; 83 unsigned long flags;
84 84
@@ -96,9 +96,9 @@ void snd_opl3_synth_cleanup(opl3_t * opl3)
96 up(&opl3->access_mutex); 96 up(&opl3->access_mutex);
97} 97}
98 98
99static int snd_opl3_synth_use(void *private_data, snd_seq_port_subscribe_t * info) 99static int snd_opl3_synth_use(void *private_data, struct snd_seq_port_subscribe * info)
100{ 100{
101 opl3_t *opl3 = private_data; 101 struct snd_opl3 *opl3 = private_data;
102 int err; 102 int err;
103 103
104 if ((err = snd_opl3_synth_setup(opl3)) < 0) 104 if ((err = snd_opl3_synth_setup(opl3)) < 0)
@@ -123,9 +123,9 @@ static int snd_opl3_synth_use(void *private_data, snd_seq_port_subscribe_t * inf
123 return 0; 123 return 0;
124} 124}
125 125
126static int snd_opl3_synth_unuse(void *private_data, snd_seq_port_subscribe_t * info) 126static int snd_opl3_synth_unuse(void *private_data, struct snd_seq_port_subscribe * info)
127{ 127{
128 opl3_t *opl3 = private_data; 128 struct snd_opl3 *opl3 = private_data;
129 129
130 snd_opl3_synth_cleanup(opl3); 130 snd_opl3_synth_cleanup(opl3);
131 131
@@ -137,7 +137,7 @@ static int snd_opl3_synth_unuse(void *private_data, snd_seq_port_subscribe_t * i
137/* 137/*
138 * MIDI emulation operators 138 * MIDI emulation operators
139 */ 139 */
140snd_midi_op_t opl3_ops = { 140struct snd_midi_op opl3_ops = {
141 .note_on = snd_opl3_note_on, 141 .note_on = snd_opl3_note_on,
142 .note_off = snd_opl3_note_off, 142 .note_off = snd_opl3_note_off,
143 .key_press = snd_opl3_key_press, 143 .key_press = snd_opl3_key_press,
@@ -147,10 +147,10 @@ snd_midi_op_t opl3_ops = {
147 .sysex = snd_opl3_sysex, 147 .sysex = snd_opl3_sysex,
148}; 148};
149 149
150static int snd_opl3_synth_event_input(snd_seq_event_t * ev, int direct, 150static int snd_opl3_synth_event_input(struct snd_seq_event * ev, int direct,
151 void *private_data, int atomic, int hop) 151 void *private_data, int atomic, int hop)
152{ 152{
153 opl3_t *opl3 = private_data; 153 struct snd_opl3 *opl3 = private_data;
154 154
155 if (ev->type >= SNDRV_SEQ_EVENT_INSTR_BEGIN && 155 if (ev->type >= SNDRV_SEQ_EVENT_INSTR_BEGIN &&
156 ev->type <= SNDRV_SEQ_EVENT_INSTR_CHANGE) { 156 ev->type <= SNDRV_SEQ_EVENT_INSTR_CHANGE) {
@@ -168,14 +168,14 @@ static int snd_opl3_synth_event_input(snd_seq_event_t * ev, int direct,
168 168
169static void snd_opl3_synth_free_port(void *private_data) 169static void snd_opl3_synth_free_port(void *private_data)
170{ 170{
171 opl3_t *opl3 = private_data; 171 struct snd_opl3 *opl3 = private_data;
172 172
173 snd_midi_channel_free_set(opl3->chset); 173 snd_midi_channel_free_set(opl3->chset);
174} 174}
175 175
176static int snd_opl3_synth_create_port(opl3_t * opl3) 176static int snd_opl3_synth_create_port(struct snd_opl3 * opl3)
177{ 177{
178 snd_seq_port_callback_t callbacks; 178 struct snd_seq_port_callback callbacks;
179 char name[32]; 179 char name[32];
180 int voices, opl_ver; 180 int voices, opl_ver;
181 181
@@ -215,15 +215,14 @@ static int snd_opl3_synth_create_port(opl3_t * opl3)
215 215
216/* ------------------------------ */ 216/* ------------------------------ */
217 217
218static int snd_opl3_seq_new_device(snd_seq_device_t *dev) 218static int snd_opl3_seq_new_device(struct snd_seq_device *dev)
219{ 219{
220 opl3_t *opl3; 220 struct snd_opl3 *opl3;
221 int client; 221 int client;
222 snd_seq_client_callback_t callbacks; 222 char name[32];
223 snd_seq_client_info_t cinfo;
224 int opl_ver; 223 int opl_ver;
225 224
226 opl3 = *(opl3_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 225 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
227 if (opl3 == NULL) 226 if (opl3 == NULL)
228 return -EINVAL; 227 return -EINVAL;
229 228
@@ -232,22 +231,14 @@ static int snd_opl3_seq_new_device(snd_seq_device_t *dev)
232 opl3->seq_client = -1; 231 opl3->seq_client = -1;
233 232
234 /* allocate new client */ 233 /* allocate new client */
235 memset(&callbacks, 0, sizeof(callbacks)); 234 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
236 callbacks.private_data = opl3; 235 sprintf(name, "OPL%i FM synth", opl_ver);
237 callbacks.allow_output = callbacks.allow_input = 1;
238 client = opl3->seq_client = 236 client = opl3->seq_client =
239 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num, &callbacks); 237 snd_seq_create_kernel_client(opl3->card, opl3->seq_dev_num,
238 name);
240 if (client < 0) 239 if (client < 0)
241 return client; 240 return client;
242 241
243 /* change name of client */
244 memset(&cinfo, 0, sizeof(cinfo));
245 cinfo.client = client;
246 cinfo.type = KERNEL_CLIENT;
247 opl_ver = (opl3->hardware & OPL3_HW_MASK) >> 8;
248 sprintf(cinfo.name, "OPL%i FM synth", opl_ver);
249 snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
250
251 snd_opl3_synth_create_port(opl3); 242 snd_opl3_synth_create_port(opl3);
252 243
253 /* initialize instrument list */ 244 /* initialize instrument list */
@@ -268,16 +259,16 @@ static int snd_opl3_seq_new_device(snd_seq_device_t *dev)
268 opl3->sys_timer_status = 0; 259 opl3->sys_timer_status = 0;
269 260
270#ifdef CONFIG_SND_SEQUENCER_OSS 261#ifdef CONFIG_SND_SEQUENCER_OSS
271 snd_opl3_init_seq_oss(opl3, cinfo.name); 262 snd_opl3_init_seq_oss(opl3, name);
272#endif 263#endif
273 return 0; 264 return 0;
274} 265}
275 266
276static int snd_opl3_seq_delete_device(snd_seq_device_t *dev) 267static int snd_opl3_seq_delete_device(struct snd_seq_device *dev)
277{ 268{
278 opl3_t *opl3; 269 struct snd_opl3 *opl3;
279 270
280 opl3 = *(opl3_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 271 opl3 = *(struct snd_opl3 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
281 if (opl3 == NULL) 272 if (opl3 == NULL)
282 return -EINVAL; 273 return -EINVAL;
283 274
@@ -295,14 +286,14 @@ static int snd_opl3_seq_delete_device(snd_seq_device_t *dev)
295 286
296static int __init alsa_opl3_seq_init(void) 287static int __init alsa_opl3_seq_init(void)
297{ 288{
298 static snd_seq_dev_ops_t ops = 289 static struct snd_seq_dev_ops ops =
299 { 290 {
300 snd_opl3_seq_new_device, 291 snd_opl3_seq_new_device,
301 snd_opl3_seq_delete_device 292 snd_opl3_seq_delete_device
302 }; 293 };
303 294
304 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL3, &ops, 295 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL3, &ops,
305 sizeof(opl3_t*)); 296 sizeof(struct snd_opl3 *));
306} 297}
307 298
308static void __exit alsa_opl3_seq_exit(void) 299static void __exit alsa_opl3_seq_exit(void)
diff --git a/sound/drivers/opl3/opl3_synth.c b/sound/drivers/opl3/opl3_synth.c
index 04f9f955e5b7..3534a0e3342a 100644
--- a/sound/drivers/opl3/opl3_synth.c
+++ b/sound/drivers/opl3/opl3_synth.c
@@ -61,20 +61,20 @@ char snd_opl3_regmap[MAX_OPL2_VOICES][4] =
61/* 61/*
62 * prototypes 62 * prototypes
63 */ 63 */
64static int snd_opl3_play_note(opl3_t * opl3, snd_dm_fm_note_t * note); 64static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note);
65static int snd_opl3_set_voice(opl3_t * opl3, snd_dm_fm_voice_t * voice); 65static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice);
66static int snd_opl3_set_params(opl3_t * opl3, snd_dm_fm_params_t * params); 66static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params);
67static int snd_opl3_set_mode(opl3_t * opl3, int mode); 67static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode);
68static int snd_opl3_set_connection(opl3_t * opl3, int connection); 68static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection);
69 69
70/* ------------------------------ */ 70/* ------------------------------ */
71 71
72/* 72/*
73 * open the device exclusively 73 * open the device exclusively
74 */ 74 */
75int snd_opl3_open(snd_hwdep_t * hw, struct file *file) 75int snd_opl3_open(struct snd_hwdep * hw, struct file *file)
76{ 76{
77 opl3_t *opl3 = hw->private_data; 77 struct snd_opl3 *opl3 = hw->private_data;
78 78
79 down(&opl3->access_mutex); 79 down(&opl3->access_mutex);
80 if (opl3->used) { 80 if (opl3->used) {
@@ -90,10 +90,10 @@ int snd_opl3_open(snd_hwdep_t * hw, struct file *file)
90/* 90/*
91 * ioctl for hwdep device: 91 * ioctl for hwdep device:
92 */ 92 */
93int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, 93int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
94 unsigned int cmd, unsigned long arg) 94 unsigned int cmd, unsigned long arg)
95{ 95{
96 opl3_t *opl3 = hw->private_data; 96 struct snd_opl3 *opl3 = hw->private_data;
97 void __user *argp = (void __user *)arg; 97 void __user *argp = (void __user *)arg;
98 98
99 snd_assert(opl3 != NULL, return -EINVAL); 99 snd_assert(opl3 != NULL, return -EINVAL);
@@ -102,11 +102,11 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
102 /* get information */ 102 /* get information */
103 case SNDRV_DM_FM_IOCTL_INFO: 103 case SNDRV_DM_FM_IOCTL_INFO:
104 { 104 {
105 snd_dm_fm_info_t info; 105 struct snd_dm_fm_info info;
106 106
107 info.fm_mode = opl3->fm_mode; 107 info.fm_mode = opl3->fm_mode;
108 info.rhythm = opl3->rhythm; 108 info.rhythm = opl3->rhythm;
109 if (copy_to_user(argp, &info, sizeof(snd_dm_fm_info_t))) 109 if (copy_to_user(argp, &info, sizeof(struct snd_dm_fm_info)))
110 return -EFAULT; 110 return -EFAULT;
111 return 0; 111 return 0;
112 } 112 }
@@ -123,8 +123,8 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
123 case SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE: 123 case SNDRV_DM_FM_OSS_IOCTL_PLAY_NOTE:
124#endif 124#endif
125 { 125 {
126 snd_dm_fm_note_t note; 126 struct snd_dm_fm_note note;
127 if (copy_from_user(&note, argp, sizeof(snd_dm_fm_note_t))) 127 if (copy_from_user(&note, argp, sizeof(struct snd_dm_fm_note)))
128 return -EFAULT; 128 return -EFAULT;
129 return snd_opl3_play_note(opl3, &note); 129 return snd_opl3_play_note(opl3, &note);
130 } 130 }
@@ -134,8 +134,8 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
134 case SNDRV_DM_FM_OSS_IOCTL_SET_VOICE: 134 case SNDRV_DM_FM_OSS_IOCTL_SET_VOICE:
135#endif 135#endif
136 { 136 {
137 snd_dm_fm_voice_t voice; 137 struct snd_dm_fm_voice voice;
138 if (copy_from_user(&voice, argp, sizeof(snd_dm_fm_voice_t))) 138 if (copy_from_user(&voice, argp, sizeof(struct snd_dm_fm_voice)))
139 return -EFAULT; 139 return -EFAULT;
140 return snd_opl3_set_voice(opl3, &voice); 140 return snd_opl3_set_voice(opl3, &voice);
141 } 141 }
@@ -145,8 +145,8 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
145 case SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS: 145 case SNDRV_DM_FM_OSS_IOCTL_SET_PARAMS:
146#endif 146#endif
147 { 147 {
148 snd_dm_fm_params_t params; 148 struct snd_dm_fm_params params;
149 if (copy_from_user(&params, argp, sizeof(snd_dm_fm_params_t))) 149 if (copy_from_user(&params, argp, sizeof(struct snd_dm_fm_params)))
150 return -EFAULT; 150 return -EFAULT;
151 return snd_opl3_set_params(opl3, &params); 151 return snd_opl3_set_params(opl3, &params);
152 } 152 }
@@ -174,9 +174,9 @@ int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file,
174/* 174/*
175 * close the device 175 * close the device
176 */ 176 */
177int snd_opl3_release(snd_hwdep_t * hw, struct file *file) 177int snd_opl3_release(struct snd_hwdep * hw, struct file *file)
178{ 178{
179 opl3_t *opl3 = hw->private_data; 179 struct snd_opl3 *opl3 = hw->private_data;
180 180
181 snd_opl3_reset(opl3); 181 snd_opl3_reset(opl3);
182 down(&opl3->access_mutex); 182 down(&opl3->access_mutex);
@@ -188,7 +188,7 @@ int snd_opl3_release(snd_hwdep_t * hw, struct file *file)
188 188
189/* ------------------------------ */ 189/* ------------------------------ */
190 190
191void snd_opl3_reset(opl3_t * opl3) 191void snd_opl3_reset(struct snd_opl3 * opl3)
192{ 192{
193 unsigned short opl3_reg; 193 unsigned short opl3_reg;
194 194
@@ -229,7 +229,7 @@ void snd_opl3_reset(opl3_t * opl3)
229} 229}
230 230
231 231
232static int snd_opl3_play_note(opl3_t * opl3, snd_dm_fm_note_t * note) 232static int snd_opl3_play_note(struct snd_opl3 * opl3, struct snd_dm_fm_note * note)
233{ 233{
234 unsigned short reg_side; 234 unsigned short reg_side;
235 unsigned char voice_offset; 235 unsigned char voice_offset;
@@ -276,7 +276,7 @@ static int snd_opl3_play_note(opl3_t * opl3, snd_dm_fm_note_t * note)
276} 276}
277 277
278 278
279static int snd_opl3_set_voice(opl3_t * opl3, snd_dm_fm_voice_t * voice) 279static int snd_opl3_set_voice(struct snd_opl3 * opl3, struct snd_dm_fm_voice * voice)
280{ 280{
281 unsigned short reg_side; 281 unsigned short reg_side;
282 unsigned char op_offset; 282 unsigned char op_offset;
@@ -378,7 +378,7 @@ static int snd_opl3_set_voice(opl3_t * opl3, snd_dm_fm_voice_t * voice)
378 return 0; 378 return 0;
379} 379}
380 380
381static int snd_opl3_set_params(opl3_t * opl3, snd_dm_fm_params_t * params) 381static int snd_opl3_set_params(struct snd_opl3 * opl3, struct snd_dm_fm_params * params)
382{ 382{
383 unsigned char reg_val; 383 unsigned char reg_val;
384 384
@@ -418,7 +418,7 @@ static int snd_opl3_set_params(opl3_t * opl3, snd_dm_fm_params_t * params)
418 return 0; 418 return 0;
419} 419}
420 420
421static int snd_opl3_set_mode(opl3_t * opl3, int mode) 421static int snd_opl3_set_mode(struct snd_opl3 * opl3, int mode)
422{ 422{
423 if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3)) 423 if ((mode == SNDRV_DM_FM_MODE_OPL3) && (opl3->hardware < OPL3_HW_OPL3))
424 return -EINVAL; 424 return -EINVAL;
@@ -430,7 +430,7 @@ static int snd_opl3_set_mode(opl3_t * opl3, int mode)
430 return 0; 430 return 0;
431} 431}
432 432
433static int snd_opl3_set_connection(opl3_t * opl3, int connection) 433static int snd_opl3_set_connection(struct snd_opl3 * opl3, int connection)
434{ 434{
435 unsigned char reg_val; 435 unsigned char reg_val;
436 436
diff --git a/sound/drivers/opl3/opl3_voice.h b/sound/drivers/opl3/opl3_voice.h
index 63346a5c3498..a371c075ac87 100644
--- a/sound/drivers/opl3/opl3_voice.h
+++ b/sound/drivers/opl3/opl3_voice.h
@@ -22,31 +22,31 @@
22#include <sound/opl3.h> 22#include <sound/opl3.h>
23 23
24/* Prototypes for opl3_seq.c */ 24/* Prototypes for opl3_seq.c */
25int snd_opl3_synth_use_inc(opl3_t * opl3); 25int snd_opl3_synth_use_inc(struct snd_opl3 * opl3);
26void snd_opl3_synth_use_dec(opl3_t * opl3); 26void snd_opl3_synth_use_dec(struct snd_opl3 * opl3);
27int snd_opl3_synth_setup(opl3_t * opl3); 27int snd_opl3_synth_setup(struct snd_opl3 * opl3);
28void snd_opl3_synth_cleanup(opl3_t * opl3); 28void snd_opl3_synth_cleanup(struct snd_opl3 * opl3);
29 29
30/* Prototypes for opl3_midi.c */ 30/* Prototypes for opl3_midi.c */
31void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan); 31void snd_opl3_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
32void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan); 32void snd_opl3_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
33void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan); 33void snd_opl3_key_press(void *p, int note, int vel, struct snd_midi_channel *chan);
34void snd_opl3_terminate_note(void *p, int note, snd_midi_channel_t *chan); 34void snd_opl3_terminate_note(void *p, int note, struct snd_midi_channel *chan);
35void snd_opl3_control(void *p, int type, struct snd_midi_channel *chan); 35void snd_opl3_control(void *p, int type, struct snd_midi_channel *chan);
36void snd_opl3_nrpn(void *p, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); 36void snd_opl3_nrpn(void *p, struct snd_midi_channel *chan, struct snd_midi_channel_set *chset);
37void snd_opl3_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 37void snd_opl3_sysex(void *p, unsigned char *buf, int len, int parsed, struct snd_midi_channel_set *chset);
38 38
39void snd_opl3_calc_volume(unsigned char *reg, int vel, snd_midi_channel_t *chan); 39void snd_opl3_calc_volume(unsigned char *reg, int vel, struct snd_midi_channel *chan);
40void snd_opl3_timer_func(unsigned long data); 40void snd_opl3_timer_func(unsigned long data);
41 41
42/* Prototypes for opl3_drums.c */ 42/* Prototypes for opl3_drums.c */
43void snd_opl3_load_drums(opl3_t *opl3); 43void snd_opl3_load_drums(struct snd_opl3 *opl3);
44void snd_opl3_drum_switch(opl3_t *opl3, int note, int on_off, int vel, snd_midi_channel_t *chan); 44void snd_opl3_drum_switch(struct snd_opl3 *opl3, int note, int on_off, int vel, struct snd_midi_channel *chan);
45 45
46/* Prototypes for opl3_oss.c */ 46/* Prototypes for opl3_oss.c */
47#ifdef CONFIG_SND_SEQUENCER_OSS 47#ifdef CONFIG_SND_SEQUENCER_OSS
48void snd_opl3_init_seq_oss(opl3_t *opl3, char *name); 48void snd_opl3_init_seq_oss(struct snd_opl3 *opl3, char *name);
49void snd_opl3_free_seq_oss(opl3_t *opl3); 49void snd_opl3_free_seq_oss(struct snd_opl3 *opl3);
50#endif 50#endif
51 51
52#endif 52#endif
diff --git a/sound/drivers/opl4/opl4_lib.c b/sound/drivers/opl4/opl4_lib.c
index 4ae5dd8f011e..ddfc10d04be2 100644
--- a/sound/drivers/opl4/opl4_lib.c
+++ b/sound/drivers/opl4/opl4_lib.c
@@ -27,14 +27,14 @@ MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>");
27MODULE_DESCRIPTION("OPL4 driver"); 27MODULE_DESCRIPTION("OPL4 driver");
28MODULE_LICENSE("GPL"); 28MODULE_LICENSE("GPL");
29 29
30static void inline snd_opl4_wait(opl4_t *opl4) 30static void inline snd_opl4_wait(struct snd_opl4 *opl4)
31{ 31{
32 int timeout = 10; 32 int timeout = 10;
33 while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0) 33 while ((inb(opl4->fm_port) & OPL4_STATUS_BUSY) && --timeout > 0)
34 ; 34 ;
35} 35}
36 36
37void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value) 37void snd_opl4_write(struct snd_opl4 *opl4, u8 reg, u8 value)
38{ 38{
39 snd_opl4_wait(opl4); 39 snd_opl4_wait(opl4);
40 outb(reg, opl4->pcm_port); 40 outb(reg, opl4->pcm_port);
@@ -43,7 +43,7 @@ void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value)
43 outb(value, opl4->pcm_port + 1); 43 outb(value, opl4->pcm_port + 1);
44} 44}
45 45
46u8 snd_opl4_read(opl4_t *opl4, u8 reg) 46u8 snd_opl4_read(struct snd_opl4 *opl4, u8 reg)
47{ 47{
48 snd_opl4_wait(opl4); 48 snd_opl4_wait(opl4);
49 outb(reg, opl4->pcm_port); 49 outb(reg, opl4->pcm_port);
@@ -52,7 +52,7 @@ u8 snd_opl4_read(opl4_t *opl4, u8 reg)
52 return inb(opl4->pcm_port + 1); 52 return inb(opl4->pcm_port + 1);
53} 53}
54 54
55void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size) 55void snd_opl4_read_memory(struct snd_opl4 *opl4, char *buf, int offset, int size)
56{ 56{
57 unsigned long flags; 57 unsigned long flags;
58 u8 memcfg; 58 u8 memcfg;
@@ -76,7 +76,7 @@ void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size)
76 spin_unlock_irqrestore(&opl4->reg_lock, flags); 76 spin_unlock_irqrestore(&opl4->reg_lock, flags);
77} 77}
78 78
79void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size) 79void snd_opl4_write_memory(struct snd_opl4 *opl4, const char *buf, int offset, int size)
80{ 80{
81 unsigned long flags; 81 unsigned long flags;
82 u8 memcfg; 82 u8 memcfg;
@@ -100,7 +100,7 @@ void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size)
100 spin_unlock_irqrestore(&opl4->reg_lock, flags); 100 spin_unlock_irqrestore(&opl4->reg_lock, flags);
101} 101}
102 102
103static void snd_opl4_enable_opl4(opl4_t *opl4) 103static void snd_opl4_enable_opl4(struct snd_opl4 *opl4)
104{ 104{
105 outb(OPL3_REG_MODE, opl4->fm_port + 2); 105 outb(OPL3_REG_MODE, opl4->fm_port + 2);
106 inb(opl4->fm_port); 106 inb(opl4->fm_port);
@@ -110,7 +110,7 @@ static void snd_opl4_enable_opl4(opl4_t *opl4)
110 inb(opl4->fm_port); 110 inb(opl4->fm_port);
111} 111}
112 112
113static int snd_opl4_detect(opl4_t *opl4) 113static int snd_opl4_detect(struct snd_opl4 *opl4)
114{ 114{
115 u8 id1, id2; 115 u8 id1, id2;
116 116
@@ -144,19 +144,19 @@ static int snd_opl4_detect(opl4_t *opl4)
144} 144}
145 145
146#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE)) 146#if defined(CONFIG_SND_SEQUENCER) || (defined(MODULE) && defined(CONFIG_SND_SEQUENCER_MODULE))
147static void snd_opl4_seq_dev_free(snd_seq_device_t *seq_dev) 147static void snd_opl4_seq_dev_free(struct snd_seq_device *seq_dev)
148{ 148{
149 opl4_t *opl4 = seq_dev->private_data; 149 struct snd_opl4 *opl4 = seq_dev->private_data;
150 opl4->seq_dev = NULL; 150 opl4->seq_dev = NULL;
151} 151}
152 152
153static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device) 153static int snd_opl4_create_seq_dev(struct snd_opl4 *opl4, int seq_device)
154{ 154{
155 opl4->seq_dev_num = seq_device; 155 opl4->seq_dev_num = seq_device;
156 if (snd_seq_device_new(opl4->card, seq_device, SNDRV_SEQ_DEV_ID_OPL4, 156 if (snd_seq_device_new(opl4->card, seq_device, SNDRV_SEQ_DEV_ID_OPL4,
157 sizeof(opl4_t *), &opl4->seq_dev) >= 0) { 157 sizeof(struct snd_opl4 *), &opl4->seq_dev) >= 0) {
158 strcpy(opl4->seq_dev->name, "OPL4 Wavetable"); 158 strcpy(opl4->seq_dev->name, "OPL4 Wavetable");
159 *(opl4_t **)SNDRV_SEQ_DEVICE_ARGPTR(opl4->seq_dev) = opl4; 159 *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(opl4->seq_dev) = opl4;
160 opl4->seq_dev->private_data = opl4; 160 opl4->seq_dev->private_data = opl4;
161 opl4->seq_dev->private_free = snd_opl4_seq_dev_free; 161 opl4->seq_dev->private_free = snd_opl4_seq_dev_free;
162 } 162 }
@@ -164,7 +164,7 @@ static int snd_opl4_create_seq_dev(opl4_t *opl4, int seq_device)
164} 164}
165#endif 165#endif
166 166
167static void snd_opl4_free(opl4_t *opl4) 167static void snd_opl4_free(struct snd_opl4 *opl4)
168{ 168{
169#ifdef CONFIG_PROC_FS 169#ifdef CONFIG_PROC_FS
170 snd_opl4_free_proc(opl4); 170 snd_opl4_free_proc(opl4);
@@ -174,22 +174,22 @@ static void snd_opl4_free(opl4_t *opl4)
174 kfree(opl4); 174 kfree(opl4);
175} 175}
176 176
177static int snd_opl4_dev_free(snd_device_t *device) 177static int snd_opl4_dev_free(struct snd_device *device)
178{ 178{
179 opl4_t *opl4 = device->device_data; 179 struct snd_opl4 *opl4 = device->device_data;
180 snd_opl4_free(opl4); 180 snd_opl4_free(opl4);
181 return 0; 181 return 0;
182} 182}
183 183
184int snd_opl4_create(snd_card_t *card, 184int snd_opl4_create(struct snd_card *card,
185 unsigned long fm_port, unsigned long pcm_port, 185 unsigned long fm_port, unsigned long pcm_port,
186 int seq_device, 186 int seq_device,
187 opl3_t **ropl3, opl4_t **ropl4) 187 struct snd_opl3 **ropl3, struct snd_opl4 **ropl4)
188{ 188{
189 opl4_t *opl4; 189 struct snd_opl4 *opl4;
190 opl3_t *opl3; 190 struct snd_opl3 *opl3;
191 int err; 191 int err;
192 static snd_device_ops_t ops = { 192 static struct snd_device_ops ops = {
193 .dev_free = snd_opl4_dev_free 193 .dev_free = snd_opl4_dev_free
194 }; 194 };
195 195
diff --git a/sound/drivers/opl4/opl4_local.h b/sound/drivers/opl4/opl4_local.h
index c455680843f6..7e088a4a2f4c 100644
--- a/sound/drivers/opl4/opl4_local.h
+++ b/sound/drivers/opl4/opl4_local.h
@@ -131,7 +131,7 @@
131#define SNDRV_SEQ_DEV_ID_OPL4 "opl4-synth" 131#define SNDRV_SEQ_DEV_ID_OPL4 "opl4-synth"
132 132
133 133
134typedef struct opl4_sound { 134struct opl4_sound {
135 u16 tone; 135 u16 tone;
136 s16 pitch_offset; 136 s16 pitch_offset;
137 u8 key_scaling; 137 u8 key_scaling;
@@ -144,42 +144,42 @@ typedef struct opl4_sound {
144 u8 reg_level_decay2; 144 u8 reg_level_decay2;
145 u8 reg_release_correction; 145 u8 reg_release_correction;
146 u8 reg_tremolo; 146 u8 reg_tremolo;
147} opl4_sound_t; 147};
148 148
149typedef struct opl4_region { 149struct opl4_region {
150 u8 key_min, key_max; 150 u8 key_min, key_max;
151 opl4_sound_t sound; 151 struct opl4_sound sound;
152} opl4_region_t; 152};
153 153
154typedef struct opl4_region_ptr { 154struct opl4_region_ptr {
155 int count; 155 int count;
156 const opl4_region_t *regions; 156 const struct opl4_region *regions;
157} opl4_region_ptr_t; 157};
158 158
159typedef struct opl4_voice { 159struct opl4_voice {
160 struct list_head list; 160 struct list_head list;
161 int number; 161 int number;
162 snd_midi_channel_t *chan; 162 struct snd_midi_channel *chan;
163 int note; 163 int note;
164 int velocity; 164 int velocity;
165 const opl4_sound_t *sound; 165 const struct opl4_sound *sound;
166 u8 level_direct; 166 u8 level_direct;
167 u8 reg_f_number; 167 u8 reg_f_number;
168 u8 reg_misc; 168 u8 reg_misc;
169 u8 reg_lfo_vibrato; 169 u8 reg_lfo_vibrato;
170} opl4_voice_t; 170};
171 171
172struct opl4 { 172struct snd_opl4 {
173 unsigned long fm_port; 173 unsigned long fm_port;
174 unsigned long pcm_port; 174 unsigned long pcm_port;
175 struct resource *res_fm_port; 175 struct resource *res_fm_port;
176 struct resource *res_pcm_port; 176 struct resource *res_pcm_port;
177 unsigned short hardware; 177 unsigned short hardware;
178 spinlock_t reg_lock; 178 spinlock_t reg_lock;
179 snd_card_t *card; 179 struct snd_card *card;
180 180
181#ifdef CONFIG_PROC_FS 181#ifdef CONFIG_PROC_FS
182 snd_info_entry_t *proc_entry; 182 struct snd_info_entry *proc_entry;
183 int memory_access; 183 int memory_access;
184#endif 184#endif
185 struct semaphore access_mutex; 185 struct semaphore access_mutex;
@@ -189,44 +189,44 @@ struct opl4 {
189 189
190 int seq_dev_num; 190 int seq_dev_num;
191 int seq_client; 191 int seq_client;
192 snd_seq_device_t *seq_dev; 192 struct snd_seq_device *seq_dev;
193 193
194 snd_midi_channel_set_t *chset; 194 struct snd_midi_channel_set *chset;
195 opl4_voice_t voices[OPL4_MAX_VOICES]; 195 struct opl4_voice voices[OPL4_MAX_VOICES];
196 struct list_head off_voices; 196 struct list_head off_voices;
197 struct list_head on_voices; 197 struct list_head on_voices;
198#endif 198#endif
199}; 199};
200 200
201/* opl4_lib.c */ 201/* opl4_lib.c */
202void snd_opl4_write(opl4_t *opl4, u8 reg, u8 value); 202void snd_opl4_write(struct snd_opl4 *opl4, u8 reg, u8 value);
203u8 snd_opl4_read(opl4_t *opl4, u8 reg); 203u8 snd_opl4_read(struct snd_opl4 *opl4, u8 reg);
204void snd_opl4_read_memory(opl4_t *opl4, char *buf, int offset, int size); 204void snd_opl4_read_memory(struct snd_opl4 *opl4, char *buf, int offset, int size);
205void snd_opl4_write_memory(opl4_t *opl4, const char *buf, int offset, int size); 205void snd_opl4_write_memory(struct snd_opl4 *opl4, const char *buf, int offset, int size);
206 206
207/* opl4_mixer.c */ 207/* opl4_mixer.c */
208int snd_opl4_create_mixer(opl4_t *opl4); 208int snd_opl4_create_mixer(struct snd_opl4 *opl4);
209 209
210#ifdef CONFIG_PROC_FS 210#ifdef CONFIG_PROC_FS
211/* opl4_proc.c */ 211/* opl4_proc.c */
212int snd_opl4_create_proc(opl4_t *opl4); 212int snd_opl4_create_proc(struct snd_opl4 *opl4);
213void snd_opl4_free_proc(opl4_t *opl4); 213void snd_opl4_free_proc(struct snd_opl4 *opl4);
214#endif 214#endif
215 215
216/* opl4_seq.c */ 216/* opl4_seq.c */
217extern int volume_boost; 217extern int volume_boost;
218 218
219/* opl4_synth.c */ 219/* opl4_synth.c */
220void snd_opl4_synth_reset(opl4_t *opl4); 220void snd_opl4_synth_reset(struct snd_opl4 *opl4);
221void snd_opl4_synth_shutdown(opl4_t *opl4); 221void snd_opl4_synth_shutdown(struct snd_opl4 *opl4);
222void snd_opl4_note_on(void *p, int note, int vel, snd_midi_channel_t *chan); 222void snd_opl4_note_on(void *p, int note, int vel, struct snd_midi_channel *chan);
223void snd_opl4_note_off(void *p, int note, int vel, snd_midi_channel_t *chan); 223void snd_opl4_note_off(void *p, int note, int vel, struct snd_midi_channel *chan);
224void snd_opl4_terminate_note(void *p, int note, snd_midi_channel_t *chan); 224void snd_opl4_terminate_note(void *p, int note, struct snd_midi_channel *chan);
225void snd_opl4_control(void *p, int type, snd_midi_channel_t *chan); 225void snd_opl4_control(void *p, int type, struct snd_midi_channel *chan);
226void snd_opl4_sysex(void *p, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 226void snd_opl4_sysex(void *p, unsigned char *buf, int len, int parsed, struct snd_midi_channel_set *chset);
227 227
228/* yrw801.c */ 228/* yrw801.c */
229int snd_yrw801_detect(opl4_t *opl4); 229int snd_yrw801_detect(struct snd_opl4 *opl4);
230extern const opl4_region_ptr_t snd_yrw801_regions[]; 230extern const struct opl4_region_ptr snd_yrw801_regions[];
231 231
232#endif /* __OPL4_LOCAL_H */ 232#endif /* __OPL4_LOCAL_H */
diff --git a/sound/drivers/opl4/opl4_mixer.c b/sound/drivers/opl4/opl4_mixer.c
index ec7a228fbe7e..04079de4c35f 100644
--- a/sound/drivers/opl4/opl4_mixer.c
+++ b/sound/drivers/opl4/opl4_mixer.c
@@ -20,7 +20,7 @@
20#include "opl4_local.h" 20#include "opl4_local.h"
21#include <sound/control.h> 21#include <sound/control.h>
22 22
23static int snd_opl4_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 23static int snd_opl4_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
24{ 24{
25 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 25 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
26 uinfo->count = 2; 26 uinfo->count = 2;
@@ -29,9 +29,9 @@ static int snd_opl4_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
29 return 0; 29 return 0;
30} 30}
31 31
32static int snd_opl4_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 32static int snd_opl4_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
33{ 33{
34 opl4_t *opl4 = snd_kcontrol_chip(kcontrol); 34 struct snd_opl4 *opl4 = snd_kcontrol_chip(kcontrol);
35 unsigned long flags; 35 unsigned long flags;
36 u8 reg = kcontrol->private_value; 36 u8 reg = kcontrol->private_value;
37 u8 value; 37 u8 value;
@@ -44,9 +44,9 @@ static int snd_opl4_ctl_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon
44 return 0; 44 return 0;
45} 45}
46 46
47static int snd_opl4_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 47static int snd_opl4_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
48{ 48{
49 opl4_t *opl4 = snd_kcontrol_chip(kcontrol); 49 struct snd_opl4 *opl4 = snd_kcontrol_chip(kcontrol);
50 unsigned long flags; 50 unsigned long flags;
51 u8 reg = kcontrol->private_value; 51 u8 reg = kcontrol->private_value;
52 u8 value, old_value; 52 u8 value, old_value;
@@ -60,7 +60,7 @@ static int snd_opl4_ctl_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon
60 return value != old_value; 60 return value != old_value;
61} 61}
62 62
63static snd_kcontrol_new_t snd_opl4_controls[] = { 63static struct snd_kcontrol_new snd_opl4_controls[] = {
64 { 64 {
65 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 65 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
66 .name = "FM Playback Volume", 66 .name = "FM Playback Volume",
@@ -79,9 +79,9 @@ static snd_kcontrol_new_t snd_opl4_controls[] = {
79 } 79 }
80}; 80};
81 81
82int snd_opl4_create_mixer(opl4_t *opl4) 82int snd_opl4_create_mixer(struct snd_opl4 *opl4)
83{ 83{
84 snd_card_t *card = opl4->card; 84 struct snd_card *card = opl4->card;
85 int i, err; 85 int i, err;
86 86
87 strcat(card->mixername, ",OPL4"); 87 strcat(card->mixername, ",OPL4");
diff --git a/sound/drivers/opl4/opl4_proc.c b/sound/drivers/opl4/opl4_proc.c
index 6a1486258acf..f4b4e74fcc18 100644
--- a/sound/drivers/opl4/opl4_proc.c
+++ b/sound/drivers/opl4/opl4_proc.c
@@ -23,10 +23,10 @@
23 23
24#ifdef CONFIG_PROC_FS 24#ifdef CONFIG_PROC_FS
25 25
26static int snd_opl4_mem_proc_open(snd_info_entry_t *entry, 26static int snd_opl4_mem_proc_open(struct snd_info_entry *entry,
27 unsigned short mode, void **file_private_data) 27 unsigned short mode, void **file_private_data)
28{ 28{
29 opl4_t *opl4 = entry->private_data; 29 struct snd_opl4 *opl4 = entry->private_data;
30 30
31 down(&opl4->access_mutex); 31 down(&opl4->access_mutex);
32 if (opl4->memory_access) { 32 if (opl4->memory_access) {
@@ -38,10 +38,10 @@ static int snd_opl4_mem_proc_open(snd_info_entry_t *entry,
38 return 0; 38 return 0;
39} 39}
40 40
41static int snd_opl4_mem_proc_release(snd_info_entry_t *entry, 41static int snd_opl4_mem_proc_release(struct snd_info_entry *entry,
42 unsigned short mode, void *file_private_data) 42 unsigned short mode, void *file_private_data)
43{ 43{
44 opl4_t *opl4 = entry->private_data; 44 struct snd_opl4 *opl4 = entry->private_data;
45 45
46 down(&opl4->access_mutex); 46 down(&opl4->access_mutex);
47 opl4->memory_access--; 47 opl4->memory_access--;
@@ -49,11 +49,11 @@ static int snd_opl4_mem_proc_release(snd_info_entry_t *entry,
49 return 0; 49 return 0;
50} 50}
51 51
52static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_data, 52static long snd_opl4_mem_proc_read(struct snd_info_entry *entry, void *file_private_data,
53 struct file *file, char __user *_buf, 53 struct file *file, char __user *_buf,
54 unsigned long count, unsigned long pos) 54 unsigned long count, unsigned long pos)
55{ 55{
56 opl4_t *opl4 = entry->private_data; 56 struct snd_opl4 *opl4 = entry->private_data;
57 long size; 57 long size;
58 char* buf; 58 char* buf;
59 59
@@ -75,11 +75,11 @@ static long snd_opl4_mem_proc_read(snd_info_entry_t *entry, void *file_private_d
75 return 0; 75 return 0;
76} 76}
77 77
78static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_data, 78static long snd_opl4_mem_proc_write(struct snd_info_entry *entry, void *file_private_data,
79 struct file *file, const char __user *_buf, 79 struct file *file, const char __user *_buf,
80 unsigned long count, unsigned long pos) 80 unsigned long count, unsigned long pos)
81{ 81{
82 opl4_t *opl4 = entry->private_data; 82 struct snd_opl4 *opl4 = entry->private_data;
83 long size; 83 long size;
84 char *buf; 84 char *buf;
85 85
@@ -101,7 +101,7 @@ static long snd_opl4_mem_proc_write(snd_info_entry_t *entry, void *file_private_
101 return 0; 101 return 0;
102} 102}
103 103
104static long long snd_opl4_mem_proc_llseek(snd_info_entry_t *entry, void *file_private_data, 104static long long snd_opl4_mem_proc_llseek(struct snd_info_entry *entry, void *file_private_data,
105 struct file *file, long long offset, int orig) 105 struct file *file, long long offset, int orig)
106{ 106{
107 switch (orig) { 107 switch (orig) {
@@ -130,9 +130,9 @@ static struct snd_info_entry_ops snd_opl4_mem_proc_ops = {
130 .llseek = snd_opl4_mem_proc_llseek, 130 .llseek = snd_opl4_mem_proc_llseek,
131}; 131};
132 132
133int snd_opl4_create_proc(opl4_t *opl4) 133int snd_opl4_create_proc(struct snd_opl4 *opl4)
134{ 134{
135 snd_info_entry_t *entry; 135 struct snd_info_entry *entry;
136 136
137 entry = snd_info_create_card_entry(opl4->card, "opl4-mem", opl4->card->proc_root); 137 entry = snd_info_create_card_entry(opl4->card, "opl4-mem", opl4->card->proc_root);
138 if (entry) { 138 if (entry) {
@@ -157,7 +157,7 @@ int snd_opl4_create_proc(opl4_t *opl4)
157 return 0; 157 return 0;
158} 158}
159 159
160void snd_opl4_free_proc(opl4_t *opl4) 160void snd_opl4_free_proc(struct snd_opl4 *opl4)
161{ 161{
162 if (opl4->proc_entry) 162 if (opl4->proc_entry)
163 snd_info_unregister(opl4->proc_entry); 163 snd_info_unregister(opl4->proc_entry);
diff --git a/sound/drivers/opl4/opl4_seq.c b/sound/drivers/opl4/opl4_seq.c
index 958dfe88479a..e3480326e735 100644
--- a/sound/drivers/opl4/opl4_seq.c
+++ b/sound/drivers/opl4/opl4_seq.c
@@ -45,21 +45,21 @@ int volume_boost = 8;
45module_param(volume_boost, int, 0644); 45module_param(volume_boost, int, 0644);
46MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds."); 46MODULE_PARM_DESC(volume_boost, "Additional volume for OPL4 wavetable sounds.");
47 47
48static int snd_opl4_seq_use_inc(opl4_t *opl4) 48static int snd_opl4_seq_use_inc(struct snd_opl4 *opl4)
49{ 49{
50 if (!try_module_get(opl4->card->module)) 50 if (!try_module_get(opl4->card->module))
51 return -EFAULT; 51 return -EFAULT;
52 return 0; 52 return 0;
53} 53}
54 54
55static void snd_opl4_seq_use_dec(opl4_t *opl4) 55static void snd_opl4_seq_use_dec(struct snd_opl4 *opl4)
56{ 56{
57 module_put(opl4->card->module); 57 module_put(opl4->card->module);
58} 58}
59 59
60static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info) 60static int snd_opl4_seq_use(void *private_data, struct snd_seq_port_subscribe *info)
61{ 61{
62 opl4_t *opl4 = private_data; 62 struct snd_opl4 *opl4 = private_data;
63 int err; 63 int err;
64 64
65 down(&opl4->access_mutex); 65 down(&opl4->access_mutex);
@@ -84,9 +84,9 @@ static int snd_opl4_seq_use(void *private_data, snd_seq_port_subscribe_t *info)
84 return 0; 84 return 0;
85} 85}
86 86
87static int snd_opl4_seq_unuse(void *private_data, snd_seq_port_subscribe_t *info) 87static int snd_opl4_seq_unuse(void *private_data, struct snd_seq_port_subscribe *info)
88{ 88{
89 opl4_t *opl4 = private_data; 89 struct snd_opl4 *opl4 = private_data;
90 90
91 snd_opl4_synth_shutdown(opl4); 91 snd_opl4_synth_shutdown(opl4);
92 92
@@ -99,7 +99,7 @@ static int snd_opl4_seq_unuse(void *private_data, snd_seq_port_subscribe_t *info
99 return 0; 99 return 0;
100} 100}
101 101
102static snd_midi_op_t opl4_ops = { 102static struct snd_midi_op opl4_ops = {
103 .note_on = snd_opl4_note_on, 103 .note_on = snd_opl4_note_on,
104 .note_off = snd_opl4_note_off, 104 .note_off = snd_opl4_note_off,
105 .note_terminate = snd_opl4_terminate_note, 105 .note_terminate = snd_opl4_terminate_note,
@@ -107,10 +107,10 @@ static snd_midi_op_t opl4_ops = {
107 .sysex = snd_opl4_sysex, 107 .sysex = snd_opl4_sysex,
108}; 108};
109 109
110static int snd_opl4_seq_event_input(snd_seq_event_t *ev, int direct, 110static int snd_opl4_seq_event_input(struct snd_seq_event *ev, int direct,
111 void *private_data, int atomic, int hop) 111 void *private_data, int atomic, int hop)
112{ 112{
113 opl4_t *opl4 = private_data; 113 struct snd_opl4 *opl4 = private_data;
114 114
115 snd_midi_process_event(&opl4_ops, ev, opl4->chset); 115 snd_midi_process_event(&opl4_ops, ev, opl4->chset);
116 return 0; 116 return 0;
@@ -118,20 +118,18 @@ static int snd_opl4_seq_event_input(snd_seq_event_t *ev, int direct,
118 118
119static void snd_opl4_seq_free_port(void *private_data) 119static void snd_opl4_seq_free_port(void *private_data)
120{ 120{
121 opl4_t *opl4 = private_data; 121 struct snd_opl4 *opl4 = private_data;
122 122
123 snd_midi_channel_free_set(opl4->chset); 123 snd_midi_channel_free_set(opl4->chset);
124} 124}
125 125
126static int snd_opl4_seq_new_device(snd_seq_device_t *dev) 126static int snd_opl4_seq_new_device(struct snd_seq_device *dev)
127{ 127{
128 opl4_t *opl4; 128 struct snd_opl4 *opl4;
129 int client; 129 int client;
130 snd_seq_client_callback_t callbacks; 130 struct snd_seq_port_callback pcallbacks;
131 snd_seq_client_info_t cinfo;
132 snd_seq_port_callback_t pcallbacks;
133 131
134 opl4 = *(opl4_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 132 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
135 if (!opl4) 133 if (!opl4)
136 return -EINVAL; 134 return -EINVAL;
137 135
@@ -144,10 +142,8 @@ static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
144 opl4->chset->private_data = opl4; 142 opl4->chset->private_data = opl4;
145 143
146 /* allocate new client */ 144 /* allocate new client */
147 memset(&callbacks, 0, sizeof(callbacks)); 145 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num,
148 callbacks.private_data = opl4; 146 "OPL4 Wavetable");
149 callbacks.allow_output = callbacks.allow_input = 1;
150 client = snd_seq_create_kernel_client(opl4->card, opl4->seq_dev_num, &callbacks);
151 if (client < 0) { 147 if (client < 0) {
152 snd_midi_channel_free_set(opl4->chset); 148 snd_midi_channel_free_set(opl4->chset);
153 return client; 149 return client;
@@ -155,13 +151,6 @@ static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
155 opl4->seq_client = client; 151 opl4->seq_client = client;
156 opl4->chset->client = client; 152 opl4->chset->client = client;
157 153
158 /* change name of client */
159 memset(&cinfo, 0, sizeof(cinfo));
160 cinfo.client = client;
161 cinfo.type = KERNEL_CLIENT;
162 strcpy(cinfo.name, "OPL4 Wavetable");
163 snd_seq_kernel_client_ctl(client, SNDRV_SEQ_IOCTL_SET_CLIENT_INFO, &cinfo);
164
165 /* create new port */ 154 /* create new port */
166 memset(&pcallbacks, 0, sizeof(pcallbacks)); 155 memset(&pcallbacks, 0, sizeof(pcallbacks));
167 pcallbacks.owner = THIS_MODULE; 156 pcallbacks.owner = THIS_MODULE;
@@ -188,11 +177,11 @@ static int snd_opl4_seq_new_device(snd_seq_device_t *dev)
188 return 0; 177 return 0;
189} 178}
190 179
191static int snd_opl4_seq_delete_device(snd_seq_device_t *dev) 180static int snd_opl4_seq_delete_device(struct snd_seq_device *dev)
192{ 181{
193 opl4_t *opl4; 182 struct snd_opl4 *opl4;
194 183
195 opl4 = *(opl4_t **)SNDRV_SEQ_DEVICE_ARGPTR(dev); 184 opl4 = *(struct snd_opl4 **)SNDRV_SEQ_DEVICE_ARGPTR(dev);
196 if (!opl4) 185 if (!opl4)
197 return -EINVAL; 186 return -EINVAL;
198 187
@@ -205,13 +194,13 @@ static int snd_opl4_seq_delete_device(snd_seq_device_t *dev)
205 194
206static int __init alsa_opl4_synth_init(void) 195static int __init alsa_opl4_synth_init(void)
207{ 196{
208 static snd_seq_dev_ops_t ops = { 197 static struct snd_seq_dev_ops ops = {
209 snd_opl4_seq_new_device, 198 snd_opl4_seq_new_device,
210 snd_opl4_seq_delete_device 199 snd_opl4_seq_delete_device
211 }; 200 };
212 201
213 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL4, &ops, 202 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_OPL4, &ops,
214 sizeof(opl4_t*)); 203 sizeof(struct snd_opl4 *));
215} 204}
216 205
217static void __exit alsa_opl4_synth_exit(void) 206static void __exit alsa_opl4_synth_exit(void)
diff --git a/sound/drivers/opl4/opl4_synth.c b/sound/drivers/opl4/opl4_synth.c
index b146a1c995d9..74f6e53eae0d 100644
--- a/sound/drivers/opl4/opl4_synth.c
+++ b/sound/drivers/opl4/opl4_synth.c
@@ -270,7 +270,7 @@ static unsigned char snd_opl4_volume_table[128] = {
270/* 270/*
271 * Initializes all voices. 271 * Initializes all voices.
272 */ 272 */
273void snd_opl4_synth_reset(opl4_t *opl4) 273void snd_opl4_synth_reset(struct snd_opl4 *opl4)
274{ 274{
275 unsigned long flags; 275 unsigned long flags;
276 int i; 276 int i;
@@ -294,7 +294,7 @@ void snd_opl4_synth_reset(opl4_t *opl4)
294/* 294/*
295 * Shuts down all voices. 295 * Shuts down all voices.
296 */ 296 */
297void snd_opl4_synth_shutdown(opl4_t *opl4) 297void snd_opl4_synth_shutdown(struct snd_opl4 *opl4)
298{ 298{
299 unsigned long flags; 299 unsigned long flags;
300 int i; 300 int i;
@@ -309,12 +309,12 @@ void snd_opl4_synth_shutdown(opl4_t *opl4)
309/* 309/*
310 * Executes the callback for all voices playing the specified note. 310 * Executes the callback for all voices playing the specified note.
311 */ 311 */
312static void snd_opl4_do_for_note(opl4_t *opl4, int note, snd_midi_channel_t *chan, 312static void snd_opl4_do_for_note(struct snd_opl4 *opl4, int note, struct snd_midi_channel *chan,
313 void (*func)(opl4_t *opl4, opl4_voice_t *voice)) 313 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
314{ 314{
315 int i; 315 int i;
316 unsigned long flags; 316 unsigned long flags;
317 opl4_voice_t *voice; 317 struct opl4_voice *voice;
318 318
319 spin_lock_irqsave(&opl4->reg_lock, flags); 319 spin_lock_irqsave(&opl4->reg_lock, flags);
320 for (i = 0; i < OPL4_MAX_VOICES; i++) { 320 for (i = 0; i < OPL4_MAX_VOICES; i++) {
@@ -329,12 +329,13 @@ static void snd_opl4_do_for_note(opl4_t *opl4, int note, snd_midi_channel_t *cha
329/* 329/*
330 * Executes the callback for all voices of to the specified channel. 330 * Executes the callback for all voices of to the specified channel.
331 */ 331 */
332static void snd_opl4_do_for_channel(opl4_t *opl4, snd_midi_channel_t *chan, 332static void snd_opl4_do_for_channel(struct snd_opl4 *opl4,
333 void (*func)(opl4_t *opl4, opl4_voice_t *voice)) 333 struct snd_midi_channel *chan,
334 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
334{ 335{
335 int i; 336 int i;
336 unsigned long flags; 337 unsigned long flags;
337 opl4_voice_t *voice; 338 struct opl4_voice *voice;
338 339
339 spin_lock_irqsave(&opl4->reg_lock, flags); 340 spin_lock_irqsave(&opl4->reg_lock, flags);
340 for (i = 0; i < OPL4_MAX_VOICES; i++) { 341 for (i = 0; i < OPL4_MAX_VOICES; i++) {
@@ -349,12 +350,12 @@ static void snd_opl4_do_for_channel(opl4_t *opl4, snd_midi_channel_t *chan,
349/* 350/*
350 * Executes the callback for all active voices. 351 * Executes the callback for all active voices.
351 */ 352 */
352static void snd_opl4_do_for_all(opl4_t *opl4, 353static void snd_opl4_do_for_all(struct snd_opl4 *opl4,
353 void (*func)(opl4_t *opl4, opl4_voice_t *voice)) 354 void (*func)(struct snd_opl4 *opl4, struct opl4_voice *voice))
354{ 355{
355 int i; 356 int i;
356 unsigned long flags; 357 unsigned long flags;
357 opl4_voice_t *voice; 358 struct opl4_voice *voice;
358 359
359 spin_lock_irqsave(&opl4->reg_lock, flags); 360 spin_lock_irqsave(&opl4->reg_lock, flags);
360 for (i = 0; i < OPL4_MAX_VOICES; i++) { 361 for (i = 0; i < OPL4_MAX_VOICES; i++) {
@@ -365,7 +366,7 @@ static void snd_opl4_do_for_all(opl4_t *opl4,
365 spin_unlock_irqrestore(&opl4->reg_lock, flags); 366 spin_unlock_irqrestore(&opl4->reg_lock, flags);
366} 367}
367 368
368static void snd_opl4_update_volume(opl4_t *opl4, opl4_voice_t *voice) 369static void snd_opl4_update_volume(struct snd_opl4 *opl4, struct opl4_voice *voice)
369{ 370{
370 int att; 371 int att;
371 372
@@ -384,7 +385,7 @@ static void snd_opl4_update_volume(opl4_t *opl4, opl4_voice_t *voice)
384 voice->level_direct = 0; 385 voice->level_direct = 0;
385} 386}
386 387
387static void snd_opl4_update_pan(opl4_t *opl4, opl4_voice_t *voice) 388static void snd_opl4_update_pan(struct snd_opl4 *opl4, struct opl4_voice *voice)
388{ 389{
389 int pan = voice->sound->panpot; 390 int pan = voice->sound->panpot;
390 391
@@ -399,7 +400,8 @@ static void snd_opl4_update_pan(opl4_t *opl4, opl4_voice_t *voice)
399 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc); 400 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
400} 401}
401 402
402static void snd_opl4_update_vibrato_depth(opl4_t *opl4, opl4_voice_t *voice) 403static void snd_opl4_update_vibrato_depth(struct snd_opl4 *opl4,
404 struct opl4_voice *voice)
403{ 405{
404 int depth; 406 int depth;
405 407
@@ -414,9 +416,10 @@ static void snd_opl4_update_vibrato_depth(opl4_t *opl4, opl4_voice_t *voice)
414 voice->reg_lfo_vibrato); 416 voice->reg_lfo_vibrato);
415} 417}
416 418
417static void snd_opl4_update_pitch(opl4_t *opl4, opl4_voice_t *voice) 419static void snd_opl4_update_pitch(struct snd_opl4 *opl4,
420 struct opl4_voice *voice)
418{ 421{
419 snd_midi_channel_t *chan = voice->chan; 422 struct snd_midi_channel *chan = voice->chan;
420 int note, pitch, octave; 423 int note, pitch, octave;
421 424
422 note = chan->drum_channel ? 60 : voice->note; 425 note = chan->drum_channel ? 60 : voice->note;
@@ -444,7 +447,8 @@ static void snd_opl4_update_pitch(opl4_t *opl4, opl4_voice_t *voice)
444 snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice->number, voice->reg_f_number); 447 snd_opl4_write(opl4, OPL4_REG_F_NUMBER + voice->number, voice->reg_f_number);
445} 448}
446 449
447static void snd_opl4_update_tone_parameters(opl4_t *opl4, opl4_voice_t *voice) 450static void snd_opl4_update_tone_parameters(struct snd_opl4 *opl4,
451 struct opl4_voice *voice)
448{ 452{
449 snd_opl4_write(opl4, OPL4_REG_ATTACK_DECAY1 + voice->number, 453 snd_opl4_write(opl4, OPL4_REG_ATTACK_DECAY1 + voice->number,
450 voice->sound->reg_attack_decay1); 454 voice->sound->reg_attack_decay1);
@@ -457,17 +461,17 @@ static void snd_opl4_update_tone_parameters(opl4_t *opl4, opl4_voice_t *voice)
457} 461}
458 462
459/* allocate one voice */ 463/* allocate one voice */
460static opl4_voice_t *snd_opl4_get_voice(opl4_t *opl4) 464static struct opl4_voice *snd_opl4_get_voice(struct snd_opl4 *opl4)
461{ 465{
462 /* first, try to get the oldest key-off voice */ 466 /* first, try to get the oldest key-off voice */
463 if (!list_empty(&opl4->off_voices)) 467 if (!list_empty(&opl4->off_voices))
464 return list_entry(opl4->off_voices.next, opl4_voice_t, list); 468 return list_entry(opl4->off_voices.next, struct opl4_voice, list);
465 /* then get the oldest key-on voice */ 469 /* then get the oldest key-on voice */
466 snd_assert(!list_empty(&opl4->on_voices), ); 470 snd_assert(!list_empty(&opl4->on_voices), );
467 return list_entry(opl4->on_voices.next, opl4_voice_t, list); 471 return list_entry(opl4->on_voices.next, struct opl4_voice, list);
468} 472}
469 473
470static void snd_opl4_wait_for_wave_headers(opl4_t *opl4) 474static void snd_opl4_wait_for_wave_headers(struct snd_opl4 *opl4)
471{ 475{
472 int timeout = 200; 476 int timeout = 200;
473 477
@@ -475,12 +479,12 @@ static void snd_opl4_wait_for_wave_headers(opl4_t *opl4)
475 udelay(10); 479 udelay(10);
476} 480}
477 481
478void snd_opl4_note_on(void *private_data, int note, int vel, snd_midi_channel_t *chan) 482void snd_opl4_note_on(void *private_data, int note, int vel, struct snd_midi_channel *chan)
479{ 483{
480 opl4_t *opl4 = private_data; 484 struct snd_opl4 *opl4 = private_data;
481 const opl4_region_ptr_t *regions; 485 const struct opl4_region_ptr *regions;
482 opl4_voice_t *voice[2]; 486 struct opl4_voice *voice[2];
483 const opl4_sound_t *sound[2]; 487 const struct opl4_sound *sound[2];
484 int voices = 0, i; 488 int voices = 0, i;
485 unsigned long flags; 489 unsigned long flags;
486 490
@@ -549,7 +553,7 @@ void snd_opl4_note_on(void *private_data, int note, int vel, snd_midi_channel_t
549 spin_unlock_irqrestore(&opl4->reg_lock, flags); 553 spin_unlock_irqrestore(&opl4->reg_lock, flags);
550} 554}
551 555
552static void snd_opl4_voice_off(opl4_t *opl4, opl4_voice_t *voice) 556static void snd_opl4_voice_off(struct snd_opl4 *opl4, struct opl4_voice *voice)
553{ 557{
554 list_del(&voice->list); 558 list_del(&voice->list);
555 list_add_tail(&voice->list, &opl4->off_voices); 559 list_add_tail(&voice->list, &opl4->off_voices);
@@ -558,14 +562,14 @@ static void snd_opl4_voice_off(opl4_t *opl4, opl4_voice_t *voice)
558 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc); 562 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
559} 563}
560 564
561void snd_opl4_note_off(void *private_data, int note, int vel, snd_midi_channel_t *chan) 565void snd_opl4_note_off(void *private_data, int note, int vel, struct snd_midi_channel *chan)
562{ 566{
563 opl4_t *opl4 = private_data; 567 struct snd_opl4 *opl4 = private_data;
564 568
565 snd_opl4_do_for_note(opl4, note, chan, snd_opl4_voice_off); 569 snd_opl4_do_for_note(opl4, note, chan, snd_opl4_voice_off);
566} 570}
567 571
568static void snd_opl4_terminate_voice(opl4_t *opl4, opl4_voice_t *voice) 572static void snd_opl4_terminate_voice(struct snd_opl4 *opl4, struct opl4_voice *voice)
569{ 573{
570 list_del(&voice->list); 574 list_del(&voice->list);
571 list_add_tail(&voice->list, &opl4->off_voices); 575 list_add_tail(&voice->list, &opl4->off_voices);
@@ -574,16 +578,16 @@ static void snd_opl4_terminate_voice(opl4_t *opl4, opl4_voice_t *voice)
574 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc); 578 snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
575} 579}
576 580
577void snd_opl4_terminate_note(void *private_data, int note, snd_midi_channel_t *chan) 581void snd_opl4_terminate_note(void *private_data, int note, struct snd_midi_channel *chan)
578{ 582{
579 opl4_t *opl4 = private_data; 583 struct snd_opl4 *opl4 = private_data;
580 584
581 snd_opl4_do_for_note(opl4, note, chan, snd_opl4_terminate_voice); 585 snd_opl4_do_for_note(opl4, note, chan, snd_opl4_terminate_voice);
582} 586}
583 587
584void snd_opl4_control(void *private_data, int type, snd_midi_channel_t *chan) 588void snd_opl4_control(void *private_data, int type, struct snd_midi_channel *chan)
585{ 589{
586 opl4_t *opl4 = private_data; 590 struct snd_opl4 *opl4 = private_data;
587 591
588 switch (type) { 592 switch (type) {
589 case MIDI_CTL_MSB_MODWHEEL: 593 case MIDI_CTL_MSB_MODWHEEL:
@@ -621,9 +625,9 @@ void snd_opl4_control(void *private_data, int type, snd_midi_channel_t *chan)
621} 625}
622 626
623void snd_opl4_sysex(void *private_data, unsigned char *buf, int len, 627void snd_opl4_sysex(void *private_data, unsigned char *buf, int len,
624 int parsed, snd_midi_channel_set_t *chset) 628 int parsed, struct snd_midi_channel_set *chset)
625{ 629{
626 opl4_t *opl4 = private_data; 630 struct snd_opl4 *opl4 = private_data;
627 631
628 if (parsed == SNDRV_MIDI_SYSEX_GS_MASTER_VOLUME) 632 if (parsed == SNDRV_MIDI_SYSEX_GS_MASTER_VOLUME)
629 snd_opl4_do_for_all(opl4, snd_opl4_update_volume); 633 snd_opl4_do_for_all(opl4, snd_opl4_update_volume);
diff --git a/sound/drivers/opl4/yrw801.c b/sound/drivers/opl4/yrw801.c
index a51174dd3e56..6c335492d082 100644
--- a/sound/drivers/opl4/yrw801.c
+++ b/sound/drivers/opl4/yrw801.c
@@ -33,7 +33,7 @@
33 33
34#include "opl4_local.h" 34#include "opl4_local.h"
35 35
36int snd_yrw801_detect(opl4_t *opl4) 36int snd_yrw801_detect(struct snd_opl4 *opl4)
37{ 37{
38 char buf[15]; 38 char buf[15];
39 39
@@ -54,7 +54,7 @@ int snd_yrw801_detect(opl4_t *opl4)
54 * by this driver. 54 * by this driver.
55 */ 55 */
56 56
57static const opl4_region_t regions_00[] = { /* Acoustic Grand Piano */ 57static const struct opl4_region regions_00[] = { /* Acoustic Grand Piano */
58 {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}}, 58 {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}},
59 {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, 59 {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}},
60 {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, 60 {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}},
@@ -66,7 +66,7 @@ static const opl4_region_t regions_00[] = { /* Acoustic Grand Piano */
66 {0x53, 0x58, {0x134,1444,100, 0,0,0x07,0xc8,0x20,0xf3,0x14,0x18,0x0}}, 66 {0x53, 0x58, {0x134,1444,100, 0,0,0x07,0xc8,0x20,0xf3,0x14,0x18,0x0}},
67 {0x59, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}} 67 {0x59, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}}
68}; 68};
69static const opl4_region_t regions_01[] = { /* Bright Acoustic Piano */ 69static const struct opl4_region regions_01[] = { /* Bright Acoustic Piano */
70 {0x14, 0x2d, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}}, 70 {0x14, 0x2d, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}},
71 {0x2e, 0x33, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, 71 {0x2e, 0x33, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}},
72 {0x34, 0x39, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, 72 {0x34, 0x39, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}},
@@ -78,7 +78,7 @@ static const opl4_region_t regions_01[] = { /* Bright Acoustic Piano */
78 {0x59, 0x5e, {0x134,1444,100, 0,0,0x0a,0xc8,0x20,0xf3,0x14,0x18,0x0}}, 78 {0x59, 0x5e, {0x134,1444,100, 0,0,0x0a,0xc8,0x20,0xf3,0x14,0x18,0x0}},
79 {0x5f, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}} 79 {0x5f, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}}
80}; 80};
81static const opl4_region_t regions_02[] = { /* Electric Grand Piano */ 81static const struct opl4_region regions_02[] = { /* Electric Grand Piano */
82 {0x14, 0x2d, {0x12c,7476,100, 1,0,0x00,0xae,0x20,0xf2,0x13,0x07,0x0}}, 82 {0x14, 0x2d, {0x12c,7476,100, 1,0,0x00,0xae,0x20,0xf2,0x13,0x07,0x0}},
83 {0x2e, 0x33, {0x12d,6818,100, 1,0,0x00,0xae,0x20,0xf2,0x14,0x07,0x0}}, 83 {0x2e, 0x33, {0x12d,6818,100, 1,0,0x00,0xae,0x20,0xf2,0x14,0x07,0x0}},
84 {0x34, 0x39, {0x12e,5901,100, 1,0,0x00,0xae,0x20,0xf2,0x14,0x07,0x0}}, 84 {0x34, 0x39, {0x12e,5901,100, 1,0,0x00,0xae,0x20,0xf2,0x14,0x07,0x0}},
@@ -91,7 +91,7 @@ static const opl4_region_t regions_02[] = { /* Electric Grand Piano */
91 {0x5f, 0x6d, {0x135,1917,100, 1,0,0x00,0xae,0x20,0xf4,0x15,0x07,0x0}}, 91 {0x5f, 0x6d, {0x135,1917,100, 1,0,0x00,0xae,0x20,0xf4,0x15,0x07,0x0}},
92 {0x00, 0x7f, {0x06c,6375,100,-1,0,0x00,0xc2,0x28,0xf4,0x23,0x18,0x0}} 92 {0x00, 0x7f, {0x06c,6375,100,-1,0,0x00,0xc2,0x28,0xf4,0x23,0x18,0x0}}
93}; 93};
94static const opl4_region_t regions_03[] = { /* Honky-Tonk Piano */ 94static const struct opl4_region regions_03[] = { /* Honky-Tonk Piano */
95 {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xb4,0x20,0xf2,0x13,0x08,0x0}}, 95 {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xb4,0x20,0xf2,0x13,0x08,0x0}},
96 {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xb4,0x20,0xf2,0x14,0x08,0x0}}, 96 {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xb4,0x20,0xf2,0x14,0x08,0x0}},
97 {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xb4,0x20,0xf2,0x14,0x08,0x0}}, 97 {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xb4,0x20,0xf2,0x14,0x08,0x0}},
@@ -113,11 +113,11 @@ static const opl4_region_t regions_03[] = { /* Honky-Tonk Piano */
113 {0x53, 0x58, {0x134,1457,100, 0,0,0x01,0xb4,0x20,0xf3,0x14,0x18,0x0}}, 113 {0x53, 0x58, {0x134,1457,100, 0,0,0x01,0xb4,0x20,0xf3,0x14,0x18,0x0}},
114 {0x59, 0x6d, {0x135,1903,100, 0,0,0x00,0xb4,0x20,0xf4,0x15,0x08,0x0}} 114 {0x59, 0x6d, {0x135,1903,100, 0,0,0x00,0xb4,0x20,0xf4,0x15,0x08,0x0}}
115}; 115};
116static const opl4_region_t regions_04[] = { /* Electric Piano 1 */ 116static const struct opl4_region regions_04[] = { /* Electric Piano 1 */
117 {0x15, 0x6c, {0x00b,6570,100, 0,0,0x00,0x28,0x38,0xf0,0x00,0x0c,0x0}}, 117 {0x15, 0x6c, {0x00b,6570,100, 0,0,0x00,0x28,0x38,0xf0,0x00,0x0c,0x0}},
118 {0x00, 0x7f, {0x06c,6375,100, 0,2,0x00,0xb0,0x22,0xf4,0x23,0x19,0x0}} 118 {0x00, 0x7f, {0x06c,6375,100, 0,2,0x00,0xb0,0x22,0xf4,0x23,0x19,0x0}}
119}; 119};
120static const opl4_region_t regions_05[] = { /* Electric Piano 2 */ 120static const struct opl4_region regions_05[] = { /* Electric Piano 2 */
121 {0x14, 0x27, {0x12c,7476,100, 0,3,0x00,0xa2,0x1b,0xf2,0x13,0x08,0x0}}, 121 {0x14, 0x27, {0x12c,7476,100, 0,3,0x00,0xa2,0x1b,0xf2,0x13,0x08,0x0}},
122 {0x28, 0x2d, {0x12d,6818,100, 0,3,0x00,0xa2,0x1b,0xf2,0x14,0x08,0x0}}, 122 {0x28, 0x2d, {0x12d,6818,100, 0,3,0x00,0xa2,0x1b,0xf2,0x14,0x08,0x0}},
123 {0x2e, 0x33, {0x12e,5901,100, 0,3,0x00,0xa2,0x1b,0xf2,0x14,0x08,0x0}}, 123 {0x2e, 0x33, {0x12e,5901,100, 0,3,0x00,0xa2,0x1b,0xf2,0x14,0x08,0x0}},
@@ -139,103 +139,103 @@ static const opl4_region_t regions_05[] = { /* Electric Piano 2 */
139 {0x59, 0x5e, {0x134,1442,100, 0,0,0x0a,0xa2,0x18,0xf3,0x14,0x18,0x0}}, 139 {0x59, 0x5e, {0x134,1442,100, 0,0,0x0a,0xa2,0x18,0xf3,0x14,0x18,0x0}},
140 {0x5f, 0x6d, {0x135,1913,100, 0,0,0x00,0xa2,0x18,0xf4,0x15,0x08,0x0}} 140 {0x5f, 0x6d, {0x135,1913,100, 0,0,0x00,0xa2,0x18,0xf4,0x15,0x08,0x0}}
141}; 141};
142static const opl4_region_t regions_06[] = { /* Harpsichord */ 142static const struct opl4_region regions_06[] = { /* Harpsichord */
143 {0x15, 0x39, {0x080,5158,100, 0,0,0x00,0xb2,0x20,0xf5,0x24,0x19,0x0}}, 143 {0x15, 0x39, {0x080,5158,100, 0,0,0x00,0xb2,0x20,0xf5,0x24,0x19,0x0}},
144 {0x3a, 0x3f, {0x081,4408,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x09,0x0}}, 144 {0x3a, 0x3f, {0x081,4408,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x09,0x0}},
145 {0x40, 0x45, {0x082,3622,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x09,0x0}}, 145 {0x40, 0x45, {0x082,3622,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x09,0x0}},
146 {0x46, 0x4d, {0x083,2843,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x19,0x0}}, 146 {0x46, 0x4d, {0x083,2843,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x19,0x0}},
147 {0x4e, 0x6c, {0x084,1307,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x29,0x0}} 147 {0x4e, 0x6c, {0x084,1307,100, 0,0,0x00,0xb2,0x20,0xf5,0x25,0x29,0x0}}
148}; 148};
149static const opl4_region_t regions_07[] = { /* Clavinet */ 149static const struct opl4_region regions_07[] = { /* Clavinet */
150 {0x15, 0x51, {0x027,5009,100, 0,0,0x00,0xd2,0x28,0xf5,0x13,0x2b,0x0}}, 150 {0x15, 0x51, {0x027,5009,100, 0,0,0x00,0xd2,0x28,0xf5,0x13,0x2b,0x0}},
151 {0x52, 0x6c, {0x028,3495,100, 0,0,0x00,0xd2,0x28,0xf5,0x13,0x3b,0x0}} 151 {0x52, 0x6c, {0x028,3495,100, 0,0,0x00,0xd2,0x28,0xf5,0x13,0x3b,0x0}}
152}; 152};
153static const opl4_region_t regions_08[] = { /* Celesta */ 153static const struct opl4_region regions_08[] = { /* Celesta */
154 {0x15, 0x6c, {0x02b,3267,100, 0,0,0x00,0xdc,0x20,0xf4,0x15,0x07,0x3}} 154 {0x15, 0x6c, {0x02b,3267,100, 0,0,0x00,0xdc,0x20,0xf4,0x15,0x07,0x3}}
155}; 155};
156static const opl4_region_t regions_09[] = { /* Glockenspiel */ 156static const struct opl4_region regions_09[] = { /* Glockenspiel */
157 {0x15, 0x78, {0x0f3, 285,100, 0,0,0x00,0xc2,0x28,0xf6,0x25,0x25,0x0}} 157 {0x15, 0x78, {0x0f3, 285,100, 0,0,0x00,0xc2,0x28,0xf6,0x25,0x25,0x0}}
158}; 158};
159static const opl4_region_t regions_0a[] = { /* Music Box */ 159static const struct opl4_region regions_0a[] = { /* Music Box */
160 {0x15, 0x6c, {0x0f3,3362,100, 0,0,0x00,0xb6,0x20,0xa6,0x25,0x25,0x0}}, 160 {0x15, 0x6c, {0x0f3,3362,100, 0,0,0x00,0xb6,0x20,0xa6,0x25,0x25,0x0}},
161 {0x15, 0x6c, {0x101,4773,100, 0,0,0x00,0xaa,0x20,0xd4,0x14,0x16,0x0}} 161 {0x15, 0x6c, {0x101,4773,100, 0,0,0x00,0xaa,0x20,0xd4,0x14,0x16,0x0}}
162}; 162};
163static const opl4_region_t regions_0b[] = { /* Vibraphone */ 163static const struct opl4_region regions_0b[] = { /* Vibraphone */
164 {0x15, 0x6c, {0x101,4778,100, 0,0,0x00,0xc0,0x28,0xf4,0x14,0x16,0x4}} 164 {0x15, 0x6c, {0x101,4778,100, 0,0,0x00,0xc0,0x28,0xf4,0x14,0x16,0x4}}
165}; 165};
166static const opl4_region_t regions_0c[] = { /* Marimba */ 166static const struct opl4_region regions_0c[] = { /* Marimba */
167 {0x15, 0x3f, {0x0f4,4778,100, 0,0,0x00,0xc4,0x38,0xf7,0x47,0x08,0x0}}, 167 {0x15, 0x3f, {0x0f4,4778,100, 0,0,0x00,0xc4,0x38,0xf7,0x47,0x08,0x0}},
168 {0x40, 0x4c, {0x0f5,3217,100, 0,0,0x00,0xc4,0x38,0xf7,0x47,0x08,0x0}}, 168 {0x40, 0x4c, {0x0f5,3217,100, 0,0,0x00,0xc4,0x38,0xf7,0x47,0x08,0x0}},
169 {0x4d, 0x5a, {0x0f5,3217,100, 0,0,0x00,0xc4,0x38,0xf7,0x48,0x08,0x0}}, 169 {0x4d, 0x5a, {0x0f5,3217,100, 0,0,0x00,0xc4,0x38,0xf7,0x48,0x08,0x0}},
170 {0x5b, 0x7f, {0x0f5,3218,100, 0,0,0x00,0xc4,0x38,0xf7,0x48,0x18,0x0}} 170 {0x5b, 0x7f, {0x0f5,3218,100, 0,0,0x00,0xc4,0x38,0xf7,0x48,0x18,0x0}}
171}; 171};
172static const opl4_region_t regions_0d[] = { /* Xylophone */ 172static const struct opl4_region regions_0d[] = { /* Xylophone */
173 {0x00, 0x7f, {0x136,1729,100, 0,0,0x00,0xd2,0x38,0xf0,0x06,0x36,0x0}} 173 {0x00, 0x7f, {0x136,1729,100, 0,0,0x00,0xd2,0x38,0xf0,0x06,0x36,0x0}}
174}; 174};
175static const opl4_region_t regions_0e[] = { /* Tubular Bell */ 175static const struct opl4_region regions_0e[] = { /* Tubular Bell */
176 {0x01, 0x7f, {0x0ff,3999,100, 0,1,0x00,0x90,0x21,0xf4,0xa3,0x25,0x1}} 176 {0x01, 0x7f, {0x0ff,3999,100, 0,1,0x00,0x90,0x21,0xf4,0xa3,0x25,0x1}}
177}; 177};
178static const opl4_region_t regions_0f[] = { /* Dulcimer */ 178static const struct opl4_region regions_0f[] = { /* Dulcimer */
179 {0x00, 0x7f, {0x03f,4236,100, 0,1,0x00,0xbc,0x29,0xf5,0x16,0x07,0x0}}, 179 {0x00, 0x7f, {0x03f,4236,100, 0,1,0x00,0xbc,0x29,0xf5,0x16,0x07,0x0}},
180 {0x00, 0x7f, {0x040,4236,100, 0,2,0x0e,0x94,0x2a,0xf5,0x16,0x07,0x0}} 180 {0x00, 0x7f, {0x040,4236,100, 0,2,0x0e,0x94,0x2a,0xf5,0x16,0x07,0x0}}
181}; 181};
182static const opl4_region_t regions_10[] = { /* Drawbar Organ */ 182static const struct opl4_region regions_10[] = { /* Drawbar Organ */
183 {0x01, 0x7f, {0x08e,4394,100, 0,2,0x14,0xc2,0x3a,0xf0,0x00,0x0a,0x0}} 183 {0x01, 0x7f, {0x08e,4394,100, 0,2,0x14,0xc2,0x3a,0xf0,0x00,0x0a,0x0}}
184}; 184};
185static const opl4_region_t regions_11[] = { /* Percussive Organ */ 185static const struct opl4_region regions_11[] = { /* Percussive Organ */
186 {0x15, 0x3b, {0x08c,6062,100, 0,3,0x00,0xbe,0x3b,0xf0,0x00,0x09,0x0}}, 186 {0x15, 0x3b, {0x08c,6062,100, 0,3,0x00,0xbe,0x3b,0xf0,0x00,0x09,0x0}},
187 {0x3c, 0x6c, {0x08d,2984,100, 0,3,0x00,0xbe,0x3b,0xf0,0x00,0x09,0x0}} 187 {0x3c, 0x6c, {0x08d,2984,100, 0,3,0x00,0xbe,0x3b,0xf0,0x00,0x09,0x0}}
188}; 188};
189static const opl4_region_t regions_12[] = { /* Rock Organ */ 189static const struct opl4_region regions_12[] = { /* Rock Organ */
190 {0x15, 0x30, {0x128,6574,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, 190 {0x15, 0x30, {0x128,6574,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}},
191 {0x31, 0x3c, {0x129,5040,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, 191 {0x31, 0x3c, {0x129,5040,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}},
192 {0x3d, 0x48, {0x12a,3498,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, 192 {0x3d, 0x48, {0x12a,3498,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}},
193 {0x49, 0x54, {0x12b,1957,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}, 193 {0x49, 0x54, {0x12b,1957,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}},
194 {0x55, 0x6c, {0x127, 423,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}} 194 {0x55, 0x6c, {0x127, 423,100, 0,1,0x00,0xcc,0x39,0xf0,0x00,0x0a,0x0}}
195}; 195};
196static const opl4_region_t regions_13[] = { /* Church Organ */ 196static const struct opl4_region regions_13[] = { /* Church Organ */
197 {0x15, 0x29, {0x087,7466,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, 197 {0x15, 0x29, {0x087,7466,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}},
198 {0x2a, 0x30, {0x088,6456,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, 198 {0x2a, 0x30, {0x088,6456,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}},
199 {0x31, 0x38, {0x089,5428,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, 199 {0x31, 0x38, {0x089,5428,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}},
200 {0x39, 0x41, {0x08a,4408,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}, 200 {0x39, 0x41, {0x08a,4408,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}},
201 {0x42, 0x6c, {0x08b,3406,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}} 201 {0x42, 0x6c, {0x08b,3406,100, 0,1,0x00,0xc4,0x11,0xf0,0x00,0x09,0x0}}
202}; 202};
203static const opl4_region_t regions_14[] = { /* Reed Organ */ 203static const struct opl4_region regions_14[] = { /* Reed Organ */
204 {0x00, 0x53, {0x0ac,5570,100, 0,0,0x06,0xc0,0x38,0xf0,0x00,0x09,0x1}}, 204 {0x00, 0x53, {0x0ac,5570,100, 0,0,0x06,0xc0,0x38,0xf0,0x00,0x09,0x1}},
205 {0x54, 0x7f, {0x0ad,2497,100, 0,0,0x00,0xc0,0x38,0xf0,0x00,0x09,0x1}} 205 {0x54, 0x7f, {0x0ad,2497,100, 0,0,0x00,0xc0,0x38,0xf0,0x00,0x09,0x1}}
206}; 206};
207static const opl4_region_t regions_15[] = { /* Accordion */ 207static const struct opl4_region regions_15[] = { /* Accordion */
208 {0x15, 0x4c, {0x006,4261,100, 0,2,0x00,0xa4,0x22,0x90,0x00,0x09,0x0}}, 208 {0x15, 0x4c, {0x006,4261,100, 0,2,0x00,0xa4,0x22,0x90,0x00,0x09,0x0}},
209 {0x4d, 0x6c, {0x007,1530,100, 0,2,0x00,0xa4,0x22,0x90,0x00,0x09,0x0}}, 209 {0x4d, 0x6c, {0x007,1530,100, 0,2,0x00,0xa4,0x22,0x90,0x00,0x09,0x0}},
210 {0x15, 0x6c, {0x070,4391,100, 0,3,0x00,0x8a,0x23,0xa0,0x00,0x09,0x0}} 210 {0x15, 0x6c, {0x070,4391,100, 0,3,0x00,0x8a,0x23,0xa0,0x00,0x09,0x0}}
211}; 211};
212static const opl4_region_t regions_16[] = { /* Harmonica */ 212static const struct opl4_region regions_16[] = { /* Harmonica */
213 {0x15, 0x6c, {0x070,4408,100, 0,0,0x00,0xae,0x30,0xa0,0x00,0x09,0x2}} 213 {0x15, 0x6c, {0x070,4408,100, 0,0,0x00,0xae,0x30,0xa0,0x00,0x09,0x2}}
214}; 214};
215static const opl4_region_t regions_17[] = { /* Tango Accordion */ 215static const struct opl4_region regions_17[] = { /* Tango Accordion */
216 {0x00, 0x53, {0x0ac,5573,100, 0,0,0x00,0xae,0x38,0xf0,0x00,0x09,0x0}}, 216 {0x00, 0x53, {0x0ac,5573,100, 0,0,0x00,0xae,0x38,0xf0,0x00,0x09,0x0}},
217 {0x54, 0x7f, {0x0ad,2500,100, 0,0,0x00,0xae,0x38,0xf0,0x00,0x09,0x0}}, 217 {0x54, 0x7f, {0x0ad,2500,100, 0,0,0x00,0xae,0x38,0xf0,0x00,0x09,0x0}},
218 {0x15, 0x6c, {0x041,8479,100, 0,2,0x00,0x6a,0x3a,0x75,0x20,0x0a,0x0}} 218 {0x15, 0x6c, {0x041,8479,100, 0,2,0x00,0x6a,0x3a,0x75,0x20,0x0a,0x0}}
219}; 219};
220static const opl4_region_t regions_18[] = { /* Nylon Guitar */ 220static const struct opl4_region regions_18[] = { /* Nylon Guitar */
221 {0x15, 0x2f, {0x0b3,6964,100, 0,0,0x05,0xca,0x28,0xf5,0x34,0x09,0x0}}, 221 {0x15, 0x2f, {0x0b3,6964,100, 0,0,0x05,0xca,0x28,0xf5,0x34,0x09,0x0}},
222 {0x30, 0x36, {0x0b7,5567,100, 0,0,0x0c,0xca,0x28,0xf5,0x34,0x09,0x0}}, 222 {0x30, 0x36, {0x0b7,5567,100, 0,0,0x0c,0xca,0x28,0xf5,0x34,0x09,0x0}},
223 {0x37, 0x3c, {0x0b5,4653,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}}, 223 {0x37, 0x3c, {0x0b5,4653,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}},
224 {0x3d, 0x43, {0x0b4,3892,100, 0,0,0x00,0xca,0x28,0xf6,0x35,0x09,0x0}}, 224 {0x3d, 0x43, {0x0b4,3892,100, 0,0,0x00,0xca,0x28,0xf6,0x35,0x09,0x0}},
225 {0x44, 0x60, {0x0b6,2723,100, 0,0,0x00,0xca,0x28,0xf6,0x35,0x19,0x0}} 225 {0x44, 0x60, {0x0b6,2723,100, 0,0,0x00,0xca,0x28,0xf6,0x35,0x19,0x0}}
226}; 226};
227static const opl4_region_t regions_19[] = { /* Steel Guitar */ 227static const struct opl4_region regions_19[] = { /* Steel Guitar */
228 {0x15, 0x31, {0x00c,6937,100, 0,0,0x00,0xbc,0x28,0xf0,0x04,0x19,0x0}}, 228 {0x15, 0x31, {0x00c,6937,100, 0,0,0x00,0xbc,0x28,0xf0,0x04,0x19,0x0}},
229 {0x32, 0x38, {0x00d,5410,100, 0,0,0x00,0xbc,0x28,0xf0,0x05,0x09,0x0}}, 229 {0x32, 0x38, {0x00d,5410,100, 0,0,0x00,0xbc,0x28,0xf0,0x05,0x09,0x0}},
230 {0x39, 0x47, {0x00e,4379,100, 0,0,0x00,0xbc,0x28,0xf5,0x94,0x09,0x0}}, 230 {0x39, 0x47, {0x00e,4379,100, 0,0,0x00,0xbc,0x28,0xf5,0x94,0x09,0x0}},
231 {0x48, 0x6c, {0x00f,2843,100, 0,0,0x00,0xbc,0x28,0xf6,0x95,0x09,0x0}} 231 {0x48, 0x6c, {0x00f,2843,100, 0,0,0x00,0xbc,0x28,0xf6,0x95,0x09,0x0}}
232}; 232};
233static const opl4_region_t regions_1a[] = { /* Jazz Guitar */ 233static const struct opl4_region regions_1a[] = { /* Jazz Guitar */
234 {0x15, 0x31, {0x05a,6832,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}}, 234 {0x15, 0x31, {0x05a,6832,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}},
235 {0x32, 0x3f, {0x05b,4897,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}}, 235 {0x32, 0x3f, {0x05b,4897,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}},
236 {0x40, 0x6c, {0x05c,3218,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}} 236 {0x40, 0x6c, {0x05c,3218,100, 0,0,0x00,0xca,0x28,0xf6,0x34,0x09,0x0}}
237}; 237};
238static const opl4_region_t regions_1b[] = { /* Clean Guitar */ 238static const struct opl4_region regions_1b[] = { /* Clean Guitar */
239 {0x15, 0x2c, {0x061,7053,100, 0,1,0x00,0xb4,0x29,0xf5,0x54,0x0a,0x0}}, 239 {0x15, 0x2c, {0x061,7053,100, 0,1,0x00,0xb4,0x29,0xf5,0x54,0x0a,0x0}},
240 {0x2d, 0x31, {0x060,6434,100, 0,1,0x00,0xb4,0x29,0xf5,0x54,0x0a,0x0}}, 240 {0x2d, 0x31, {0x060,6434,100, 0,1,0x00,0xb4,0x29,0xf5,0x54,0x0a,0x0}},
241 {0x32, 0x38, {0x063,5764,100, 0,1,0x00,0xbe,0x29,0xf5,0x55,0x0a,0x0}}, 241 {0x32, 0x38, {0x063,5764,100, 0,1,0x00,0xbe,0x29,0xf5,0x55,0x0a,0x0}},
@@ -245,14 +245,14 @@ static const opl4_region_t regions_1b[] = { /* Clean Guitar */
245 {0x4c, 0x54, {0x066,2462,100, 0,1,0x00,0xb4,0x29,0xf5,0x55,0x2a,0x0}}, 245 {0x4c, 0x54, {0x066,2462,100, 0,1,0x00,0xb4,0x29,0xf5,0x55,0x2a,0x0}},
246 {0x55, 0x6c, {0x067,1307,100, 0,1,0x00,0xb4,0x29,0xf6,0x56,0x0a,0x0}} 246 {0x55, 0x6c, {0x067,1307,100, 0,1,0x00,0xb4,0x29,0xf6,0x56,0x0a,0x0}}
247}; 247};
248static const opl4_region_t regions_1c[] = { /* Muted Guitar */ 248static const struct opl4_region regions_1c[] = { /* Muted Guitar */
249 {0x01, 0x7f, {0x068,4408,100, 0,0,0x00,0xcc,0x28,0xf6,0x15,0x09,0x0}} 249 {0x01, 0x7f, {0x068,4408,100, 0,0,0x00,0xcc,0x28,0xf6,0x15,0x09,0x0}}
250}; 250};
251static const opl4_region_t regions_1d[] = { /* Overdriven Guitar */ 251static const struct opl4_region regions_1d[] = { /* Overdriven Guitar */
252 {0x00, 0x40, {0x0a5,6589,100, 0,1,0x00,0xc0,0x29,0xf2,0x11,0x09,0x0}}, 252 {0x00, 0x40, {0x0a5,6589,100, 0,1,0x00,0xc0,0x29,0xf2,0x11,0x09,0x0}},
253 {0x41, 0x7f, {0x0a6,5428,100, 0,1,0x00,0xc0,0x29,0xf2,0x11,0x09,0x0}} 253 {0x41, 0x7f, {0x0a6,5428,100, 0,1,0x00,0xc0,0x29,0xf2,0x11,0x09,0x0}}
254}; 254};
255static const opl4_region_t regions_1e[] = { /* Distortion Guitar */ 255static const struct opl4_region regions_1e[] = { /* Distortion Guitar */
256 {0x15, 0x2a, {0x051,6928,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}}, 256 {0x15, 0x2a, {0x051,6928,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}},
257 {0x2b, 0x2e, {0x052,6433,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}}, 257 {0x2b, 0x2e, {0x052,6433,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}},
258 {0x2f, 0x32, {0x053,5944,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}}, 258 {0x2f, 0x32, {0x053,5944,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}},
@@ -263,44 +263,44 @@ static const opl4_region_t regions_1e[] = { /* Distortion Guitar */
263 {0x43, 0x46, {0x058,3361,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}}, 263 {0x43, 0x46, {0x058,3361,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}},
264 {0x47, 0x6c, {0x059,2784,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}} 264 {0x47, 0x6c, {0x059,2784,100, 0,1,0x00,0xbc,0x21,0xa2,0x12,0x0a,0x0}}
265}; 265};
266static const opl4_region_t regions_1f[] = { /* Guitar Harmonics */ 266static const struct opl4_region regions_1f[] = { /* Guitar Harmonics */
267 {0x15, 0x44, {0x05e,5499,100, 0,0,0x00,0xce,0x28,0xf4,0x24,0x09,0x0}}, 267 {0x15, 0x44, {0x05e,5499,100, 0,0,0x00,0xce,0x28,0xf4,0x24,0x09,0x0}},
268 {0x45, 0x49, {0x05d,4850,100, 0,0,0x00,0xe2,0x28,0xf4,0x24,0x09,0x0}}, 268 {0x45, 0x49, {0x05d,4850,100, 0,0,0x00,0xe2,0x28,0xf4,0x24,0x09,0x0}},
269 {0x4a, 0x6c, {0x05f,4259,100, 0,0,0x00,0xce,0x28,0xf4,0x24,0x09,0x0}} 269 {0x4a, 0x6c, {0x05f,4259,100, 0,0,0x00,0xce,0x28,0xf4,0x24,0x09,0x0}}
270}; 270};
271static const opl4_region_t regions_20[] = { /* Acoustic Bass */ 271static const struct opl4_region regions_20[] = { /* Acoustic Bass */
272 {0x15, 0x30, {0x004,8053,100, 0,0,0x00,0xe2,0x18,0xf5,0x15,0x09,0x0}}, 272 {0x15, 0x30, {0x004,8053,100, 0,0,0x00,0xe2,0x18,0xf5,0x15,0x09,0x0}},
273 {0x31, 0x6c, {0x005,4754,100, 0,0,0x00,0xe2,0x18,0xf5,0x15,0x09,0x0}} 273 {0x31, 0x6c, {0x005,4754,100, 0,0,0x00,0xe2,0x18,0xf5,0x15,0x09,0x0}}
274}; 274};
275static const opl4_region_t regions_21[] = { /* Fingered Bass */ 275static const struct opl4_region regions_21[] = { /* Fingered Bass */
276 {0x01, 0x20, {0x04a,8762,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}}, 276 {0x01, 0x20, {0x04a,8762,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}},
277 {0x21, 0x25, {0x04b,8114,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}}, 277 {0x21, 0x25, {0x04b,8114,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}},
278 {0x26, 0x2a, {0x04c,7475,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}}, 278 {0x26, 0x2a, {0x04c,7475,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}},
279 {0x2b, 0x7f, {0x04d,6841,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}} 279 {0x2b, 0x7f, {0x04d,6841,100, 0,0,0x00,0xde,0x18,0xf6,0x14,0x09,0x0}}
280}; 280};
281static const opl4_region_t regions_22[] = { /* Picked Bass */ 281static const struct opl4_region regions_22[] = { /* Picked Bass */
282 {0x15, 0x23, {0x04f,7954,100, 0,0,0x00,0xcc,0x18,0xf3,0x90,0x0a,0x0}}, 282 {0x15, 0x23, {0x04f,7954,100, 0,0,0x00,0xcc,0x18,0xf3,0x90,0x0a,0x0}},
283 {0x24, 0x2a, {0x050,7318,100, 0,0,0x05,0xcc,0x18,0xf3,0x90,0x1a,0x0}}, 283 {0x24, 0x2a, {0x050,7318,100, 0,0,0x05,0xcc,0x18,0xf3,0x90,0x1a,0x0}},
284 {0x2b, 0x2f, {0x06b,6654,100, 0,0,0x00,0xcc,0x18,0xf3,0x90,0x2a,0x0}}, 284 {0x2b, 0x2f, {0x06b,6654,100, 0,0,0x00,0xcc,0x18,0xf3,0x90,0x2a,0x0}},
285 {0x30, 0x47, {0x069,6031,100, 0,0,0x00,0xcc,0x18,0xf5,0xb0,0x0a,0x0}}, 285 {0x30, 0x47, {0x069,6031,100, 0,0,0x00,0xcc,0x18,0xf5,0xb0,0x0a,0x0}},
286 {0x48, 0x6c, {0x06a,5393,100, 0,0,0x00,0xcc,0x18,0xf5,0xb0,0x0a,0x0}} 286 {0x48, 0x6c, {0x06a,5393,100, 0,0,0x00,0xcc,0x18,0xf5,0xb0,0x0a,0x0}}
287}; 287};
288static const opl4_region_t regions_23[] = { /* Fretless Bass */ 288static const struct opl4_region regions_23[] = { /* Fretless Bass */
289 {0x01, 0x7f, {0x04e,5297,100, 0,0,0x00,0xd2,0x10,0xf3,0x63,0x19,0x0}} 289 {0x01, 0x7f, {0x04e,5297,100, 0,0,0x00,0xd2,0x10,0xf3,0x63,0x19,0x0}}
290}; 290};
291static const opl4_region_t regions_24[] = { /* Slap Bass 1 */ 291static const struct opl4_region regions_24[] = { /* Slap Bass 1 */
292 {0x15, 0x6c, {0x0a3,7606,100, 0,1,0x00,0xde,0x19,0xf5,0x32,0x1a,0x0}} 292 {0x15, 0x6c, {0x0a3,7606,100, 0,1,0x00,0xde,0x19,0xf5,0x32,0x1a,0x0}}
293}; 293};
294static const opl4_region_t regions_25[] = { /* Slap Bass 2 */ 294static const struct opl4_region regions_25[] = { /* Slap Bass 2 */
295 {0x01, 0x7f, {0x0a2,6694,100, 0,0,0x00,0xda,0x20,0xb0,0x02,0x09,0x0}} 295 {0x01, 0x7f, {0x0a2,6694,100, 0,0,0x00,0xda,0x20,0xb0,0x02,0x09,0x0}}
296}; 296};
297static const opl4_region_t regions_26[] = { /* Synth Bass 1 */ 297static const struct opl4_region regions_26[] = { /* Synth Bass 1 */
298 {0x15, 0x6c, {0x0be,7466,100, 0,1,0x00,0xb8,0x39,0xf4,0x14,0x09,0x0}} 298 {0x15, 0x6c, {0x0be,7466,100, 0,1,0x00,0xb8,0x39,0xf4,0x14,0x09,0x0}}
299}; 299};
300static const opl4_region_t regions_27[] = { /* Synth Bass 2 */ 300static const struct opl4_region regions_27[] = { /* Synth Bass 2 */
301 {0x00, 0x7f, {0x117,8103,100, 0,1,0x00,0xca,0x39,0xf3,0x50,0x08,0x0}} 301 {0x00, 0x7f, {0x117,8103,100, 0,1,0x00,0xca,0x39,0xf3,0x50,0x08,0x0}}
302}; 302};
303static const opl4_region_t regions_28[] = { /* Violin */ 303static const struct opl4_region regions_28[] = { /* Violin */
304 {0x15, 0x3a, {0x105,5158,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}}, 304 {0x15, 0x3a, {0x105,5158,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}},
305 {0x3b, 0x3f, {0x102,4754,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}}, 305 {0x3b, 0x3f, {0x102,4754,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}},
306 {0x40, 0x41, {0x106,4132,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}}, 306 {0x40, 0x41, {0x106,4132,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}},
@@ -312,7 +312,7 @@ static const opl4_region_t regions_28[] = { /* Violin */
312 {0x4f, 0x51, {0x10d,2166,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}}, 312 {0x4f, 0x51, {0x10d,2166,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}},
313 {0x52, 0x6c, {0x109,1825,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}} 313 {0x52, 0x6c, {0x109,1825,100, 0,3,0x00,0xcc,0x3b,0xf3,0x20,0x09,0x0}}
314}; 314};
315static const opl4_region_t regions_29[] = { /* Viola */ 315static const struct opl4_region regions_29[] = { /* Viola */
316 {0x15, 0x32, {0x103,5780,100, 0,3,0x00,0xc4,0x3b,0xa3,0x20,0x09,0x0}}, 316 {0x15, 0x32, {0x103,5780,100, 0,3,0x00,0xc4,0x3b,0xa3,0x20,0x09,0x0}},
317 {0x33, 0x35, {0x104,5534,100, 0,3,0x00,0xc4,0x3b,0xa3,0x20,0x09,0x0}}, 317 {0x33, 0x35, {0x104,5534,100, 0,3,0x00,0xc4,0x3b,0xa3,0x20,0x09,0x0}},
318 {0x36, 0x38, {0x105,5158,100, 0,3,0x00,0xc4,0x3b,0xa3,0x20,0x09,0x0}}, 318 {0x36, 0x38, {0x105,5158,100, 0,3,0x00,0xc4,0x3b,0xa3,0x20,0x09,0x0}},
@@ -326,76 +326,76 @@ static const opl4_region_t regions_29[] = { /* Viola */
326 {0x4d, 0x4f, {0x10d,2166,100, 0,3,0x00,0xd0,0x3b,0xa3,0x20,0x09,0x0}}, 326 {0x4d, 0x4f, {0x10d,2166,100, 0,3,0x00,0xd0,0x3b,0xa3,0x20,0x09,0x0}},
327 {0x50, 0x6c, {0x109,1825,100, 0,3,0x00,0xd0,0x3b,0xa3,0x20,0x09,0x0}} 327 {0x50, 0x6c, {0x109,1825,100, 0,3,0x00,0xd0,0x3b,0xa3,0x20,0x09,0x0}}
328}; 328};
329static const opl4_region_t regions_2a[] = { /* Cello */ 329static const struct opl4_region regions_2a[] = { /* Cello */
330 {0x15, 0x2d, {0x112,6545,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x08,0x0}}, 330 {0x15, 0x2d, {0x112,6545,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x08,0x0}},
331 {0x2e, 0x37, {0x113,5764,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x08,0x0}}, 331 {0x2e, 0x37, {0x113,5764,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x08,0x0}},
332 {0x38, 0x3e, {0x115,4378,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x18,0x0}}, 332 {0x38, 0x3e, {0x115,4378,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x18,0x0}},
333 {0x3f, 0x44, {0x116,3998,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x18,0x0}}, 333 {0x3f, 0x44, {0x116,3998,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x18,0x0}},
334 {0x45, 0x6c, {0x114,3218,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x18,0x0}} 334 {0x45, 0x6c, {0x114,3218,100, 0,3,0x00,0xc0,0x33,0xa0,0x00,0x18,0x0}}
335}; 335};
336static const opl4_region_t regions_2b[] = { /* Contrabass */ 336static const struct opl4_region regions_2b[] = { /* Contrabass */
337 {0x15, 0x29, {0x110,7713,100, 0,1,0x00,0xc2,0x19,0x90,0x00,0x09,0x0}}, 337 {0x15, 0x29, {0x110,7713,100, 0,1,0x00,0xc2,0x19,0x90,0x00,0x09,0x0}},
338 {0x2a, 0x6c, {0x111,6162,100, 0,1,0x00,0xc2,0x19,0x90,0x00,0x09,0x0}} 338 {0x2a, 0x6c, {0x111,6162,100, 0,1,0x00,0xc2,0x19,0x90,0x00,0x09,0x0}}
339}; 339};
340static const opl4_region_t regions_2c[] = { /* Tremolo Strings */ 340static const struct opl4_region regions_2c[] = { /* Tremolo Strings */
341 {0x15, 0x3b, {0x0b0,4810,100, 0,0,0x0a,0xde,0x38,0xf0,0x00,0x07,0x6}}, 341 {0x15, 0x3b, {0x0b0,4810,100, 0,0,0x0a,0xde,0x38,0xf0,0x00,0x07,0x6}},
342 {0x3c, 0x41, {0x035,4035,100, 0,0,0x05,0xde,0x38,0xf0,0x00,0x07,0x6}}, 342 {0x3c, 0x41, {0x035,4035,100, 0,0,0x05,0xde,0x38,0xf0,0x00,0x07,0x6}},
343 {0x42, 0x47, {0x033,3129,100, 0,0,0x05,0xde,0x38,0xf0,0x00,0x07,0x6}}, 343 {0x42, 0x47, {0x033,3129,100, 0,0,0x05,0xde,0x38,0xf0,0x00,0x07,0x6}},
344 {0x48, 0x52, {0x034,2625,100, 0,0,0x05,0xde,0x38,0xf0,0x00,0x07,0x6}}, 344 {0x48, 0x52, {0x034,2625,100, 0,0,0x05,0xde,0x38,0xf0,0x00,0x07,0x6}},
345 {0x53, 0x6c, {0x0af, 936,100, 0,0,0x00,0xde,0x38,0xf0,0x00,0x07,0x6}} 345 {0x53, 0x6c, {0x0af, 936,100, 0,0,0x00,0xde,0x38,0xf0,0x00,0x07,0x6}}
346}; 346};
347static const opl4_region_t regions_2d[] = { /* Pizzicato Strings */ 347static const struct opl4_region regions_2d[] = { /* Pizzicato Strings */
348 {0x15, 0x32, {0x0b8,6186,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}}, 348 {0x15, 0x32, {0x0b8,6186,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}},
349 {0x33, 0x3b, {0x0b9,5031,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}}, 349 {0x33, 0x3b, {0x0b9,5031,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}},
350 {0x3c, 0x42, {0x0bb,4146,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}}, 350 {0x3c, 0x42, {0x0bb,4146,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}},
351 {0x43, 0x48, {0x0ba,3245,100, 0,0,0x00,0xc2,0x28,0xf0,0x00,0x05,0x0}}, 351 {0x43, 0x48, {0x0ba,3245,100, 0,0,0x00,0xc2,0x28,0xf0,0x00,0x05,0x0}},
352 {0x49, 0x6c, {0x0bc,2352,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}} 352 {0x49, 0x6c, {0x0bc,2352,100, 0,0,0x00,0xbc,0x28,0xf0,0x00,0x05,0x0}}
353}; 353};
354static const opl4_region_t regions_2e[] = { /* Harp */ 354static const struct opl4_region regions_2e[] = { /* Harp */
355 {0x15, 0x46, {0x07e,3740,100, 0,1,0x00,0xd2,0x29,0xf5,0x25,0x07,0x0}}, 355 {0x15, 0x46, {0x07e,3740,100, 0,1,0x00,0xd2,0x29,0xf5,0x25,0x07,0x0}},
356 {0x47, 0x6c, {0x07f,2319,100, 0,1,0x00,0xd2,0x29,0xf5,0x25,0x07,0x0}} 356 {0x47, 0x6c, {0x07f,2319,100, 0,1,0x00,0xd2,0x29,0xf5,0x25,0x07,0x0}}
357}; 357};
358static const opl4_region_t regions_2f[] = { /* Timpani */ 358static const struct opl4_region regions_2f[] = { /* Timpani */
359 {0x15, 0x6c, {0x100,6570,100, 0,0,0x00,0xf8,0x28,0xf0,0x05,0x16,0x0}} 359 {0x15, 0x6c, {0x100,6570,100, 0,0,0x00,0xf8,0x28,0xf0,0x05,0x16,0x0}}
360}; 360};
361static const opl4_region_t regions_30[] = { /* Strings */ 361static const struct opl4_region regions_30[] = { /* Strings */
362 {0x15, 0x3b, {0x13c,4806,100, 0,0,0x00,0xc8,0x20,0x80,0x00,0x07,0x0}}, 362 {0x15, 0x3b, {0x13c,4806,100, 0,0,0x00,0xc8,0x20,0x80,0x00,0x07,0x0}},
363 {0x3c, 0x41, {0x13e,4035,100, 0,0,0x00,0xc8,0x20,0x80,0x00,0x07,0x0}}, 363 {0x3c, 0x41, {0x13e,4035,100, 0,0,0x00,0xc8,0x20,0x80,0x00,0x07,0x0}},
364 {0x42, 0x47, {0x13d,3122,100, 0,0,0x00,0xc8,0x20,0x80,0x00,0x07,0x0}}, 364 {0x42, 0x47, {0x13d,3122,100, 0,0,0x00,0xc8,0x20,0x80,0x00,0x07,0x0}},
365 {0x48, 0x52, {0x13f,2629,100, 0,0,0x00,0xbe,0x20,0x80,0x00,0x07,0x0}}, 365 {0x48, 0x52, {0x13f,2629,100, 0,0,0x00,0xbe,0x20,0x80,0x00,0x07,0x0}},
366 {0x53, 0x6c, {0x140, 950,100, 0,0,0x00,0xbe,0x20,0x80,0x00,0x07,0x0}} 366 {0x53, 0x6c, {0x140, 950,100, 0,0,0x00,0xbe,0x20,0x80,0x00,0x07,0x0}}
367}; 367};
368static const opl4_region_t regions_31[] = { /* Slow Strings */ 368static const struct opl4_region regions_31[] = { /* Slow Strings */
369 {0x15, 0x3b, {0x0b0,4810,100, 0,1,0x0a,0xbe,0x19,0xf0,0x00,0x07,0x0}}, 369 {0x15, 0x3b, {0x0b0,4810,100, 0,1,0x0a,0xbe,0x19,0xf0,0x00,0x07,0x0}},
370 {0x3c, 0x41, {0x035,4035,100, 0,1,0x05,0xbe,0x19,0xf0,0x00,0x07,0x0}}, 370 {0x3c, 0x41, {0x035,4035,100, 0,1,0x05,0xbe,0x19,0xf0,0x00,0x07,0x0}},
371 {0x42, 0x47, {0x033,3129,100, 0,1,0x05,0xbe,0x19,0xf0,0x00,0x07,0x0}}, 371 {0x42, 0x47, {0x033,3129,100, 0,1,0x05,0xbe,0x19,0xf0,0x00,0x07,0x0}},
372 {0x48, 0x52, {0x034,2625,100, 0,1,0x05,0xbe,0x19,0xf0,0x00,0x07,0x0}}, 372 {0x48, 0x52, {0x034,2625,100, 0,1,0x05,0xbe,0x19,0xf0,0x00,0x07,0x0}},
373 {0x53, 0x6c, {0x0af, 936,100, 0,1,0x00,0xbe,0x19,0xf0,0x00,0x07,0x0}} 373 {0x53, 0x6c, {0x0af, 936,100, 0,1,0x00,0xbe,0x19,0xf0,0x00,0x07,0x0}}
374}; 374};
375static const opl4_region_t regions_32[] = { /* Synth Strings 1 */ 375static const struct opl4_region regions_32[] = { /* Synth Strings 1 */
376 {0x05, 0x71, {0x002,6045,100,-2,0,0x00,0xa6,0x20,0x93,0x22,0x06,0x0}}, 376 {0x05, 0x71, {0x002,6045,100,-2,0,0x00,0xa6,0x20,0x93,0x22,0x06,0x0}},
377 {0x15, 0x6c, {0x0ae,3261,100, 2,0,0x00,0xc6,0x20,0x70,0x01,0x06,0x0}} 377 {0x15, 0x6c, {0x0ae,3261,100, 2,0,0x00,0xc6,0x20,0x70,0x01,0x06,0x0}}
378}; 378};
379static const opl4_region_t regions_33[] = { /* Synth Strings 2 */ 379static const struct opl4_region regions_33[] = { /* Synth Strings 2 */
380 {0x15, 0x6c, {0x002,4513,100, 5,1,0x00,0xb4,0x19,0x70,0x00,0x06,0x0}}, 380 {0x15, 0x6c, {0x002,4513,100, 5,1,0x00,0xb4,0x19,0x70,0x00,0x06,0x0}},
381 {0x15, 0x6c, {0x002,4501,100,-5,1,0x00,0xb4,0x19,0x70,0x00,0x06,0x0}} 381 {0x15, 0x6c, {0x002,4501,100,-5,1,0x00,0xb4,0x19,0x70,0x00,0x06,0x0}}
382}; 382};
383static const opl4_region_t regions_34[] = { /* Choir Aahs */ 383static const struct opl4_region regions_34[] = { /* Choir Aahs */
384 {0x15, 0x3a, {0x018,5010,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}}, 384 {0x15, 0x3a, {0x018,5010,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}},
385 {0x3b, 0x40, {0x019,4370,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}}, 385 {0x3b, 0x40, {0x019,4370,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}},
386 {0x41, 0x47, {0x01a,3478,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}}, 386 {0x41, 0x47, {0x01a,3478,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}},
387 {0x48, 0x6c, {0x01b,2197,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}} 387 {0x48, 0x6c, {0x01b,2197,100, 0,2,0x00,0xc2,0x1a,0x70,0x00,0x08,0x0}}
388}; 388};
389static const opl4_region_t regions_35[] = { /* Voice Oohs */ 389static const struct opl4_region regions_35[] = { /* Voice Oohs */
390 {0x15, 0x6c, {0x029,3596,100, 0,0,0x00,0xe6,0x20,0xf7,0x20,0x08,0x0}} 390 {0x15, 0x6c, {0x029,3596,100, 0,0,0x00,0xe6,0x20,0xf7,0x20,0x08,0x0}}
391}; 391};
392static const opl4_region_t regions_36[] = { /* Synth Voice */ 392static const struct opl4_region regions_36[] = { /* Synth Voice */
393 {0x15, 0x6c, {0x02a,3482,100, 0,1,0x00,0xc2,0x19,0x85,0x21,0x07,0x0}} 393 {0x15, 0x6c, {0x02a,3482,100, 0,1,0x00,0xc2,0x19,0x85,0x21,0x07,0x0}}
394}; 394};
395static const opl4_region_t regions_37[] = { /* Orchestra Hit */ 395static const struct opl4_region regions_37[] = { /* Orchestra Hit */
396 {0x15, 0x6c, {0x049,4394,100, 0,0,0x00,0xfe,0x30,0x80,0x05,0x05,0x0}} 396 {0x15, 0x6c, {0x049,4394,100, 0,0,0x00,0xfe,0x30,0x80,0x05,0x05,0x0}}
397}; 397};
398static const opl4_region_t regions_38[] = { /* Trumpet */ 398static const struct opl4_region regions_38[] = { /* Trumpet */
399 {0x15, 0x3c, {0x0f6,4706,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}}, 399 {0x15, 0x3c, {0x0f6,4706,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}},
400 {0x3d, 0x43, {0x0f8,3894,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}}, 400 {0x3d, 0x43, {0x0f8,3894,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}},
401 {0x44, 0x48, {0x0f7,3118,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}}, 401 {0x44, 0x48, {0x0f7,3118,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}},
@@ -403,28 +403,28 @@ static const opl4_region_t regions_38[] = { /* Trumpet */
403 {0x4f, 0x55, {0x0f9,1634,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}}, 403 {0x4f, 0x55, {0x0f9,1634,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}},
404 {0x56, 0x6c, {0x0fb, 786,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}} 404 {0x56, 0x6c, {0x0fb, 786,100, 0,2,0x00,0xd6,0x32,0xf3,0x20,0x0a,0x0}}
405}; 405};
406static const opl4_region_t regions_39[] = { /* Trombone */ 406static const struct opl4_region regions_39[] = { /* Trombone */
407 {0x15, 0x3a, {0x0f0,5053,100, 0,1,0x00,0xd6,0x21,0xf0,0x00,0x09,0x0}}, 407 {0x15, 0x3a, {0x0f0,5053,100, 0,1,0x00,0xd6,0x21,0xf0,0x00,0x09,0x0}},
408 {0x3b, 0x3f, {0x0f1,4290,100, 0,1,0x00,0xd6,0x21,0xf0,0x00,0x09,0x0}}, 408 {0x3b, 0x3f, {0x0f1,4290,100, 0,1,0x00,0xd6,0x21,0xf0,0x00,0x09,0x0}},
409 {0x40, 0x6c, {0x0f2,3580,100, 0,1,0x00,0xd6,0x21,0xf0,0x00,0x09,0x0}} 409 {0x40, 0x6c, {0x0f2,3580,100, 0,1,0x00,0xd6,0x21,0xf0,0x00,0x09,0x0}}
410}; 410};
411static const opl4_region_t regions_3a[] = { /* Tuba */ 411static const struct opl4_region regions_3a[] = { /* Tuba */
412 {0x15, 0x2d, {0x085,7096,100, 0,1,0x00,0xde,0x21,0xf5,0x10,0x09,0x0}}, 412 {0x15, 0x2d, {0x085,7096,100, 0,1,0x00,0xde,0x21,0xf5,0x10,0x09,0x0}},
413 {0x2e, 0x6c, {0x086,6014,100, 0,1,0x00,0xde,0x21,0xf5,0x10,0x09,0x0}} 413 {0x2e, 0x6c, {0x086,6014,100, 0,1,0x00,0xde,0x21,0xf5,0x10,0x09,0x0}}
414}; 414};
415static const opl4_region_t regions_3b[] = { /* Muted Trumpet */ 415static const struct opl4_region regions_3b[] = { /* Muted Trumpet */
416 {0x15, 0x45, {0x0b1,4135,100, 0,0,0x00,0xcc,0x28,0xf3,0x10,0x0a,0x1}}, 416 {0x15, 0x45, {0x0b1,4135,100, 0,0,0x00,0xcc,0x28,0xf3,0x10,0x0a,0x1}},
417 {0x46, 0x6c, {0x0b2,2599,100, 0,0,0x00,0xcc,0x28,0x83,0x10,0x0a,0x1}} 417 {0x46, 0x6c, {0x0b2,2599,100, 0,0,0x00,0xcc,0x28,0x83,0x10,0x0a,0x1}}
418}; 418};
419static const opl4_region_t regions_3c[] = { /* French Horns */ 419static const struct opl4_region regions_3c[] = { /* French Horns */
420 {0x15, 0x49, {0x07c,3624,100, 0,2,0x00,0xd0,0x1a,0xf0,0x00,0x09,0x0}}, 420 {0x15, 0x49, {0x07c,3624,100, 0,2,0x00,0xd0,0x1a,0xf0,0x00,0x09,0x0}},
421 {0x4a, 0x6c, {0x07d,2664,100, 0,2,0x00,0xd0,0x1a,0xf0,0x00,0x09,0x0}} 421 {0x4a, 0x6c, {0x07d,2664,100, 0,2,0x00,0xd0,0x1a,0xf0,0x00,0x09,0x0}}
422}; 422};
423static const opl4_region_t regions_3d[] = { /* Brass Section */ 423static const struct opl4_region regions_3d[] = { /* Brass Section */
424 {0x15, 0x42, {0x0fc,4375,100, 0,0,0x00,0xd6,0x28,0xf0,0x00,0x0a,0x0}}, 424 {0x15, 0x42, {0x0fc,4375,100, 0,0,0x00,0xd6,0x28,0xf0,0x00,0x0a,0x0}},
425 {0x43, 0x6c, {0x0fd,2854,100, 0,0,0x00,0xd6,0x28,0xf0,0x00,0x0a,0x0}} 425 {0x43, 0x6c, {0x0fd,2854,100, 0,0,0x00,0xd6,0x28,0xf0,0x00,0x0a,0x0}}
426}; 426};
427static const opl4_region_t regions_3e[] = { /* Synth Brass 1 */ 427static const struct opl4_region regions_3e[] = { /* Synth Brass 1 */
428 {0x01, 0x27, {0x0d3,9094,100,-1,0,0x00,0xbe,0x18,0xa5,0x11,0x08,0x0}}, 428 {0x01, 0x27, {0x0d3,9094,100,-1,0,0x00,0xbe,0x18,0xa5,0x11,0x08,0x0}},
429 {0x28, 0x2d, {0x0da,8335,100,-1,0,0x00,0xbe,0x18,0xa5,0x11,0x08,0x0}}, 429 {0x28, 0x2d, {0x0da,8335,100,-1,0,0x00,0xbe,0x18,0xa5,0x11,0x08,0x0}},
430 {0x2e, 0x33, {0x0d4,7558,100,-1,0,0x00,0xbe,0x18,0xa5,0x11,0x08,0x0}}, 430 {0x2e, 0x33, {0x0d4,7558,100,-1,0,0x00,0xbe,0x18,0xa5,0x11,0x08,0x0}},
@@ -450,7 +450,7 @@ static const opl4_region_t regions_3e[] = { /* Synth Brass 1 */
450 {0x5e, 0x64, {0x122,1421,100, 1,1,0x00,0xbe,0x19,0x85,0x23,0x08,0x0}}, 450 {0x5e, 0x64, {0x122,1421,100, 1,1,0x00,0xbe,0x19,0x85,0x23,0x08,0x0}},
451 {0x65, 0x7f, {0x123,-115,100, 1,1,0x00,0xbe,0x19,0x85,0x23,0x08,0x0}} 451 {0x65, 0x7f, {0x123,-115,100, 1,1,0x00,0xbe,0x19,0x85,0x23,0x08,0x0}}
452}; 452};
453static const opl4_region_t regions_3f[] = { /* Synth Brass 2 */ 453static const struct opl4_region regions_3f[] = { /* Synth Brass 2 */
454 {0x01, 0x27, {0x118,9113,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}}, 454 {0x01, 0x27, {0x118,9113,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}},
455 {0x28, 0x2d, {0x119,8350,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}}, 455 {0x28, 0x2d, {0x119,8350,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}},
456 {0x2e, 0x33, {0x11a,7575,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}}, 456 {0x2e, 0x33, {0x11a,7575,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}},
@@ -465,7 +465,7 @@ static const opl4_region_t regions_3f[] = { /* Synth Brass 2 */
465 {0x65, 0x7f, {0x123,-105,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}}, 465 {0x65, 0x7f, {0x123,-105,100, 3,6,0x00,0xae,0x26,0x85,0x23,0x08,0x0}},
466 {0x00, 0x7f, {0x124,4034,100,-3,2,0x00,0xea,0x22,0x85,0x23,0x08,0x0}} 466 {0x00, 0x7f, {0x124,4034,100,-3,2,0x00,0xea,0x22,0x85,0x23,0x08,0x0}}
467}; 467};
468static const opl4_region_t regions_40[] = { /* Soprano Sax */ 468static const struct opl4_region regions_40[] = { /* Soprano Sax */
469 {0x15, 0x3f, {0x0e3,4228,100, 0,1,0x00,0xc8,0x21,0xf5,0x20,0x0a,0x0}}, 469 {0x15, 0x3f, {0x0e3,4228,100, 0,1,0x00,0xc8,0x21,0xf5,0x20,0x0a,0x0}},
470 {0x40, 0x45, {0x0e4,3495,100, 0,1,0x00,0xc8,0x21,0xf5,0x20,0x0a,0x0}}, 470 {0x40, 0x45, {0x0e4,3495,100, 0,1,0x00,0xc8,0x21,0xf5,0x20,0x0a,0x0}},
471 {0x46, 0x4b, {0x0e5,2660,100, 0,1,0x00,0xd6,0x21,0xf5,0x20,0x0a,0x0}}, 471 {0x46, 0x4b, {0x0e5,2660,100, 0,1,0x00,0xd6,0x21,0xf5,0x20,0x0a,0x0}},
@@ -473,7 +473,7 @@ static const opl4_region_t regions_40[] = { /* Soprano Sax */
473 {0x52, 0x59, {0x0e7,1186,100, 0,1,0x00,0xd6,0x21,0xf5,0x20,0x0a,0x0}}, 473 {0x52, 0x59, {0x0e7,1186,100, 0,1,0x00,0xd6,0x21,0xf5,0x20,0x0a,0x0}},
474 {0x59, 0x6c, {0x0e8,1730,100, 0,1,0x00,0xc8,0x21,0xf5,0x20,0x0a,0x0}} 474 {0x59, 0x6c, {0x0e8,1730,100, 0,1,0x00,0xc8,0x21,0xf5,0x20,0x0a,0x0}}
475}; 475};
476static const opl4_region_t regions_41[] = { /* Alto Sax */ 476static const struct opl4_region regions_41[] = { /* Alto Sax */
477 {0x15, 0x32, {0x092,6204,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}}, 477 {0x15, 0x32, {0x092,6204,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}},
478 {0x33, 0x35, {0x096,5812,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}}, 478 {0x33, 0x35, {0x096,5812,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}},
479 {0x36, 0x3a, {0x099,5318,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}}, 479 {0x36, 0x3a, {0x099,5318,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}},
@@ -488,7 +488,7 @@ static const opl4_region_t regions_41[] = { /* Alto Sax */
488 {0x51, 0x53, {0x091,2088,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}}, 488 {0x51, 0x53, {0x091,2088,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}},
489 {0x54, 0x6c, {0x095,1732,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}} 489 {0x54, 0x6c, {0x095,1732,100, 0,1,0x00,0xbe,0x19,0xf5,0x20,0x0b,0x0}}
490}; 490};
491static const opl4_region_t regions_42[] = { /* Tenor Sax */ 491static const struct opl4_region regions_42[] = { /* Tenor Sax */
492 {0x24, 0x30, {0x0e9,6301,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}}, 492 {0x24, 0x30, {0x0e9,6301,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}},
493 {0x31, 0x34, {0x0ea,5781,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}}, 493 {0x31, 0x34, {0x0ea,5781,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}},
494 {0x35, 0x3a, {0x0eb,5053,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}}, 494 {0x35, 0x3a, {0x0eb,5053,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}},
@@ -497,13 +497,13 @@ static const opl4_region_t regions_42[] = { /* Tenor Sax */
497 {0x48, 0x51, {0x0ee,2462,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}}, 497 {0x48, 0x51, {0x0ee,2462,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}},
498 {0x52, 0x6c, {0x0ef,1421,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}} 498 {0x52, 0x6c, {0x0ef,1421,100, 0,1,0x00,0xbc,0x19,0xf4,0x10,0x0b,0x0}}
499}; 499};
500static const opl4_region_t regions_43[] = { /* Baritone Sax */ 500static const struct opl4_region regions_43[] = { /* Baritone Sax */
501 {0x15, 0x2d, {0x0df,6714,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}}, 501 {0x15, 0x2d, {0x0df,6714,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}},
502 {0x2e, 0x34, {0x0e1,5552,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}}, 502 {0x2e, 0x34, {0x0e1,5552,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}},
503 {0x35, 0x39, {0x0e2,5178,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}}, 503 {0x35, 0x39, {0x0e2,5178,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}},
504 {0x3a, 0x6c, {0x0e0,4437,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}} 504 {0x3a, 0x6c, {0x0e0,4437,100, 0,1,0x00,0xce,0x19,0xf0,0x00,0x0a,0x0}}
505}; 505};
506static const opl4_region_t regions_44[] = { /* Oboe */ 506static const struct opl4_region regions_44[] = { /* Oboe */
507 {0x15, 0x3c, {0x042,4493,100, 0,1,0x00,0xe6,0x39,0xf4,0x10,0x0a,0x0}}, 507 {0x15, 0x3c, {0x042,4493,100, 0,1,0x00,0xe6,0x39,0xf4,0x10,0x0a,0x0}},
508 {0x3d, 0x43, {0x044,3702,100, 0,1,0x00,0xdc,0x39,0xf4,0x10,0x0a,0x0}}, 508 {0x3d, 0x43, {0x044,3702,100, 0,1,0x00,0xdc,0x39,0xf4,0x10,0x0a,0x0}},
509 {0x44, 0x49, {0x043,2956,100, 0,1,0x00,0xdc,0x39,0xf4,0x10,0x0a,0x0}}, 509 {0x44, 0x49, {0x043,2956,100, 0,1,0x00,0xdc,0x39,0xf4,0x10,0x0a,0x0}},
@@ -511,55 +511,55 @@ static const opl4_region_t regions_44[] = { /* Oboe */
511 {0x50, 0x55, {0x045,1420,100, 0,1,0x00,0xdc,0x39,0xf4,0x10,0x0a,0x0}}, 511 {0x50, 0x55, {0x045,1420,100, 0,1,0x00,0xdc,0x39,0xf4,0x10,0x0a,0x0}},
512 {0x56, 0x6c, {0x047, 630,100, 0,1,0x00,0xe6,0x39,0xf4,0x10,0x0a,0x0}} 512 {0x56, 0x6c, {0x047, 630,100, 0,1,0x00,0xe6,0x39,0xf4,0x10,0x0a,0x0}}
513}; 513};
514static const opl4_region_t regions_45[] = { /* English Horn */ 514static const struct opl4_region regions_45[] = { /* English Horn */
515 {0x15, 0x38, {0x03c,5098,100, 0,1,0x00,0xc4,0x31,0xf0,0x00,0x09,0x0}}, 515 {0x15, 0x38, {0x03c,5098,100, 0,1,0x00,0xc4,0x31,0xf0,0x00,0x09,0x0}},
516 {0x39, 0x3e, {0x03b,4291,100, 0,1,0x00,0xc4,0x31,0xf0,0x00,0x09,0x0}}, 516 {0x39, 0x3e, {0x03b,4291,100, 0,1,0x00,0xc4,0x31,0xf0,0x00,0x09,0x0}},
517 {0x3f, 0x6c, {0x03d,3540,100, 0,1,0x00,0xc4,0x31,0xf0,0x00,0x09,0x0}} 517 {0x3f, 0x6c, {0x03d,3540,100, 0,1,0x00,0xc4,0x31,0xf0,0x00,0x09,0x0}}
518}; 518};
519static const opl4_region_t regions_46[] = { /* Bassoon */ 519static const struct opl4_region regions_46[] = { /* Bassoon */
520 {0x15, 0x22, {0x038,7833,100, 0,1,0x00,0xc6,0x31,0xf0,0x00,0x0b,0x0}}, 520 {0x15, 0x22, {0x038,7833,100, 0,1,0x00,0xc6,0x31,0xf0,0x00,0x0b,0x0}},
521 {0x23, 0x2e, {0x03a,7070,100, 0,1,0x00,0xc6,0x31,0xf0,0x00,0x0b,0x0}}, 521 {0x23, 0x2e, {0x03a,7070,100, 0,1,0x00,0xc6,0x31,0xf0,0x00,0x0b,0x0}},
522 {0x2f, 0x6c, {0x039,6302,100, 0,1,0x00,0xc6,0x31,0xf0,0x00,0x0b,0x0}} 522 {0x2f, 0x6c, {0x039,6302,100, 0,1,0x00,0xc6,0x31,0xf0,0x00,0x0b,0x0}}
523}; 523};
524static const opl4_region_t regions_47[] = { /* Clarinet */ 524static const struct opl4_region regions_47[] = { /* Clarinet */
525 {0x15, 0x3b, {0x09e,5900,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}}, 525 {0x15, 0x3b, {0x09e,5900,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}},
526 {0x3c, 0x41, {0x0a0,5158,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}}, 526 {0x3c, 0x41, {0x0a0,5158,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}},
527 {0x42, 0x4a, {0x09f,4260,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}}, 527 {0x42, 0x4a, {0x09f,4260,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}},
528 {0x4b, 0x6c, {0x0a1,2957,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}} 528 {0x4b, 0x6c, {0x0a1,2957,100, 0,1,0x00,0xc8,0x29,0xf3,0x20,0x0a,0x0}}
529}; 529};
530static const opl4_region_t regions_48[] = { /* Piccolo */ 530static const struct opl4_region regions_48[] = { /* Piccolo */
531 {0x15, 0x40, {0x071,4803,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}}, 531 {0x15, 0x40, {0x071,4803,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}},
532 {0x41, 0x4d, {0x072,3314,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}}, 532 {0x41, 0x4d, {0x072,3314,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}},
533 {0x4e, 0x53, {0x073,1731,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}}, 533 {0x4e, 0x53, {0x073,1731,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}},
534 {0x54, 0x5f, {0x074,2085,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}}, 534 {0x54, 0x5f, {0x074,2085,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}},
535 {0x60, 0x6c, {0x075,1421,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}} 535 {0x60, 0x6c, {0x075,1421,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}}
536}; 536};
537static const opl4_region_t regions_49[] = { /* Flute */ 537static const struct opl4_region regions_49[] = { /* Flute */
538 {0x15, 0x40, {0x071,4803,100, 0,0,0x00,0xdc,0x38,0xf0,0x00,0x0a,0x2}}, 538 {0x15, 0x40, {0x071,4803,100, 0,0,0x00,0xdc,0x38,0xf0,0x00,0x0a,0x2}},
539 {0x41, 0x4d, {0x072,3314,100, 0,0,0x00,0xdc,0x38,0xf0,0x00,0x0a,0x2}}, 539 {0x41, 0x4d, {0x072,3314,100, 0,0,0x00,0xdc,0x38,0xf0,0x00,0x0a,0x2}},
540 {0x4e, 0x6c, {0x073,1731,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}} 540 {0x4e, 0x6c, {0x073,1731,100, 0,0,0x00,0xe6,0x38,0xf0,0x00,0x0a,0x2}}
541}; 541};
542static const opl4_region_t regions_4a[] = { /* Recorder */ 542static const struct opl4_region regions_4a[] = { /* Recorder */
543 {0x15, 0x6f, {0x0bd,4897,100, 0,0,0x00,0xec,0x30,0x70,0x00,0x09,0x1}} 543 {0x15, 0x6f, {0x0bd,4897,100, 0,0,0x00,0xec,0x30,0x70,0x00,0x09,0x1}}
544}; 544};
545static const opl4_region_t regions_4b[] = { /* Pan Flute */ 545static const struct opl4_region regions_4b[] = { /* Pan Flute */
546 {0x15, 0x6c, {0x077,2359,100, 0,0,0x00,0xde,0x38,0xf0,0x00,0x09,0x3}} 546 {0x15, 0x6c, {0x077,2359,100, 0,0,0x00,0xde,0x38,0xf0,0x00,0x09,0x3}}
547}; 547};
548static const opl4_region_t regions_4c[] = { /* Bottle Blow */ 548static const struct opl4_region regions_4c[] = { /* Bottle Blow */
549 {0x15, 0x6c, {0x077,2359,100, 0,0,0x00,0xc8,0x38,0xf0,0x00,0x09,0x1}}, 549 {0x15, 0x6c, {0x077,2359,100, 0,0,0x00,0xc8,0x38,0xf0,0x00,0x09,0x1}},
550 {0x01, 0x7f, {0x125,7372,100, 0,0,0x1e,0x80,0x00,0xf0,0x00,0x09,0x0}} 550 {0x01, 0x7f, {0x125,7372,100, 0,0,0x1e,0x80,0x00,0xf0,0x00,0x09,0x0}}
551}; 551};
552static const opl4_region_t regions_4d[] = { /* Shakuhachi */ 552static const struct opl4_region regions_4d[] = { /* Shakuhachi */
553 {0x00, 0x7f, {0x0ab,4548,100, 0,0,0x00,0xd6,0x30,0xf0,0x00,0x0a,0x3}}, 553 {0x00, 0x7f, {0x0ab,4548,100, 0,0,0x00,0xd6,0x30,0xf0,0x00,0x0a,0x3}},
554 {0x15, 0x6c, {0x076,3716,100, 0,0,0x00,0xa2,0x28,0x70,0x00,0x09,0x2}} 554 {0x15, 0x6c, {0x076,3716,100, 0,0,0x00,0xa2,0x28,0x70,0x00,0x09,0x2}}
555}; 555};
556static const opl4_region_t regions_4e[] = { /* Whistle */ 556static const struct opl4_region regions_4e[] = { /* Whistle */
557 {0x00, 0x7f, {0x0aa,1731,100, 0,4,0x00,0xd2,0x2c,0x70,0x00,0x0a,0x0}} 557 {0x00, 0x7f, {0x0aa,1731,100, 0,4,0x00,0xd2,0x2c,0x70,0x00,0x0a,0x0}}
558}; 558};
559static const opl4_region_t regions_4f[] = { /* Ocarina */ 559static const struct opl4_region regions_4f[] = { /* Ocarina */
560 {0x00, 0x7f, {0x0aa,1731,100, 0,1,0x00,0xce,0x29,0x90,0x00,0x0a,0x1}} 560 {0x00, 0x7f, {0x0aa,1731,100, 0,1,0x00,0xce,0x29,0x90,0x00,0x0a,0x1}}
561}; 561};
562static const opl4_region_t regions_50[] = { /* Square Lead */ 562static const struct opl4_region regions_50[] = { /* Square Lead */
563 {0x01, 0x2a, {0x0cc,9853,100, 3,0,0x00,0xac,0x38,0xc6,0x21,0x09,0x0}}, 563 {0x01, 0x2a, {0x0cc,9853,100, 3,0,0x00,0xac,0x38,0xc6,0x21,0x09,0x0}},
564 {0x2b, 0x36, {0x0cd,6785,100, 3,0,0x00,0xac,0x38,0xc6,0x21,0x09,0x0}}, 564 {0x2b, 0x36, {0x0cd,6785,100, 3,0,0x00,0xac,0x38,0xc6,0x21,0x09,0x0}},
565 {0x37, 0x42, {0x0ca,5248,100, 3,0,0x00,0xac,0x38,0xc6,0x21,0x09,0x0}}, 565 {0x37, 0x42, {0x0ca,5248,100, 3,0,0x00,0xac,0x38,0xc6,0x21,0x09,0x0}},
@@ -573,7 +573,7 @@ static const opl4_region_t regions_50[] = { /* Square Lead */
573 {0x4f, 0x5a, {0x0ce,2167,100,-3,0,0x00,0xac,0x08,0xc6,0x21,0x09,0x0}}, 573 {0x4f, 0x5a, {0x0ce,2167,100,-3,0,0x00,0xac,0x08,0xc6,0x21,0x09,0x0}},
574 {0x5b, 0x7f, {0x0cb, 631,100,-3,0,0x00,0xac,0x08,0xc6,0x21,0x09,0x0}} 574 {0x5b, 0x7f, {0x0cb, 631,100,-3,0,0x00,0xac,0x08,0xc6,0x21,0x09,0x0}}
575}; 575};
576static const opl4_region_t regions_51[] = { /* Sawtooth Lead */ 576static const struct opl4_region regions_51[] = { /* Sawtooth Lead */
577 {0x01, 0x27, {0x118,9108,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}}, 577 {0x01, 0x27, {0x118,9108,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}},
578 {0x28, 0x2d, {0x119,8345,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}}, 578 {0x28, 0x2d, {0x119,8345,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}},
579 {0x2e, 0x33, {0x11a,7570,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}}, 579 {0x2e, 0x33, {0x11a,7570,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}},
@@ -599,15 +599,15 @@ static const opl4_region_t regions_51[] = { /* Sawtooth Lead */
599 {0x5e, 0x66, {0x122,1416,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}}, 599 {0x5e, 0x66, {0x122,1416,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}},
600 {0x67, 0x7f, {0x123,-120,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}} 600 {0x67, 0x7f, {0x123,-120,100, 0,0,0x00,0xc8,0x30,0xf2,0x22,0x0a,0x0}}
601}; 601};
602static const opl4_region_t regions_52[] = { /* Calliope Lead */ 602static const struct opl4_region regions_52[] = { /* Calliope Lead */
603 {0x00, 0x7f, {0x0aa,1731,100, 0,0,0x00,0xc2,0x28,0x90,0x00,0x0a,0x2}}, 603 {0x00, 0x7f, {0x0aa,1731,100, 0,0,0x00,0xc2,0x28,0x90,0x00,0x0a,0x2}},
604 {0x15, 0x6c, {0x076,3716,100, 0,0,0x00,0xb6,0x28,0xb0,0x00,0x09,0x2}} 604 {0x15, 0x6c, {0x076,3716,100, 0,0,0x00,0xb6,0x28,0xb0,0x00,0x09,0x2}}
605}; 605};
606static const opl4_region_t regions_53[] = { /* Chiffer Lead */ 606static const struct opl4_region regions_53[] = { /* Chiffer Lead */
607 {0x00, 0x7f, {0x13a,3665,100, 0,2,0x00,0xcc,0x2a,0xf0,0x10,0x09,0x1}}, 607 {0x00, 0x7f, {0x13a,3665,100, 0,2,0x00,0xcc,0x2a,0xf0,0x10,0x09,0x1}},
608 {0x01, 0x7f, {0x0fe,3660,100, 0,0,0x00,0xbe,0x28,0xf3,0x10,0x17,0x0}} 608 {0x01, 0x7f, {0x0fe,3660,100, 0,0,0x00,0xbe,0x28,0xf3,0x10,0x17,0x0}}
609}; 609};
610static const opl4_region_t regions_54[] = { /* Charang Lead */ 610static const struct opl4_region regions_54[] = { /* Charang Lead */
611 {0x00, 0x40, {0x0a5,6594,100, 0,3,0x00,0xba,0x33,0xf2,0x11,0x09,0x0}}, 611 {0x00, 0x40, {0x0a5,6594,100, 0,3,0x00,0xba,0x33,0xf2,0x11,0x09,0x0}},
612 {0x41, 0x7f, {0x0a6,5433,100, 0,3,0x00,0xba,0x33,0xf2,0x11,0x09,0x0}}, 612 {0x41, 0x7f, {0x0a6,5433,100, 0,3,0x00,0xba,0x33,0xf2,0x11,0x09,0x0}},
613 {0x01, 0x27, {0x118,9098,100, 0,2,0x00,0xa4,0x2a,0xf2,0x22,0x0e,0x0}}, 613 {0x01, 0x27, {0x118,9098,100, 0,2,0x00,0xa4,0x2a,0xf2,0x22,0x0e,0x0}},
@@ -623,11 +623,11 @@ static const opl4_region_t regions_54[] = { /* Charang Lead */
623 {0x5e, 0x66, {0x122,1416,100, 0,2,0x00,0xa4,0x2a,0xf2,0x22,0x0e,0x0}}, 623 {0x5e, 0x66, {0x122,1416,100, 0,2,0x00,0xa4,0x2a,0xf2,0x22,0x0e,0x0}},
624 {0x67, 0x7f, {0x123,-120,100, 0,2,0x00,0xa4,0x2a,0xf2,0x22,0x0e,0x0}} 624 {0x67, 0x7f, {0x123,-120,100, 0,2,0x00,0xa4,0x2a,0xf2,0x22,0x0e,0x0}}
625}; 625};
626static const opl4_region_t regions_55[] = { /* Voice Lead */ 626static const struct opl4_region regions_55[] = { /* Voice Lead */
627 {0x00, 0x7f, {0x0aa,1739,100, 0,6,0x00,0x8c,0x2e,0x90,0x00,0x0a,0x0}}, 627 {0x00, 0x7f, {0x0aa,1739,100, 0,6,0x00,0x8c,0x2e,0x90,0x00,0x0a,0x0}},
628 {0x15, 0x6c, {0x02a,3474,100, 0,1,0x00,0xd8,0x29,0xf0,0x05,0x0a,0x0}} 628 {0x15, 0x6c, {0x02a,3474,100, 0,1,0x00,0xd8,0x29,0xf0,0x05,0x0a,0x0}}
629}; 629};
630static const opl4_region_t regions_56[] = { /* 5ths Lead */ 630static const struct opl4_region regions_56[] = { /* 5ths Lead */
631 {0x01, 0x27, {0x118,8468,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}}, 631 {0x01, 0x27, {0x118,8468,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}},
632 {0x28, 0x2d, {0x119,7705,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}}, 632 {0x28, 0x2d, {0x119,7705,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}},
633 {0x2e, 0x33, {0x11a,6930,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}}, 633 {0x2e, 0x33, {0x11a,6930,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}},
@@ -642,7 +642,7 @@ static const opl4_region_t regions_56[] = { /* 5ths Lead */
642 {0x65, 0x7f, {0x123,-750,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}}, 642 {0x65, 0x7f, {0x123,-750,100, 0,2,0x00,0xd0,0x32,0xf5,0x20,0x08,0x0}},
643 {0x05, 0x71, {0x002,4503,100, 0,1,0x00,0xb8,0x31,0xb3,0x20,0x0b,0x0}} 643 {0x05, 0x71, {0x002,4503,100, 0,1,0x00,0xb8,0x31,0xb3,0x20,0x0b,0x0}}
644}; 644};
645static const opl4_region_t regions_57[] = { /* Bass & Lead */ 645static const struct opl4_region regions_57[] = { /* Bass & Lead */
646 {0x00, 0x7f, {0x117,8109,100, 0,1,0x00,0xbc,0x29,0xf3,0x50,0x08,0x0}}, 646 {0x00, 0x7f, {0x117,8109,100, 0,1,0x00,0xbc,0x29,0xf3,0x50,0x08,0x0}},
647 {0x01, 0x27, {0x118,9097,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}}, 647 {0x01, 0x27, {0x118,9097,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}},
648 {0x28, 0x2d, {0x119,8334,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}}, 648 {0x28, 0x2d, {0x119,8334,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}},
@@ -657,15 +657,15 @@ static const opl4_region_t regions_57[] = { /* Bass & Lead */
657 {0x5e, 0x66, {0x122,1415,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}}, 657 {0x5e, 0x66, {0x122,1415,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}},
658 {0x67, 0x7f, {0x123,-121,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}} 658 {0x67, 0x7f, {0x123,-121,100, 0,2,0x00,0xbc,0x2a,0xf2,0x20,0x0a,0x0}}
659}; 659};
660static const opl4_region_t regions_58[] = { /* New Age Pad */ 660static const struct opl4_region regions_58[] = { /* New Age Pad */
661 {0x15, 0x6c, {0x002,4501,100, 0,4,0x00,0xa4,0x24,0x80,0x01,0x05,0x0}}, 661 {0x15, 0x6c, {0x002,4501,100, 0,4,0x00,0xa4,0x24,0x80,0x01,0x05,0x0}},
662 {0x15, 0x6c, {0x0f3,4253,100, 0,3,0x00,0x8c,0x23,0xa2,0x14,0x06,0x1}} 662 {0x15, 0x6c, {0x0f3,4253,100, 0,3,0x00,0x8c,0x23,0xa2,0x14,0x06,0x1}}
663}; 663};
664static const opl4_region_t regions_59[] = { /* Warm Pad */ 664static const struct opl4_region regions_59[] = { /* Warm Pad */
665 {0x15, 0x6c, {0x04e,5306,100, 2,2,0x00,0x92,0x2a,0x34,0x23,0x05,0x2}}, 665 {0x15, 0x6c, {0x04e,5306,100, 2,2,0x00,0x92,0x2a,0x34,0x23,0x05,0x2}},
666 {0x15, 0x6c, {0x029,3575,100,-2,2,0x00,0xbe,0x22,0x31,0x23,0x06,0x0}} 666 {0x15, 0x6c, {0x029,3575,100,-2,2,0x00,0xbe,0x22,0x31,0x23,0x06,0x0}}
667}; 667};
668static const opl4_region_t regions_5a[] = { /* Polysynth Pad */ 668static const struct opl4_region regions_5a[] = { /* Polysynth Pad */
669 {0x01, 0x27, {0x118,9111,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}}, 669 {0x01, 0x27, {0x118,9111,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}},
670 {0x28, 0x2d, {0x119,8348,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}}, 670 {0x28, 0x2d, {0x119,8348,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}},
671 {0x2e, 0x33, {0x11a,7573,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}}, 671 {0x2e, 0x33, {0x11a,7573,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}},
@@ -680,29 +680,29 @@ static const opl4_region_t regions_5a[] = { /* Polysynth Pad */
680 {0x67, 0x7f, {0x123,-107,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}}, 680 {0x67, 0x7f, {0x123,-107,100, 0,3,0x00,0xae,0x23,0xf2,0x20,0x07,0x1}},
681 {0x00, 0x7f, {0x124,4024,100, 0,2,0x00,0xae,0x22,0xe5,0x20,0x08,0x0}} 681 {0x00, 0x7f, {0x124,4024,100, 0,2,0x00,0xae,0x22,0xe5,0x20,0x08,0x0}}
682}; 682};
683static const opl4_region_t regions_5b[] = { /* Choir Pad */ 683static const struct opl4_region regions_5b[] = { /* Choir Pad */
684 {0x15, 0x3a, {0x018,5010,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}}, 684 {0x15, 0x3a, {0x018,5010,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}},
685 {0x3b, 0x40, {0x019,4370,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}}, 685 {0x3b, 0x40, {0x019,4370,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}},
686 {0x41, 0x47, {0x01a,3478,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}}, 686 {0x41, 0x47, {0x01a,3478,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}},
687 {0x48, 0x6c, {0x01b,2197,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}}, 687 {0x48, 0x6c, {0x01b,2197,100, 0,5,0x00,0xb0,0x25,0x70,0x00,0x06,0x0}},
688 {0x15, 0x6c, {0x02a,3482,100, 0,4,0x00,0x98,0x24,0x65,0x21,0x06,0x0}} 688 {0x15, 0x6c, {0x02a,3482,100, 0,4,0x00,0x98,0x24,0x65,0x21,0x06,0x0}}
689}; 689};
690static const opl4_region_t regions_5c[] = { /* Bowed Pad */ 690static const struct opl4_region regions_5c[] = { /* Bowed Pad */
691 {0x15, 0x6c, {0x101,4790,100,-1,1,0x00,0xbe,0x19,0x44,0x14,0x16,0x0}}, 691 {0x15, 0x6c, {0x101,4790,100,-1,1,0x00,0xbe,0x19,0x44,0x14,0x16,0x0}},
692 {0x00, 0x7f, {0x0aa,1720,100, 1,1,0x00,0x94,0x19,0x40,0x00,0x06,0x0}} 692 {0x00, 0x7f, {0x0aa,1720,100, 1,1,0x00,0x94,0x19,0x40,0x00,0x06,0x0}}
693}; 693};
694static const opl4_region_t regions_5d[] = { /* Metallic Pad */ 694static const struct opl4_region regions_5d[] = { /* Metallic Pad */
695 {0x15, 0x31, {0x00c,6943,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}}, 695 {0x15, 0x31, {0x00c,6943,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}},
696 {0x32, 0x38, {0x00d,5416,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}}, 696 {0x32, 0x38, {0x00d,5416,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}},
697 {0x39, 0x47, {0x00e,4385,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}}, 697 {0x39, 0x47, {0x00e,4385,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}},
698 {0x48, 0x6c, {0x00f,2849,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}}, 698 {0x48, 0x6c, {0x00f,2849,100, 0,2,0x00,0xa0,0x0a,0x60,0x03,0x06,0x0}},
699 {0x00, 0x7f, {0x03f,4224,100, 0,1,0x00,0x9c,0x31,0x65,0x16,0x07,0x0}} 699 {0x00, 0x7f, {0x03f,4224,100, 0,1,0x00,0x9c,0x31,0x65,0x16,0x07,0x0}}
700}; 700};
701static const opl4_region_t regions_5e[] = { /* Halo Pad */ 701static const struct opl4_region regions_5e[] = { /* Halo Pad */
702 {0x00, 0x7f, {0x124,4038,100, 0,2,0x00,0xa6,0x1a,0x85,0x23,0x08,0x0}}, 702 {0x00, 0x7f, {0x124,4038,100, 0,2,0x00,0xa6,0x1a,0x85,0x23,0x08,0x0}},
703 {0x15, 0x6c, {0x02a,3471,100, 0,3,0x00,0xc0,0x1b,0xc0,0x05,0x06,0x0}} 703 {0x15, 0x6c, {0x02a,3471,100, 0,3,0x00,0xc0,0x1b,0xc0,0x05,0x06,0x0}}
704}; 704};
705static const opl4_region_t regions_5f[] = { /* Sweep Pad */ 705static const struct opl4_region regions_5f[] = { /* Sweep Pad */
706 {0x01, 0x27, {0x0d3,9100,100, 0,1,0x00,0xce,0x19,0x13,0x11,0x06,0x0}}, 706 {0x01, 0x27, {0x0d3,9100,100, 0,1,0x00,0xce,0x19,0x13,0x11,0x06,0x0}},
707 {0x28, 0x2d, {0x0da,8341,100, 0,1,0x00,0xce,0x19,0x13,0x11,0x06,0x0}}, 707 {0x28, 0x2d, {0x0da,8341,100, 0,1,0x00,0xce,0x19,0x13,0x11,0x06,0x0}},
708 {0x2e, 0x33, {0x0d4,7564,100, 0,1,0x00,0xce,0x19,0x13,0x11,0x06,0x0}}, 708 {0x2e, 0x33, {0x0d4,7564,100, 0,1,0x00,0xce,0x19,0x13,0x11,0x06,0x0}},
@@ -728,21 +728,21 @@ static const opl4_region_t regions_5f[] = { /* Sweep Pad */
728 {0x5e, 0x63, {0x0d8,1415,100, 0,0,0x00,0xce,0x18,0x13,0x11,0x06,0x0}}, 728 {0x5e, 0x63, {0x0d8,1415,100, 0,0,0x00,0xce,0x18,0x13,0x11,0x06,0x0}},
729 {0x64, 0x7f, {0x0d9,-121,100, 0,0,0x00,0xce,0x18,0x13,0x11,0x06,0x0}} 729 {0x64, 0x7f, {0x0d9,-121,100, 0,0,0x00,0xce,0x18,0x13,0x11,0x06,0x0}}
730}; 730};
731static const opl4_region_t regions_60[] = { /* Ice Rain */ 731static const struct opl4_region regions_60[] = { /* Ice Rain */
732 {0x01, 0x7f, {0x04e,9345,100, 0,2,0x00,0xcc,0x22,0xa3,0x63,0x17,0x0}}, 732 {0x01, 0x7f, {0x04e,9345,100, 0,2,0x00,0xcc,0x22,0xa3,0x63,0x17,0x0}},
733 {0x00, 0x7f, {0x143,5586, 20, 0,2,0x00,0x6e,0x2a,0xf0,0x05,0x05,0x0}} 733 {0x00, 0x7f, {0x143,5586, 20, 0,2,0x00,0x6e,0x2a,0xf0,0x05,0x05,0x0}}
734}; 734};
735static const opl4_region_t regions_61[] = { /* Soundtrack */ 735static const struct opl4_region regions_61[] = { /* Soundtrack */
736 {0x15, 0x6c, {0x002,4501,100, 0,2,0x00,0xb6,0x2a,0x60,0x01,0x05,0x0}}, 736 {0x15, 0x6c, {0x002,4501,100, 0,2,0x00,0xb6,0x2a,0x60,0x01,0x05,0x0}},
737 {0x15, 0x6c, {0x0f3,1160,100, 0,5,0x00,0xa8,0x2d,0x52,0x14,0x06,0x2}} 737 {0x15, 0x6c, {0x0f3,1160,100, 0,5,0x00,0xa8,0x2d,0x52,0x14,0x06,0x2}}
738}; 738};
739static const opl4_region_t regions_62[] = { /* Crystal */ 739static const struct opl4_region regions_62[] = { /* Crystal */
740 {0x15, 0x6c, {0x0f3,1826,100, 0,3,0x00,0xb8,0x33,0xf6,0x25,0x25,0x0}}, 740 {0x15, 0x6c, {0x0f3,1826,100, 0,3,0x00,0xb8,0x33,0xf6,0x25,0x25,0x0}},
741 {0x15, 0x2c, {0x06d,7454,100, 0,3,0x00,0xac,0x3b,0x85,0x24,0x06,0x0}}, 741 {0x15, 0x2c, {0x06d,7454,100, 0,3,0x00,0xac,0x3b,0x85,0x24,0x06,0x0}},
742 {0x2d, 0x36, {0x06e,5925,100, 0,3,0x00,0xac,0x3b,0x85,0x24,0x06,0x0}}, 742 {0x2d, 0x36, {0x06e,5925,100, 0,3,0x00,0xac,0x3b,0x85,0x24,0x06,0x0}},
743 {0x37, 0x6c, {0x06f,4403,100, 0,3,0x09,0xac,0x3b,0x85,0x24,0x06,0x0}} 743 {0x37, 0x6c, {0x06f,4403,100, 0,3,0x09,0xac,0x3b,0x85,0x24,0x06,0x0}}
744}; 744};
745static const opl4_region_t regions_63[] = { /* Atmosphere */ 745static const struct opl4_region regions_63[] = { /* Atmosphere */
746 {0x05, 0x71, {0x002,4509,100, 0,2,0x00,0xc8,0x32,0x73,0x22,0x06,0x1}}, 746 {0x05, 0x71, {0x002,4509,100, 0,2,0x00,0xc8,0x32,0x73,0x22,0x06,0x1}},
747 {0x15, 0x2f, {0x0b3,6964,100, 0,2,0x05,0xc2,0x32,0xf5,0x34,0x07,0x2}}, 747 {0x15, 0x2f, {0x0b3,6964,100, 0,2,0x05,0xc2,0x32,0xf5,0x34,0x07,0x2}},
748 {0x30, 0x36, {0x0b7,5567,100, 0,2,0x0c,0xc2,0x32,0xf5,0x34,0x07,0x2}}, 748 {0x30, 0x36, {0x0b7,5567,100, 0,2,0x0c,0xc2,0x32,0xf5,0x34,0x07,0x2}},
@@ -750,29 +750,29 @@ static const opl4_region_t regions_63[] = { /* Atmosphere */
750 {0x3d, 0x43, {0x0b4,3892,100, 0,2,0x00,0xc2,0x32,0xf6,0x35,0x07,0x2}}, 750 {0x3d, 0x43, {0x0b4,3892,100, 0,2,0x00,0xc2,0x32,0xf6,0x35,0x07,0x2}},
751 {0x44, 0x60, {0x0b6,2723,100, 0,2,0x00,0xc2,0x32,0xf6,0x35,0x17,0x2}} 751 {0x44, 0x60, {0x0b6,2723,100, 0,2,0x00,0xc2,0x32,0xf6,0x35,0x17,0x2}}
752}; 752};
753static const opl4_region_t regions_64[] = { /* Brightness */ 753static const struct opl4_region regions_64[] = { /* Brightness */
754 {0x00, 0x7f, {0x137,5285,100, 0,2,0x00,0xbe,0x2a,0xa5,0x18,0x08,0x0}}, 754 {0x00, 0x7f, {0x137,5285,100, 0,2,0x00,0xbe,0x2a,0xa5,0x18,0x08,0x0}},
755 {0x15, 0x6c, {0x02a,3481,100, 0,1,0x00,0xc8,0x29,0x80,0x05,0x05,0x0}} 755 {0x15, 0x6c, {0x02a,3481,100, 0,1,0x00,0xc8,0x29,0x80,0x05,0x05,0x0}}
756}; 756};
757static const opl4_region_t regions_65[] = { /* Goblins */ 757static const struct opl4_region regions_65[] = { /* Goblins */
758 {0x15, 0x6c, {0x002,4501,100,-1,2,0x00,0xca,0x2a,0x40,0x01,0x05,0x0}}, 758 {0x15, 0x6c, {0x002,4501,100,-1,2,0x00,0xca,0x2a,0x40,0x01,0x05,0x0}},
759 {0x15, 0x6c, {0x009,9679, 20, 1,4,0x00,0x3c,0x0c,0x22,0x11,0x06,0x0}} 759 {0x15, 0x6c, {0x009,9679, 20, 1,4,0x00,0x3c,0x0c,0x22,0x11,0x06,0x0}}
760}; 760};
761static const opl4_region_t regions_66[] = { /* Echoes */ 761static const struct opl4_region regions_66[] = { /* Echoes */
762 {0x15, 0x6c, {0x02a,3487,100, 0,3,0x00,0xae,0x2b,0xf5,0x21,0x06,0x0}}, 762 {0x15, 0x6c, {0x02a,3487,100, 0,3,0x00,0xae,0x2b,0xf5,0x21,0x06,0x0}},
763 {0x00, 0x7f, {0x124,4027,100, 0,3,0x00,0xae,0x2b,0x85,0x23,0x07,0x0}} 763 {0x00, 0x7f, {0x124,4027,100, 0,3,0x00,0xae,0x2b,0x85,0x23,0x07,0x0}}
764}; 764};
765static const opl4_region_t regions_67[] = { /* Sci-Fi */ 765static const struct opl4_region regions_67[] = { /* Sci-Fi */
766 {0x15, 0x31, {0x00c,6940,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}}, 766 {0x15, 0x31, {0x00c,6940,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}},
767 {0x32, 0x38, {0x00d,5413,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}}, 767 {0x32, 0x38, {0x00d,5413,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}},
768 {0x39, 0x47, {0x00e,4382,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}}, 768 {0x39, 0x47, {0x00e,4382,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}},
769 {0x48, 0x6c, {0x00f,2846,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}}, 769 {0x48, 0x6c, {0x00f,2846,100, 0,3,0x00,0xc8,0x2b,0x90,0x05,0x06,0x3}},
770 {0x15, 0x6c, {0x002,4498,100, 0,2,0x00,0xd4,0x22,0x80,0x01,0x05,0x0}} 770 {0x15, 0x6c, {0x002,4498,100, 0,2,0x00,0xd4,0x22,0x80,0x01,0x05,0x0}}
771}; 771};
772static const opl4_region_t regions_68[] = { /* Sitar */ 772static const struct opl4_region regions_68[] = { /* Sitar */
773 {0x00, 0x7f, {0x10f,4408,100, 0,2,0x00,0xc4,0x32,0xf4,0x15,0x16,0x1}} 773 {0x00, 0x7f, {0x10f,4408,100, 0,2,0x00,0xc4,0x32,0xf4,0x15,0x16,0x1}}
774}; 774};
775static const opl4_region_t regions_69[] = { /* Banjo */ 775static const struct opl4_region regions_69[] = { /* Banjo */
776 {0x15, 0x34, {0x013,5685,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}}, 776 {0x15, 0x34, {0x013,5685,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}},
777 {0x35, 0x38, {0x014,5009,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}}, 777 {0x35, 0x38, {0x014,5009,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}},
778 {0x39, 0x3c, {0x012,4520,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}}, 778 {0x39, 0x3c, {0x012,4520,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}},
@@ -780,21 +780,21 @@ static const opl4_region_t regions_69[] = { /* Banjo */
780 {0x45, 0x4c, {0x017,2661,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}}, 780 {0x45, 0x4c, {0x017,2661,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}},
781 {0x4d, 0x6d, {0x016,1632,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}} 781 {0x4d, 0x6d, {0x016,1632,100, 0,0,0x00,0xdc,0x38,0xf6,0x15,0x09,0x0}}
782}; 782};
783static const opl4_region_t regions_6a[] = { /* Shamisen */ 783static const struct opl4_region regions_6a[] = { /* Shamisen */
784 {0x15, 0x6c, {0x10e,3273,100, 0,0,0x00,0xc0,0x28,0xf7,0x76,0x08,0x0}} 784 {0x15, 0x6c, {0x10e,3273,100, 0,0,0x00,0xc0,0x28,0xf7,0x76,0x08,0x0}}
785}; 785};
786static const opl4_region_t regions_6b[] = { /* Koto */ 786static const struct opl4_region regions_6b[] = { /* Koto */
787 {0x00, 0x7f, {0x0a9,4033,100, 0,0,0x00,0xc6,0x20,0xf0,0x06,0x07,0x0}} 787 {0x00, 0x7f, {0x0a9,4033,100, 0,0,0x00,0xc6,0x20,0xf0,0x06,0x07,0x0}}
788}; 788};
789static const opl4_region_t regions_6c[] = { /* Kalimba */ 789static const struct opl4_region regions_6c[] = { /* Kalimba */
790 {0x00, 0x7f, {0x137,3749,100, 0,0,0x00,0xce,0x38,0xf5,0x18,0x08,0x0}} 790 {0x00, 0x7f, {0x137,3749,100, 0,0,0x00,0xce,0x38,0xf5,0x18,0x08,0x0}}
791}; 791};
792static const opl4_region_t regions_6d[] = { /* Bagpipe */ 792static const struct opl4_region regions_6d[] = { /* Bagpipe */
793 {0x15, 0x39, {0x0a4,7683,100, 0,4,0x00,0xc0,0x1c,0xf0,0x00,0x09,0x0}}, 793 {0x15, 0x39, {0x0a4,7683,100, 0,4,0x00,0xc0,0x1c,0xf0,0x00,0x09,0x0}},
794 {0x15, 0x39, {0x0a7,7680,100, 0,1,0x00,0xaa,0x19,0xf0,0x00,0x09,0x0}}, 794 {0x15, 0x39, {0x0a7,7680,100, 0,1,0x00,0xaa,0x19,0xf0,0x00,0x09,0x0}},
795 {0x3a, 0x6c, {0x0a8,3697,100, 0,1,0x00,0xaa,0x19,0xf0,0x00,0x09,0x0}} 795 {0x3a, 0x6c, {0x0a8,3697,100, 0,1,0x00,0xaa,0x19,0xf0,0x00,0x09,0x0}}
796}; 796};
797static const opl4_region_t regions_6e[] = { /* Fiddle */ 797static const struct opl4_region regions_6e[] = { /* Fiddle */
798 {0x15, 0x3a, {0x105,5158,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}}, 798 {0x15, 0x3a, {0x105,5158,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}},
799 {0x3b, 0x3f, {0x102,4754,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}}, 799 {0x3b, 0x3f, {0x102,4754,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}},
800 {0x40, 0x41, {0x106,4132,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}}, 800 {0x40, 0x41, {0x106,4132,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}},
@@ -806,64 +806,64 @@ static const opl4_region_t regions_6e[] = { /* Fiddle */
806 {0x4f, 0x51, {0x10d,2166,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}}, 806 {0x4f, 0x51, {0x10d,2166,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}},
807 {0x52, 0x6c, {0x109,1825,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}} 807 {0x52, 0x6c, {0x109,1825,100, 0,1,0x00,0xca,0x31,0xf3,0x20,0x09,0x0}}
808}; 808};
809static const opl4_region_t regions_6f[] = { /* Shanai */ 809static const struct opl4_region regions_6f[] = { /* Shanai */
810 {0x15, 0x6c, {0x041,6946,100, 0,1,0x00,0xc4,0x31,0x95,0x20,0x09,0x0}} 810 {0x15, 0x6c, {0x041,6946,100, 0,1,0x00,0xc4,0x31,0x95,0x20,0x09,0x0}}
811}; 811};
812static const opl4_region_t regions_70[] = { /* Tinkle Bell */ 812static const struct opl4_region regions_70[] = { /* Tinkle Bell */
813 {0x15, 0x73, {0x0f3,1821,100, 0,3,0x00,0xc8,0x3b,0xd6,0x25,0x25,0x0}}, 813 {0x15, 0x73, {0x0f3,1821,100, 0,3,0x00,0xc8,0x3b,0xd6,0x25,0x25,0x0}},
814 {0x00, 0x7f, {0x137,5669,100, 0,3,0x00,0x66,0x3b,0xf5,0x18,0x08,0x0}} 814 {0x00, 0x7f, {0x137,5669,100, 0,3,0x00,0x66,0x3b,0xf5,0x18,0x08,0x0}}
815}; 815};
816static const opl4_region_t regions_71[] = { /* Agogo */ 816static const struct opl4_region regions_71[] = { /* Agogo */
817 {0x15, 0x74, {0x00b,2474,100, 0,0,0x00,0xd2,0x38,0xf0,0x00,0x09,0x0}} 817 {0x15, 0x74, {0x00b,2474,100, 0,0,0x00,0xd2,0x38,0xf0,0x00,0x09,0x0}}
818}; 818};
819static const opl4_region_t regions_72[] = { /* Steel Drums */ 819static const struct opl4_region regions_72[] = { /* Steel Drums */
820 {0x01, 0x7f, {0x0fe,3670,100, 0,0,0x00,0xca,0x38,0xf3,0x06,0x17,0x1}}, 820 {0x01, 0x7f, {0x0fe,3670,100, 0,0,0x00,0xca,0x38,0xf3,0x06,0x17,0x1}},
821 {0x15, 0x6c, {0x100,9602,100, 0,0,0x00,0x54,0x38,0xb0,0x05,0x16,0x1}} 821 {0x15, 0x6c, {0x100,9602,100, 0,0,0x00,0x54,0x38,0xb0,0x05,0x16,0x1}}
822}; 822};
823static const opl4_region_t regions_73[] = { /* Woodblock */ 823static const struct opl4_region regions_73[] = { /* Woodblock */
824 {0x15, 0x6c, {0x02c,2963, 50, 0,0,0x07,0xd4,0x00,0xf0,0x00,0x09,0x0}} 824 {0x15, 0x6c, {0x02c,2963, 50, 0,0,0x07,0xd4,0x00,0xf0,0x00,0x09,0x0}}
825}; 825};
826static const opl4_region_t regions_74[] = { /* Taiko Drum */ 826static const struct opl4_region regions_74[] = { /* Taiko Drum */
827 {0x13, 0x6c, {0x03e,1194, 50, 0,0,0x00,0xaa,0x38,0xf0,0x04,0x04,0x0}} 827 {0x13, 0x6c, {0x03e,1194, 50, 0,0,0x00,0xaa,0x38,0xf0,0x04,0x04,0x0}}
828}; 828};
829static const opl4_region_t regions_75[] = { /* Melodic Tom */ 829static const struct opl4_region regions_75[] = { /* Melodic Tom */
830 {0x15, 0x6c, {0x0c7,6418, 50, 0,0,0x00,0xe4,0x38,0xf0,0x05,0x01,0x0}} 830 {0x15, 0x6c, {0x0c7,6418, 50, 0,0,0x00,0xe4,0x38,0xf0,0x05,0x01,0x0}}
831}; 831};
832static const opl4_region_t regions_76[] = { /* Synth Drum */ 832static const struct opl4_region regions_76[] = { /* Synth Drum */
833 {0x15, 0x6c, {0x026,3898, 50, 0,0,0x00,0xd0,0x38,0xf0,0x04,0x04,0x0}} 833 {0x15, 0x6c, {0x026,3898, 50, 0,0,0x00,0xd0,0x38,0xf0,0x04,0x04,0x0}}
834}; 834};
835static const opl4_region_t regions_77[] = { /* Reverse Cymbal */ 835static const struct opl4_region regions_77[] = { /* Reverse Cymbal */
836 {0x15, 0x6c, {0x031,4138, 50, 0,0,0x00,0xfe,0x38,0x3a,0xf0,0x09,0x0}} 836 {0x15, 0x6c, {0x031,4138, 50, 0,0,0x00,0xfe,0x38,0x3a,0xf0,0x09,0x0}}
837}; 837};
838static const opl4_region_t regions_78[] = { /* Guitar Fret Noise */ 838static const struct opl4_region regions_78[] = { /* Guitar Fret Noise */
839 {0x15, 0x6c, {0x138,5266,100, 0,0,0x00,0xa0,0x38,0xf0,0x00,0x09,0x0}} 839 {0x15, 0x6c, {0x138,5266,100, 0,0,0x00,0xa0,0x38,0xf0,0x00,0x09,0x0}}
840}; 840};
841static const opl4_region_t regions_79[] = { /* Breath Noise */ 841static const struct opl4_region regions_79[] = { /* Breath Noise */
842 {0x01, 0x7f, {0x125,4269,100, 0,0,0x1e,0xd0,0x38,0xf0,0x00,0x09,0x0}} 842 {0x01, 0x7f, {0x125,4269,100, 0,0,0x1e,0xd0,0x38,0xf0,0x00,0x09,0x0}}
843}; 843};
844static const opl4_region_t regions_7a[] = { /* Seashore */ 844static const struct opl4_region regions_7a[] = { /* Seashore */
845 {0x15, 0x6c, {0x008,2965, 20,-2,0,0x00,0xfe,0x00,0x20,0x03,0x04,0x0}}, 845 {0x15, 0x6c, {0x008,2965, 20,-2,0,0x00,0xfe,0x00,0x20,0x03,0x04,0x0}},
846 {0x01, 0x7f, {0x037,4394, 20, 2,0,0x14,0xfe,0x00,0x20,0x04,0x05,0x0}} 846 {0x01, 0x7f, {0x037,4394, 20, 2,0,0x14,0xfe,0x00,0x20,0x04,0x05,0x0}}
847}; 847};
848static const opl4_region_t regions_7b[] = { /* Bird Tweet */ 848static const struct opl4_region regions_7b[] = { /* Bird Tweet */
849 {0x15, 0x6c, {0x009,8078, 5,-4,7,0x00,0xc2,0x0f,0x22,0x12,0x07,0x0}}, 849 {0x15, 0x6c, {0x009,8078, 5,-4,7,0x00,0xc2,0x0f,0x22,0x12,0x07,0x0}},
850 {0x15, 0x6c, {0x009,3583, 5, 4,5,0x00,0xae,0x15,0x72,0x12,0x07,0x0}} 850 {0x15, 0x6c, {0x009,3583, 5, 4,5,0x00,0xae,0x15,0x72,0x12,0x07,0x0}}
851}; 851};
852static const opl4_region_t regions_7c[] = { /* Telephone Ring */ 852static const struct opl4_region regions_7c[] = { /* Telephone Ring */
853 {0x15, 0x6c, {0x003,3602, 10, 0,0,0x00,0xce,0x00,0xf0,0x00,0x0f,0x0}} 853 {0x15, 0x6c, {0x003,3602, 10, 0,0,0x00,0xce,0x00,0xf0,0x00,0x0f,0x0}}
854}; 854};
855static const opl4_region_t regions_7d[] = { /* Helicopter */ 855static const struct opl4_region regions_7d[] = { /* Helicopter */
856 {0x0c, 0x7f, {0x001,2965, 10,-2,0,0x00,0xe0,0x08,0x30,0x01,0x07,0x0}}, 856 {0x0c, 0x7f, {0x001,2965, 10,-2,0,0x00,0xe0,0x08,0x30,0x01,0x07,0x0}},
857 {0x01, 0x7f, {0x037,4394, 10, 2,0,0x44,0x76,0x00,0x30,0x01,0x07,0x0}} 857 {0x01, 0x7f, {0x037,4394, 10, 2,0,0x44,0x76,0x00,0x30,0x01,0x07,0x0}}
858}; 858};
859static const opl4_region_t regions_7e[] = { /* Applause */ 859static const struct opl4_region regions_7e[] = { /* Applause */
860 {0x15, 0x6c, {0x036,8273, 20,-6,7,0x00,0xc4,0x0f,0x70,0x01,0x05,0x0}}, 860 {0x15, 0x6c, {0x036,8273, 20,-6,7,0x00,0xc4,0x0f,0x70,0x01,0x05,0x0}},
861 {0x15, 0x6c, {0x036,8115, 5, 6,7,0x00,0xc6,0x07,0x70,0x01,0x05,0x0}} 861 {0x15, 0x6c, {0x036,8115, 5, 6,7,0x00,0xc6,0x07,0x70,0x01,0x05,0x0}}
862}; 862};
863static const opl4_region_t regions_7f[] = { /* Gun Shot */ 863static const struct opl4_region regions_7f[] = { /* Gun Shot */
864 {0x15, 0x6c, {0x139,2858, 20, 0,0,0x00,0xbe,0x38,0xf0,0x03,0x00,0x0}} 864 {0x15, 0x6c, {0x139,2858, 20, 0,0,0x00,0xbe,0x38,0xf0,0x03,0x00,0x0}}
865}; 865};
866static const opl4_region_t regions_drums[] = { 866static const struct opl4_region regions_drums[] = {
867 {0x18, 0x18, {0x0cb,6397,100, 3,0,0x00,0xf4,0x38,0xc9,0x1c,0x0c,0x0}}, 867 {0x18, 0x18, {0x0cb,6397,100, 3,0,0x00,0xf4,0x38,0xc9,0x1c,0x0c,0x0}},
868 {0x19, 0x19, {0x0c4,3714,100, 0,0,0x00,0xe0,0x00,0x97,0x19,0x09,0x0}}, 868 {0x19, 0x19, {0x0c4,3714,100, 0,0,0x00,0xe0,0x00,0x97,0x19,0x09,0x0}},
869 {0x1a, 0x1a, {0x0c4,3519,100, 0,0,0x00,0xea,0x00,0x61,0x01,0x07,0x0}}, 869 {0x1a, 0x1a, {0x0c4,3519,100, 0,0,0x00,0xea,0x00,0x61,0x01,0x07,0x0}},
@@ -924,7 +924,7 @@ static const opl4_region_t regions_drums[] = {
924}; 924};
925 925
926#define REGION(num) { ARRAY_SIZE(regions ## num), regions ## num } 926#define REGION(num) { ARRAY_SIZE(regions ## num), regions ## num }
927const opl4_region_ptr_t snd_yrw801_regions[0x81] = { 927const struct opl4_region_ptr snd_yrw801_regions[0x81] = {
928 REGION(_00), REGION(_01), REGION(_02), REGION(_03), 928 REGION(_00), REGION(_01), REGION(_02), REGION(_03),
929 REGION(_04), REGION(_05), REGION(_06), REGION(_07), 929 REGION(_04), REGION(_05), REGION(_06), REGION(_07),
930 REGION(_08), REGION(_09), REGION(_0a), REGION(_0b), 930 REGION(_08), REGION(_09), REGION(_0a), REGION(_0b),
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c
index 1ed58df42671..29676d800cae 100644
--- a/sound/drivers/serial-u16550.c
+++ b/sound/drivers/serial-u16550.c
@@ -33,6 +33,8 @@
33#include <sound/driver.h> 33#include <sound/driver.h>
34#include <linux/init.h> 34#include <linux/init.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/err.h>
37#include <linux/platform_device.h>
36#include <linux/slab.h> 38#include <linux/slab.h>
37#include <linux/ioport.h> 39#include <linux/ioport.h>
38#include <linux/moduleparam.h> 40#include <linux/moduleparam.h>
@@ -116,10 +118,10 @@ MODULE_PARM_DESC(adaptor, "Type of adaptor.");
116#define SERIAL_MODE_OUTPUT_TRIGGERED (1 << 3) 118#define SERIAL_MODE_OUTPUT_TRIGGERED (1 << 3)
117 119
118typedef struct _snd_uart16550 { 120typedef struct _snd_uart16550 {
119 snd_card_t *card; 121 struct snd_card *card;
120 snd_rawmidi_t *rmidi; 122 struct snd_rawmidi *rmidi;
121 snd_rawmidi_substream_t *midi_output[SNDRV_SERIAL_MAX_OUTS]; 123 struct snd_rawmidi_substream *midi_output[SNDRV_SERIAL_MAX_OUTS];
122 snd_rawmidi_substream_t *midi_input[SNDRV_SERIAL_MAX_INS]; 124 struct snd_rawmidi_substream *midi_input[SNDRV_SERIAL_MAX_INS];
123 125
124 int filemode; //open status of file 126 int filemode; //open status of file
125 127
@@ -166,7 +168,7 @@ typedef struct _snd_uart16550 {
166 168
167} snd_uart16550_t; 169} snd_uart16550_t;
168 170
169static snd_card_t *snd_serial_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 171static struct platform_device *devices[SNDRV_CARDS];
170 172
171static inline void snd_uart16550_add_timer(snd_uart16550_t *uart) 173static inline void snd_uart16550_add_timer(snd_uart16550_t *uart)
172{ 174{
@@ -509,7 +511,7 @@ static void snd_uart16550_do_close(snd_uart16550_t * uart)
509 } 511 }
510} 512}
511 513
512static int snd_uart16550_input_open(snd_rawmidi_substream_t * substream) 514static int snd_uart16550_input_open(struct snd_rawmidi_substream *substream)
513{ 515{
514 unsigned long flags; 516 unsigned long flags;
515 snd_uart16550_t *uart = substream->rmidi->private_data; 517 snd_uart16550_t *uart = substream->rmidi->private_data;
@@ -523,7 +525,7 @@ static int snd_uart16550_input_open(snd_rawmidi_substream_t * substream)
523 return 0; 525 return 0;
524} 526}
525 527
526static int snd_uart16550_input_close(snd_rawmidi_substream_t * substream) 528static int snd_uart16550_input_close(struct snd_rawmidi_substream *substream)
527{ 529{
528 unsigned long flags; 530 unsigned long flags;
529 snd_uart16550_t *uart = substream->rmidi->private_data; 531 snd_uart16550_t *uart = substream->rmidi->private_data;
@@ -537,7 +539,7 @@ static int snd_uart16550_input_close(snd_rawmidi_substream_t * substream)
537 return 0; 539 return 0;
538} 540}
539 541
540static void snd_uart16550_input_trigger(snd_rawmidi_substream_t * substream, int up) 542static void snd_uart16550_input_trigger(struct snd_rawmidi_substream *substream, int up)
541{ 543{
542 unsigned long flags; 544 unsigned long flags;
543 snd_uart16550_t *uart = substream->rmidi->private_data; 545 snd_uart16550_t *uart = substream->rmidi->private_data;
@@ -551,7 +553,7 @@ static void snd_uart16550_input_trigger(snd_rawmidi_substream_t * substream, int
551 spin_unlock_irqrestore(&uart->open_lock, flags); 553 spin_unlock_irqrestore(&uart->open_lock, flags);
552} 554}
553 555
554static int snd_uart16550_output_open(snd_rawmidi_substream_t * substream) 556static int snd_uart16550_output_open(struct snd_rawmidi_substream *substream)
555{ 557{
556 unsigned long flags; 558 unsigned long flags;
557 snd_uart16550_t *uart = substream->rmidi->private_data; 559 snd_uart16550_t *uart = substream->rmidi->private_data;
@@ -565,7 +567,7 @@ static int snd_uart16550_output_open(snd_rawmidi_substream_t * substream)
565 return 0; 567 return 0;
566}; 568};
567 569
568static int snd_uart16550_output_close(snd_rawmidi_substream_t * substream) 570static int snd_uart16550_output_close(struct snd_rawmidi_substream *substream)
569{ 571{
570 unsigned long flags; 572 unsigned long flags;
571 snd_uart16550_t *uart = substream->rmidi->private_data; 573 snd_uart16550_t *uart = substream->rmidi->private_data;
@@ -603,7 +605,7 @@ static inline int snd_uart16550_write_buffer(snd_uart16550_t *uart, unsigned cha
603 return 0; 605 return 0;
604} 606}
605 607
606static int snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substream_t * substream, unsigned char midi_byte) 608static int snd_uart16550_output_byte(snd_uart16550_t *uart, struct snd_rawmidi_substream *substream, unsigned char midi_byte)
607{ 609{
608 if (uart->buff_in_count == 0 /* Buffer empty? */ 610 if (uart->buff_in_count == 0 /* Buffer empty? */
609 && ((uart->adaptor != SNDRV_SERIAL_MS124W_SA && 611 && ((uart->adaptor != SNDRV_SERIAL_MS124W_SA &&
@@ -636,7 +638,7 @@ static int snd_uart16550_output_byte(snd_uart16550_t *uart, snd_rawmidi_substrea
636 return 1; 638 return 1;
637} 639}
638 640
639static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream) 641static void snd_uart16550_output_write(struct snd_rawmidi_substream *substream)
640{ 642{
641 unsigned long flags; 643 unsigned long flags;
642 unsigned char midi_byte, addr_byte; 644 unsigned char midi_byte, addr_byte;
@@ -715,7 +717,7 @@ static void snd_uart16550_output_write(snd_rawmidi_substream_t * substream)
715 spin_unlock_irqrestore(&uart->open_lock, flags); 717 spin_unlock_irqrestore(&uart->open_lock, flags);
716} 718}
717 719
718static void snd_uart16550_output_trigger(snd_rawmidi_substream_t * substream, int up) 720static void snd_uart16550_output_trigger(struct snd_rawmidi_substream *substream, int up)
719{ 721{
720 unsigned long flags; 722 unsigned long flags;
721 snd_uart16550_t *uart = substream->rmidi->private_data; 723 snd_uart16550_t *uart = substream->rmidi->private_data;
@@ -731,14 +733,14 @@ static void snd_uart16550_output_trigger(snd_rawmidi_substream_t * substream, in
731 snd_uart16550_output_write(substream); 733 snd_uart16550_output_write(substream);
732} 734}
733 735
734static snd_rawmidi_ops_t snd_uart16550_output = 736static struct snd_rawmidi_ops snd_uart16550_output =
735{ 737{
736 .open = snd_uart16550_output_open, 738 .open = snd_uart16550_output_open,
737 .close = snd_uart16550_output_close, 739 .close = snd_uart16550_output_close,
738 .trigger = snd_uart16550_output_trigger, 740 .trigger = snd_uart16550_output_trigger,
739}; 741};
740 742
741static snd_rawmidi_ops_t snd_uart16550_input = 743static struct snd_rawmidi_ops snd_uart16550_input =
742{ 744{
743 .open = snd_uart16550_input_open, 745 .open = snd_uart16550_input_open,
744 .close = snd_uart16550_input_close, 746 .close = snd_uart16550_input_close,
@@ -754,13 +756,13 @@ static int snd_uart16550_free(snd_uart16550_t *uart)
754 return 0; 756 return 0;
755}; 757};
756 758
757static int snd_uart16550_dev_free(snd_device_t *device) 759static int snd_uart16550_dev_free(struct snd_device *device)
758{ 760{
759 snd_uart16550_t *uart = device->device_data; 761 snd_uart16550_t *uart = device->device_data;
760 return snd_uart16550_free(uart); 762 return snd_uart16550_free(uart);
761} 763}
762 764
763static int __init snd_uart16550_create(snd_card_t * card, 765static int __init snd_uart16550_create(struct snd_card *card,
764 unsigned long iobase, 766 unsigned long iobase,
765 int irq, 767 int irq,
766 unsigned int speed, 768 unsigned int speed,
@@ -769,7 +771,7 @@ static int __init snd_uart16550_create(snd_card_t * card,
769 int droponfull, 771 int droponfull,
770 snd_uart16550_t **ruart) 772 snd_uart16550_t **ruart)
771{ 773{
772 static snd_device_ops_t ops = { 774 static struct snd_device_ops ops = {
773 .dev_free = snd_uart16550_dev_free, 775 .dev_free = snd_uart16550_dev_free,
774 }; 776 };
775 snd_uart16550_t *uart; 777 snd_uart16550_t *uart;
@@ -838,19 +840,19 @@ static int __init snd_uart16550_create(snd_card_t * card,
838 return 0; 840 return 0;
839} 841}
840 842
841static void __init snd_uart16550_substreams(snd_rawmidi_str_t *stream) 843static void __init snd_uart16550_substreams(struct snd_rawmidi_str *stream)
842{ 844{
843 struct list_head *list; 845 struct list_head *list;
844 846
845 list_for_each(list, &stream->substreams) { 847 list_for_each(list, &stream->substreams) {
846 snd_rawmidi_substream_t *substream = list_entry(list, snd_rawmidi_substream_t, list); 848 struct snd_rawmidi_substream *substream = list_entry(list, struct snd_rawmidi_substream, list);
847 sprintf(substream->name, "Serial MIDI %d", substream->number + 1); 849 sprintf(substream->name, "Serial MIDI %d", substream->number + 1);
848 } 850 }
849} 851}
850 852
851static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, snd_rawmidi_t **rmidi) 853static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int outs, int ins, struct snd_rawmidi **rmidi)
852{ 854{
853 snd_rawmidi_t *rrawmidi; 855 struct snd_rawmidi *rrawmidi;
854 int err; 856 int err;
855 857
856 if ((err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device, outs, ins, &rrawmidi)) < 0) 858 if ((err = snd_rawmidi_new(uart->card, "UART Serial MIDI", device, outs, ins, &rrawmidi)) < 0)
@@ -869,14 +871,12 @@ static int __init snd_uart16550_rmidi(snd_uart16550_t *uart, int device, int out
869 return 0; 871 return 0;
870} 872}
871 873
872static int __init snd_serial_probe(int dev) 874static int __init snd_serial_probe(struct platform_device *devptr)
873{ 875{
874 snd_card_t *card; 876 struct snd_card *card;
875 snd_uart16550_t *uart; 877 snd_uart16550_t *uart;
876 int err; 878 int err;
877 879 int dev = devptr->id;
878 if (!enable[dev])
879 return -ENOENT;
880 880
881 switch (adaptor[dev]) { 881 switch (adaptor[dev]) {
882 case SNDRV_SERIAL_SOUNDCANVAS: 882 case SNDRV_SERIAL_SOUNDCANVAS:
@@ -942,13 +942,12 @@ static int __init snd_serial_probe(int dev)
942 adaptor_names[uart->adaptor], 942 adaptor_names[uart->adaptor],
943 uart->drop_on_full); 943 uart->drop_on_full);
944 944
945 if ((err = snd_card_set_generic_dev(card)) < 0) 945 snd_card_set_dev(card, &devptr->dev);
946 goto _err;
947 946
948 if ((err = snd_card_register(card)) < 0) 947 if ((err = snd_card_register(card)) < 0)
949 goto _err; 948 goto _err;
950 949
951 snd_serial_cards[dev] = card; 950 platform_set_drvdata(devptr, card);
952 return 0; 951 return 0;
953 952
954 _err: 953 _err:
@@ -956,33 +955,68 @@ static int __init snd_serial_probe(int dev)
956 return err; 955 return err;
957} 956}
958 957
958static int snd_serial_remove(struct platform_device *devptr)
959{
960 snd_card_free(platform_get_drvdata(devptr));
961 platform_set_drvdata(devptr, NULL);
962 return 0;
963}
964
965#define SND_SERIAL_DRIVER "snd_serial_u16550"
966
967static struct platform_driver snd_serial_driver = {
968 .probe = snd_serial_probe,
969 .remove = snd_serial_remove,
970 .driver = {
971 .name = SND_SERIAL_DRIVER
972 },
973};
974
975static void __init_or_module snd_serial_unregister_all(void)
976{
977 int i;
978
979 for (i = 0; i < ARRAY_SIZE(devices); ++i)
980 platform_device_unregister(devices[i]);
981 platform_driver_unregister(&snd_serial_driver);
982}
983
959static int __init alsa_card_serial_init(void) 984static int __init alsa_card_serial_init(void)
960{ 985{
961 int dev = 0; 986 int i, cards, err;
962 int cards = 0;
963 987
964 for (dev = 0; dev < SNDRV_CARDS; dev++) { 988 if ((err = platform_driver_register(&snd_serial_driver)) < 0)
965 if (snd_serial_probe(dev) == 0) 989 return err;
966 cards++;
967 }
968 990
969 if (cards == 0) { 991 cards = 0;
992 for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
993 struct platform_device *device;
994 device = platform_device_register_simple(SND_SERIAL_DRIVER,
995 i, NULL, 0);
996 if (IS_ERR(device)) {
997 err = PTR_ERR(device);
998 goto errout;
999 }
1000 devices[i] = device;
1001 cards++;
1002 }
1003 if (! cards) {
970#ifdef MODULE 1004#ifdef MODULE
971 printk(KERN_ERR "serial midi soundcard not found or device busy\n"); 1005 printk(KERN_ERR "serial midi soundcard not found or device busy\n");
972#endif 1006#endif
973 return -ENODEV; 1007 err = -ENODEV;
1008 goto errout;
974 } 1009 }
975 return 0; 1010 return 0;
1011
1012 errout:
1013 snd_serial_unregister_all();
1014 return err;
976} 1015}
977 1016
978static void __exit alsa_card_serial_exit(void) 1017static void __exit alsa_card_serial_exit(void)
979{ 1018{
980 int dev; 1019 snd_serial_unregister_all();
981
982 for (dev = 0; dev < SNDRV_CARDS; dev++) {
983 if (snd_serial_cards[dev] != NULL)
984 snd_card_free(snd_serial_cards[dev]);
985 }
986} 1020}
987 1021
988module_init(alsa_card_serial_init) 1022module_init(alsa_card_serial_init)
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index af12185ab8a2..4258723de2ab 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -45,6 +45,8 @@
45#include <linux/init.h> 45#include <linux/init.h>
46#include <linux/wait.h> 46#include <linux/wait.h>
47#include <linux/sched.h> 47#include <linux/sched.h>
48#include <linux/err.h>
49#include <linux/platform_device.h>
48#include <linux/moduleparam.h> 50#include <linux/moduleparam.h>
49#include <sound/core.h> 51#include <sound/core.h>
50#include <sound/seq_kernel.h> 52#include <sound/seq_kernel.h>
@@ -59,7 +61,7 @@ MODULE_DESCRIPTION("Dummy soundcard for virtual rawmidi devices");
59MODULE_LICENSE("GPL"); 61MODULE_LICENSE("GPL");
60MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}"); 62MODULE_SUPPORTED_DEVICE("{{ALSA,Virtual rawmidi device}}");
61 63
62#define MAX_MIDI_DEVICES 8 64#define MAX_MIDI_DEVICES 4
63 65
64static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ 66static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
65static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 67static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -73,24 +75,23 @@ MODULE_PARM_DESC(id, "ID string for virmidi soundcard.");
73module_param_array(enable, bool, NULL, 0444); 75module_param_array(enable, bool, NULL, 0444);
74MODULE_PARM_DESC(enable, "Enable this soundcard."); 76MODULE_PARM_DESC(enable, "Enable this soundcard.");
75module_param_array(midi_devs, int, NULL, 0444); 77module_param_array(midi_devs, int, NULL, 0444);
76MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-8)"); 78MODULE_PARM_DESC(midi_devs, "MIDI devices # (1-4)");
77 79
78typedef struct snd_card_virmidi { 80struct snd_card_virmidi {
79 snd_card_t *card; 81 struct snd_card *card;
80 snd_rawmidi_t *midi[MAX_MIDI_DEVICES]; 82 struct snd_rawmidi *midi[MAX_MIDI_DEVICES];
81} snd_card_virmidi_t; 83};
82 84
83static snd_card_t *snd_virmidi_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 85static struct platform_device *devices[SNDRV_CARDS];
84 86
85 87
86static int __init snd_card_virmidi_probe(int dev) 88static int __init snd_virmidi_probe(struct platform_device *devptr)
87{ 89{
88 snd_card_t *card; 90 struct snd_card *card;
89 struct snd_card_virmidi *vmidi; 91 struct snd_card_virmidi *vmidi;
90 int idx, err; 92 int idx, err;
93 int dev = devptr->id;
91 94
92 if (!enable[dev])
93 return -ENODEV;
94 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 95 card = snd_card_new(index[dev], id[dev], THIS_MODULE,
95 sizeof(struct snd_card_virmidi)); 96 sizeof(struct snd_card_virmidi));
96 if (card == NULL) 97 if (card == NULL)
@@ -103,8 +104,8 @@ static int __init snd_card_virmidi_probe(int dev)
103 midi_devs[dev] = MAX_MIDI_DEVICES; 104 midi_devs[dev] = MAX_MIDI_DEVICES;
104 } 105 }
105 for (idx = 0; idx < midi_devs[dev]; idx++) { 106 for (idx = 0; idx < midi_devs[dev]; idx++) {
106 snd_rawmidi_t *rmidi; 107 struct snd_rawmidi *rmidi;
107 snd_virmidi_dev_t *rdev; 108 struct snd_virmidi_dev *rdev;
108 if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0) 109 if ((err = snd_virmidi_new(card, idx, &rmidi)) < 0)
109 goto __nodev; 110 goto __nodev;
110 rdev = rmidi->private_data; 111 rdev = rmidi->private_data;
@@ -117,11 +118,10 @@ static int __init snd_card_virmidi_probe(int dev)
117 strcpy(card->shortname, "VirMIDI"); 118 strcpy(card->shortname, "VirMIDI");
118 sprintf(card->longname, "Virtual MIDI Card %i", dev + 1); 119 sprintf(card->longname, "Virtual MIDI Card %i", dev + 1);
119 120
120 if ((err = snd_card_set_generic_dev(card)) < 0) 121 snd_card_set_dev(card, &devptr->dev);
121 goto __nodev;
122 122
123 if ((err = snd_card_register(card)) == 0) { 123 if ((err = snd_card_register(card)) == 0) {
124 snd_virmidi_cards[dev] = card; 124 platform_set_drvdata(devptr, card);
125 return 0; 125 return 0;
126 } 126 }
127 __nodev: 127 __nodev:
@@ -129,34 +129,68 @@ static int __init snd_card_virmidi_probe(int dev)
129 return err; 129 return err;
130} 130}
131 131
132static int __init alsa_card_virmidi_init(void) 132static int snd_virmidi_remove(struct platform_device *devptr)
133{ 133{
134 int dev, cards; 134 snd_card_free(platform_get_drvdata(devptr));
135 platform_set_drvdata(devptr, NULL);
136 return 0;
137}
135 138
136 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { 139#define SND_VIRMIDI_DRIVER "snd_virmidi"
137 if (snd_card_virmidi_probe(dev) < 0) { 140
138#ifdef MODULE 141static struct platform_driver snd_virmidi_driver = {
139 printk(KERN_ERR "Card-VirMIDI #%i not found or device busy\n", dev + 1); 142 .probe = snd_virmidi_probe,
140#endif 143 .remove = snd_virmidi_remove,
141 break; 144 .driver = {
145 .name = SND_VIRMIDI_DRIVER
146 },
147};
148
149static void __init_or_module snd_virmidi_unregister_all(void)
150{
151 int i;
152
153 for (i = 0; i < ARRAY_SIZE(devices); ++i)
154 platform_device_unregister(devices[i]);
155 platform_driver_unregister(&snd_virmidi_driver);
156}
157
158static int __init alsa_card_virmidi_init(void)
159{
160 int i, cards, err;
161
162 if ((err = platform_driver_register(&snd_virmidi_driver)) < 0)
163 return err;
164
165 cards = 0;
166 for (i = 0; i < SNDRV_CARDS && enable[i]; i++) {
167 struct platform_device *device;
168 device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
169 i, NULL, 0);
170 if (IS_ERR(device)) {
171 err = PTR_ERR(device);
172 goto errout;
142 } 173 }
174 devices[i] = device;
143 cards++; 175 cards++;
144 } 176 }
145 if (!cards) { 177 if (!cards) {
146#ifdef MODULE 178#ifdef MODULE
147 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); 179 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n");
148#endif 180#endif
149 return -ENODEV; 181 err = -ENODEV;
182 goto errout;
150 } 183 }
151 return 0; 184 return 0;
185
186 errout:
187 snd_virmidi_unregister_all();
188 return err;
152} 189}
153 190
154static void __exit alsa_card_virmidi_exit(void) 191static void __exit alsa_card_virmidi_exit(void)
155{ 192{
156 int dev; 193 snd_virmidi_unregister_all();
157
158 for (dev = 0; dev < SNDRV_CARDS; dev++)
159 snd_card_free(snd_virmidi_cards[dev]);
160} 194}
161 195
162module_init(alsa_card_virmidi_init) 196module_init(alsa_card_virmidi_init)
diff --git a/sound/drivers/vx/vx_core.c b/sound/drivers/vx/vx_core.c
index 4697b1d75cbb..43f615d7a545 100644
--- a/sound/drivers/vx/vx_core.c
+++ b/sound/drivers/vx/vx_core.c
@@ -41,18 +41,6 @@ MODULE_LICENSE("GPL");
41 41
42 42
43/* 43/*
44 * snd_vx_delay - delay for the specified time
45 * @xmsec: the time to delay in msec
46 */
47void snd_vx_delay(vx_core_t *chip, int xmsec)
48{
49 if (! in_interrupt() && xmsec >= 1000 / HZ)
50 msleep(xmsec);
51 else
52 mdelay(xmsec);
53}
54
55/*
56 * vx_check_reg_bit - wait for the specified bit is set/reset on a register 44 * vx_check_reg_bit - wait for the specified bit is set/reset on a register
57 * @reg: register to check 45 * @reg: register to check
58 * @mask: bit mask 46 * @mask: bit mask
@@ -61,7 +49,7 @@ void snd_vx_delay(vx_core_t *chip, int xmsec)
61 * 49 *
62 * returns zero if a bit matches, or a negative error code. 50 * returns zero if a bit matches, or a negative error code.
63 */ 51 */
64int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time) 52int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time)
65{ 53{
66 unsigned long end_time = jiffies + (time * HZ + 999) / 1000; 54 unsigned long end_time = jiffies + (time * HZ + 999) / 1000;
67#ifdef CONFIG_SND_DEBUG 55#ifdef CONFIG_SND_DEBUG
@@ -76,7 +64,7 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time)
76 do { 64 do {
77 if ((snd_vx_inb(chip, reg) & mask) == bit) 65 if ((snd_vx_inb(chip, reg) & mask) == bit)
78 return 0; 66 return 0;
79 //snd_vx_delay(chip, 10); 67 //msleep(10);
80 } while (time_after_eq(end_time, jiffies)); 68 } while (time_after_eq(end_time, jiffies));
81 snd_printd(KERN_DEBUG "vx_check_reg_bit: timeout, reg=%s, mask=0x%x, val=0x%x\n", reg_names[reg], mask, snd_vx_inb(chip, reg)); 69 snd_printd(KERN_DEBUG "vx_check_reg_bit: timeout, reg=%s, mask=0x%x, val=0x%x\n", reg_names[reg], mask, snd_vx_inb(chip, reg));
82 return -EIO; 70 return -EIO;
@@ -90,7 +78,7 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time)
90 * returns 0 if successful, or a negative error code. 78 * returns 0 if successful, or a negative error code.
91 * 79 *
92 */ 80 */
93static int vx_send_irq_dsp(vx_core_t *chip, int num) 81static int vx_send_irq_dsp(struct vx_core *chip, int num)
94{ 82{
95 int nirq; 83 int nirq;
96 84
@@ -111,7 +99,7 @@ static int vx_send_irq_dsp(vx_core_t *chip, int num)
111 * 99 *
112 * returns 0 if successful, or a negative error code. 100 * returns 0 if successful, or a negative error code.
113 */ 101 */
114static int vx_reset_chk(vx_core_t *chip) 102static int vx_reset_chk(struct vx_core *chip)
115{ 103{
116 /* Reset irq CHK */ 104 /* Reset irq CHK */
117 if (vx_send_irq_dsp(chip, IRQ_RESET_CHK) < 0) 105 if (vx_send_irq_dsp(chip, IRQ_RESET_CHK) < 0)
@@ -130,7 +118,7 @@ static int vx_reset_chk(vx_core_t *chip)
130 * the error code can be VX-specific, retrieved via vx_get_error(). 118 * the error code can be VX-specific, retrieved via vx_get_error().
131 * NB: call with spinlock held! 119 * NB: call with spinlock held!
132 */ 120 */
133static int vx_transfer_end(vx_core_t *chip, int cmd) 121static int vx_transfer_end(struct vx_core *chip, int cmd)
134{ 122{
135 int err; 123 int err;
136 124
@@ -168,7 +156,7 @@ static int vx_transfer_end(vx_core_t *chip, int cmd)
168 * the error code can be VX-specific, retrieved via vx_get_error(). 156 * the error code can be VX-specific, retrieved via vx_get_error().
169 * NB: call with spinlock held! 157 * NB: call with spinlock held!
170 */ 158 */
171static int vx_read_status(vx_core_t *chip, struct vx_rmh *rmh) 159static int vx_read_status(struct vx_core *chip, struct vx_rmh *rmh)
172{ 160{
173 int i, err, val, size; 161 int i, err, val, size;
174 162
@@ -248,7 +236,7 @@ static int vx_read_status(vx_core_t *chip, struct vx_rmh *rmh)
248 * 236 *
249 * this function doesn't call spinlock at all. 237 * this function doesn't call spinlock at all.
250 */ 238 */
251int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh) 239int vx_send_msg_nolock(struct vx_core *chip, struct vx_rmh *rmh)
252{ 240{
253 int i, err; 241 int i, err;
254 242
@@ -353,7 +341,7 @@ int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh)
353 * returns 0 if successful, or a negative error code. 341 * returns 0 if successful, or a negative error code.
354 * see vx_send_msg_nolock(). 342 * see vx_send_msg_nolock().
355 */ 343 */
356int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh) 344int vx_send_msg(struct vx_core *chip, struct vx_rmh *rmh)
357{ 345{
358 unsigned long flags; 346 unsigned long flags;
359 int err; 347 int err;
@@ -376,7 +364,7 @@ int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh)
376 * 364 *
377 * unlike RMH, no command is sent to DSP. 365 * unlike RMH, no command is sent to DSP.
378 */ 366 */
379int vx_send_rih_nolock(vx_core_t *chip, int cmd) 367int vx_send_rih_nolock(struct vx_core *chip, int cmd)
380{ 368{
381 int err; 369 int err;
382 370
@@ -413,7 +401,7 @@ int vx_send_rih_nolock(vx_core_t *chip, int cmd)
413 * 401 *
414 * see vx_send_rih_nolock(). 402 * see vx_send_rih_nolock().
415 */ 403 */
416int vx_send_rih(vx_core_t *chip, int cmd) 404int vx_send_rih(struct vx_core *chip, int cmd)
417{ 405{
418 unsigned long flags; 406 unsigned long flags;
419 int err; 407 int err;
@@ -430,7 +418,7 @@ int vx_send_rih(vx_core_t *chip, int cmd)
430 * snd_vx_boot_xilinx - boot up the xilinx interface 418 * snd_vx_boot_xilinx - boot up the xilinx interface
431 * @boot: the boot record to load 419 * @boot: the boot record to load
432 */ 420 */
433int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *boot) 421int snd_vx_load_boot_image(struct vx_core *chip, const struct firmware *boot)
434{ 422{
435 unsigned int i; 423 unsigned int i;
436 int no_fillup = vx_has_new_dsp(chip); 424 int no_fillup = vx_has_new_dsp(chip);
@@ -482,7 +470,7 @@ int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *boot)
482 * 470 *
483 * called from irq handler only 471 * called from irq handler only
484 */ 472 */
485static int vx_test_irq_src(vx_core_t *chip, unsigned int *ret) 473static int vx_test_irq_src(struct vx_core *chip, unsigned int *ret)
486{ 474{
487 int err; 475 int err;
488 476
@@ -503,7 +491,7 @@ static int vx_test_irq_src(vx_core_t *chip, unsigned int *ret)
503 */ 491 */
504static void vx_interrupt(unsigned long private_data) 492static void vx_interrupt(unsigned long private_data)
505{ 493{
506 vx_core_t *chip = (vx_core_t *) private_data; 494 struct vx_core *chip = (struct vx_core *) private_data;
507 unsigned int events; 495 unsigned int events;
508 496
509 if (chip->chip_status & VX_STAT_IS_STALE) 497 if (chip->chip_status & VX_STAT_IS_STALE)
@@ -547,7 +535,7 @@ static void vx_interrupt(unsigned long private_data)
547 */ 535 */
548irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs) 536irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs)
549{ 537{
550 vx_core_t *chip = dev; 538 struct vx_core *chip = dev;
551 539
552 if (! (chip->chip_status & VX_STAT_CHIP_INIT) || 540 if (! (chip->chip_status & VX_STAT_CHIP_INIT) ||
553 (chip->chip_status & VX_STAT_IS_STALE)) 541 (chip->chip_status & VX_STAT_IS_STALE))
@@ -560,7 +548,7 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs)
560 548
561/* 549/*
562 */ 550 */
563static void vx_reset_board(vx_core_t *chip, int cold_reset) 551static void vx_reset_board(struct vx_core *chip, int cold_reset)
564{ 552{
565 snd_assert(chip->ops->reset_board, return); 553 snd_assert(chip->ops->reset_board, return);
566 554
@@ -599,9 +587,9 @@ static void vx_reset_board(vx_core_t *chip, int cold_reset)
599 * proc interface 587 * proc interface
600 */ 588 */
601 589
602static void vx_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer) 590static void vx_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
603{ 591{
604 vx_core_t *chip = entry->private_data; 592 struct vx_core *chip = entry->private_data;
605 static char *audio_src_vxp[] = { "Line", "Mic", "Digital" }; 593 static char *audio_src_vxp[] = { "Line", "Mic", "Digital" };
606 static char *audio_src_vx2[] = { "Analog", "Analog", "Digital" }; 594 static char *audio_src_vx2[] = { "Analog", "Analog", "Digital" };
607 static char *clock_mode[] = { "Auto", "Internal", "External" }; 595 static char *clock_mode[] = { "Auto", "Internal", "External" };
@@ -642,9 +630,9 @@ static void vx_proc_read(snd_info_entry_t *entry, snd_info_buffer_t *buffer)
642 chip->ibl.granularity); 630 chip->ibl.granularity);
643} 631}
644 632
645static void vx_proc_init(vx_core_t *chip) 633static void vx_proc_init(struct vx_core *chip)
646{ 634{
647 snd_info_entry_t *entry; 635 struct snd_info_entry *entry;
648 636
649 if (! snd_card_proc_new(chip->card, "vx-status", &entry)) 637 if (! snd_card_proc_new(chip->card, "vx-status", &entry))
650 snd_info_set_text_ops(entry, chip, 1024, vx_proc_read); 638 snd_info_set_text_ops(entry, chip, 1024, vx_proc_read);
@@ -654,7 +642,7 @@ static void vx_proc_init(vx_core_t *chip)
654/** 642/**
655 * snd_vx_dsp_boot - load the DSP boot 643 * snd_vx_dsp_boot - load the DSP boot
656 */ 644 */
657int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot) 645int snd_vx_dsp_boot(struct vx_core *chip, const struct firmware *boot)
658{ 646{
659 int err; 647 int err;
660 int cold_reset = !(chip->chip_status & VX_STAT_DEVICE_INIT); 648 int cold_reset = !(chip->chip_status & VX_STAT_DEVICE_INIT);
@@ -664,7 +652,7 @@ int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot)
664 652
665 if ((err = snd_vx_load_boot_image(chip, boot)) < 0) 653 if ((err = snd_vx_load_boot_image(chip, boot)) < 0)
666 return err; 654 return err;
667 snd_vx_delay(chip, 10); 655 msleep(10);
668 656
669 return 0; 657 return 0;
670} 658}
@@ -672,7 +660,7 @@ int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *boot)
672/** 660/**
673 * snd_vx_dsp_load - load the DSP image 661 * snd_vx_dsp_load - load the DSP image
674 */ 662 */
675int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp) 663int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp)
676{ 664{
677 unsigned int i; 665 unsigned int i;
678 int err; 666 int err;
@@ -704,7 +692,7 @@ int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp)
704 } 692 }
705 snd_printdd(KERN_DEBUG "checksum = 0x%08x\n", csum); 693 snd_printdd(KERN_DEBUG "checksum = 0x%08x\n", csum);
706 694
707 snd_vx_delay(chip, 200); 695 msleep(200);
708 696
709 if ((err = vx_wait_isr_bit(chip, ISR_CHK)) < 0) 697 if ((err = vx_wait_isr_bit(chip, ISR_CHK)) < 0)
710 return err; 698 return err;
@@ -721,13 +709,11 @@ int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp)
721/* 709/*
722 * suspend 710 * suspend
723 */ 711 */
724static int snd_vx_suspend(snd_card_t *card, pm_message_t state) 712int snd_vx_suspend(struct vx_core *chip, pm_message_t state)
725{ 713{
726 vx_core_t *chip = card->pm_private_data;
727 unsigned int i; 714 unsigned int i;
728 715
729 snd_assert(chip, return -EINVAL); 716 snd_power_change_state(chip->card, SNDRV_CTL_POWER_D3hot);
730
731 chip->chip_status |= VX_STAT_IN_SUSPEND; 717 chip->chip_status |= VX_STAT_IN_SUSPEND;
732 for (i = 0; i < chip->hw->num_codecs; i++) 718 for (i = 0; i < chip->hw->num_codecs; i++)
733 snd_pcm_suspend_all(chip->pcm[i]); 719 snd_pcm_suspend_all(chip->pcm[i]);
@@ -738,13 +724,10 @@ static int snd_vx_suspend(snd_card_t *card, pm_message_t state)
738/* 724/*
739 * resume 725 * resume
740 */ 726 */
741static int snd_vx_resume(snd_card_t *card) 727int snd_vx_resume(struct vx_core *chip)
742{ 728{
743 vx_core_t *chip = card->pm_private_data;
744 int i, err; 729 int i, err;
745 730
746 snd_assert(chip, return -EINVAL);
747
748 chip->chip_status &= ~VX_STAT_CHIP_INIT; 731 chip->chip_status &= ~VX_STAT_CHIP_INIT;
749 732
750 for (i = 0; i < 4; i++) { 733 for (i = 0; i < 4; i++) {
@@ -760,13 +743,14 @@ static int snd_vx_resume(snd_card_t *card)
760 chip->chip_status |= VX_STAT_CHIP_INIT; 743 chip->chip_status |= VX_STAT_CHIP_INIT;
761 chip->chip_status &= ~VX_STAT_IN_SUSPEND; 744 chip->chip_status &= ~VX_STAT_IN_SUSPEND;
762 745
746 snd_power_change_state(chip->card, SNDRV_CTL_POWER_D0);
763 return 0; 747 return 0;
764} 748}
765 749
766#endif 750#endif
767 751
768/** 752/**
769 * snd_vx_create - constructor for vx_core_t 753 * snd_vx_create - constructor for struct vx_core
770 * @hw: hardware specific record 754 * @hw: hardware specific record
771 * 755 *
772 * this function allocates the instance and prepare for the hardware 756 * this function allocates the instance and prepare for the hardware
@@ -774,11 +758,11 @@ static int snd_vx_resume(snd_card_t *card)
774 * 758 *
775 * return the instance pointer if successful, NULL in error. 759 * return the instance pointer if successful, NULL in error.
776 */ 760 */
777vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw, 761struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw,
778 struct snd_vx_ops *ops, 762 struct snd_vx_ops *ops,
779 int extra_size) 763 int extra_size)
780{ 764{
781 vx_core_t *chip; 765 struct vx_core *chip;
782 766
783 snd_assert(card && hw && ops, return NULL); 767 snd_assert(card && hw && ops, return NULL);
784 768
@@ -801,8 +785,6 @@ vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw,
801 strcpy(card->driver, hw->name); 785 strcpy(card->driver, hw->name);
802 sprintf(card->shortname, "Digigram %s", hw->name); 786 sprintf(card->shortname, "Digigram %s", hw->name);
803 787
804 snd_card_set_pm_callback(card, snd_vx_suspend, snd_vx_resume, chip);
805
806 vx_proc_init(chip); 788 vx_proc_init(chip);
807 789
808 return chip; 790 return chip;
@@ -831,7 +813,10 @@ EXPORT_SYMBOL(snd_vx_create);
831EXPORT_SYMBOL(snd_vx_setup_firmware); 813EXPORT_SYMBOL(snd_vx_setup_firmware);
832EXPORT_SYMBOL(snd_vx_free_firmware); 814EXPORT_SYMBOL(snd_vx_free_firmware);
833EXPORT_SYMBOL(snd_vx_irq_handler); 815EXPORT_SYMBOL(snd_vx_irq_handler);
834EXPORT_SYMBOL(snd_vx_delay);
835EXPORT_SYMBOL(snd_vx_dsp_boot); 816EXPORT_SYMBOL(snd_vx_dsp_boot);
836EXPORT_SYMBOL(snd_vx_dsp_load); 817EXPORT_SYMBOL(snd_vx_dsp_load);
837EXPORT_SYMBOL(snd_vx_load_boot_image); 818EXPORT_SYMBOL(snd_vx_load_boot_image);
819#ifdef CONFIG_PM
820EXPORT_SYMBOL(snd_vx_suspend);
821EXPORT_SYMBOL(snd_vx_resume);
822#endif
diff --git a/sound/drivers/vx/vx_hwdep.c b/sound/drivers/vx/vx_hwdep.c
index c4993b004c42..d837783fb538 100644
--- a/sound/drivers/vx/vx_hwdep.c
+++ b/sound/drivers/vx/vx_hwdep.c
@@ -30,7 +30,7 @@
30 30
31#ifdef SND_VX_FW_LOADER 31#ifdef SND_VX_FW_LOADER
32 32
33int snd_vx_setup_firmware(vx_core_t *chip) 33int snd_vx_setup_firmware(struct vx_core *chip)
34{ 34{
35 static char *fw_files[VX_TYPE_NUMS][4] = { 35 static char *fw_files[VX_TYPE_NUMS][4] = {
36 [VX_TYPE_BOARD] = { 36 [VX_TYPE_BOARD] = {
@@ -95,7 +95,7 @@ int snd_vx_setup_firmware(vx_core_t *chip)
95} 95}
96 96
97/* exported */ 97/* exported */
98void snd_vx_free_firmware(vx_core_t *chip) 98void snd_vx_free_firmware(struct vx_core *chip)
99{ 99{
100#ifdef CONFIG_PM 100#ifdef CONFIG_PM
101 int i; 101 int i;
@@ -106,17 +106,18 @@ void snd_vx_free_firmware(vx_core_t *chip)
106 106
107#else /* old style firmware loading */ 107#else /* old style firmware loading */
108 108
109static int vx_hwdep_open(snd_hwdep_t *hw, struct file *file) 109static int vx_hwdep_open(struct snd_hwdep *hw, struct file *file)
110{ 110{
111 return 0; 111 return 0;
112} 112}
113 113
114static int vx_hwdep_release(snd_hwdep_t *hw, struct file *file) 114static int vx_hwdep_release(struct snd_hwdep *hw, struct file *file)
115{ 115{
116 return 0; 116 return 0;
117} 117}
118 118
119static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info) 119static int vx_hwdep_dsp_status(struct snd_hwdep *hw,
120 struct snd_hwdep_dsp_status *info)
120{ 121{
121 static char *type_ids[VX_TYPE_NUMS] = { 122 static char *type_ids[VX_TYPE_NUMS] = {
122 [VX_TYPE_BOARD] = "vxboard", 123 [VX_TYPE_BOARD] = "vxboard",
@@ -125,7 +126,7 @@ static int vx_hwdep_dsp_status(snd_hwdep_t *hw, snd_hwdep_dsp_status_t *info)
125 [VX_TYPE_VXPOCKET] = "vxpocket", 126 [VX_TYPE_VXPOCKET] = "vxpocket",
126 [VX_TYPE_VXP440] = "vxp440", 127 [VX_TYPE_VXP440] = "vxp440",
127 }; 128 };
128 vx_core_t *vx = hw->private_data; 129 struct vx_core *vx = hw->private_data;
129 130
130 snd_assert(type_ids[vx->type], return -EINVAL); 131 snd_assert(type_ids[vx->type], return -EINVAL);
131 strcpy(info->id, type_ids[vx->type]); 132 strcpy(info->id, type_ids[vx->type]);
@@ -147,9 +148,10 @@ static void free_fw(const struct firmware *fw)
147 } 148 }
148} 149}
149 150
150static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp) 151static int vx_hwdep_dsp_load(struct snd_hwdep *hw,
152 struct snd_hwdep_dsp_image *dsp)
151{ 153{
152 vx_core_t *vx = hw->private_data; 154 struct vx_core *vx = hw->private_data;
153 int index, err; 155 int index, err;
154 struct firmware *fw; 156 struct firmware *fw;
155 157
@@ -216,10 +218,10 @@ static int vx_hwdep_dsp_load(snd_hwdep_t *hw, snd_hwdep_dsp_image_t *dsp)
216 218
217 219
218/* exported */ 220/* exported */
219int snd_vx_setup_firmware(vx_core_t *chip) 221int snd_vx_setup_firmware(struct vx_core *chip)
220{ 222{
221 int err; 223 int err;
222 snd_hwdep_t *hw; 224 struct snd_hwdep *hw;
223 225
224 if ((err = snd_hwdep_new(chip->card, SND_VX_HWDEP_ID, 0, &hw)) < 0) 226 if ((err = snd_hwdep_new(chip->card, SND_VX_HWDEP_ID, 0, &hw)) < 0)
225 return err; 227 return err;
@@ -238,7 +240,7 @@ int snd_vx_setup_firmware(vx_core_t *chip)
238} 240}
239 241
240/* exported */ 242/* exported */
241void snd_vx_free_firmware(vx_core_t *chip) 243void snd_vx_free_firmware(struct vx_core *chip)
242{ 244{
243#ifdef CONFIG_PM 245#ifdef CONFIG_PM
244 int i; 246 int i;
diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c
index 19fc68c23378..8ec2c605d2f0 100644
--- a/sound/drivers/vx/vx_mixer.c
+++ b/sound/drivers/vx/vx_mixer.c
@@ -30,7 +30,7 @@
30/* 30/*
31 * write a codec data (24bit) 31 * write a codec data (24bit)
32 */ 32 */
33static void vx_write_codec_reg(vx_core_t *chip, int codec, unsigned int data) 33static void vx_write_codec_reg(struct vx_core *chip, int codec, unsigned int data)
34{ 34{
35 unsigned long flags; 35 unsigned long flags;
36 36
@@ -47,7 +47,7 @@ static void vx_write_codec_reg(vx_core_t *chip, int codec, unsigned int data)
47/* 47/*
48 * Data type used to access the Codec 48 * Data type used to access the Codec
49 */ 49 */
50typedef union { 50union vx_codec_data {
51 u32 l; 51 u32 l;
52#ifdef SNDRV_BIG_ENDIAN 52#ifdef SNDRV_BIG_ENDIAN
53 struct w { 53 struct w {
@@ -72,7 +72,7 @@ typedef union {
72 u8 hh; 72 u8 hh;
73 } b; 73 } b;
74#endif 74#endif
75} vx_codec_data_t; 75};
76 76
77#define SET_CDC_DATA_SEL(di,s) ((di).b.mh = (u8) (s)) 77#define SET_CDC_DATA_SEL(di,s) ((di).b.mh = (u8) (s))
78#define SET_CDC_DATA_REG(di,r) ((di).b.ml = (u8) (r)) 78#define SET_CDC_DATA_REG(di,r) ((di).b.ml = (u8) (r))
@@ -85,9 +85,9 @@ typedef union {
85 * @reg: register index 85 * @reg: register index
86 * @val: data value 86 * @val: data value
87 */ 87 */
88static void vx_set_codec_reg(vx_core_t *chip, int codec, int reg, int val) 88static void vx_set_codec_reg(struct vx_core *chip, int codec, int reg, int val)
89{ 89{
90 vx_codec_data_t data; 90 union vx_codec_data data;
91 /* DAC control register */ 91 /* DAC control register */
92 SET_CDC_DATA_INIT(data); 92 SET_CDC_DATA_INIT(data);
93 SET_CDC_DATA_REG(data, reg); 93 SET_CDC_DATA_REG(data, reg);
@@ -102,7 +102,7 @@ static void vx_set_codec_reg(vx_core_t *chip, int codec, int reg, int val)
102 * @left: left output level, 0 = mute 102 * @left: left output level, 0 = mute
103 * @right: right output level 103 * @right: right output level
104 */ 104 */
105static void vx_set_analog_output_level(vx_core_t *chip, int codec, int left, int right) 105static void vx_set_analog_output_level(struct vx_core *chip, int codec, int left, int right)
106{ 106{
107 left = chip->hw->output_level_max - left; 107 left = chip->hw->output_level_max - left;
108 right = chip->hw->output_level_max - right; 108 right = chip->hw->output_level_max - right;
@@ -126,7 +126,7 @@ static void vx_set_analog_output_level(vx_core_t *chip, int codec, int left, int
126#define DAC_ATTEN_MIN 0x08 126#define DAC_ATTEN_MIN 0x08
127#define DAC_ATTEN_MAX 0x38 127#define DAC_ATTEN_MAX 0x38
128 128
129void vx_toggle_dac_mute(vx_core_t *chip, int mute) 129void vx_toggle_dac_mute(struct vx_core *chip, int mute)
130{ 130{
131 unsigned int i; 131 unsigned int i;
132 for (i = 0; i < chip->hw->num_codecs; i++) { 132 for (i = 0; i < chip->hw->num_codecs; i++) {
@@ -141,7 +141,7 @@ void vx_toggle_dac_mute(vx_core_t *chip, int mute)
141/* 141/*
142 * vx_reset_codec - reset and initialize the codecs 142 * vx_reset_codec - reset and initialize the codecs
143 */ 143 */
144void vx_reset_codec(vx_core_t *chip, int cold_reset) 144void vx_reset_codec(struct vx_core *chip, int cold_reset)
145{ 145{
146 unsigned int i; 146 unsigned int i;
147 int port = chip->type >= VX_TYPE_VXPOCKET ? 0x75 : 0x65; 147 int port = chip->type >= VX_TYPE_VXPOCKET ? 0x75 : 0x65;
@@ -175,7 +175,7 @@ void vx_reset_codec(vx_core_t *chip, int cold_reset)
175 * change the audio input source 175 * change the audio input source
176 * @src: the target source (VX_AUDIO_SRC_XXX) 176 * @src: the target source (VX_AUDIO_SRC_XXX)
177 */ 177 */
178static void vx_change_audio_source(vx_core_t *chip, int src) 178static void vx_change_audio_source(struct vx_core *chip, int src)
179{ 179{
180 unsigned long flags; 180 unsigned long flags;
181 181
@@ -192,7 +192,7 @@ static void vx_change_audio_source(vx_core_t *chip, int src)
192 * change the audio source if necessary and possible 192 * change the audio source if necessary and possible
193 * returns 1 if the source is actually changed. 193 * returns 1 if the source is actually changed.
194 */ 194 */
195int vx_sync_audio_source(vx_core_t *chip) 195int vx_sync_audio_source(struct vx_core *chip)
196{ 196{
197 if (chip->audio_source_target == chip->audio_source || 197 if (chip->audio_source_target == chip->audio_source ||
198 chip->pcm_running) 198 chip->pcm_running)
@@ -217,7 +217,7 @@ struct vx_audio_level {
217 short monitor_level; 217 short monitor_level;
218}; 218};
219 219
220static int vx_adjust_audio_level(vx_core_t *chip, int audio, int capture, 220static int vx_adjust_audio_level(struct vx_core *chip, int audio, int capture,
221 struct vx_audio_level *info) 221 struct vx_audio_level *info)
222{ 222{
223 struct vx_rmh rmh; 223 struct vx_rmh rmh;
@@ -256,7 +256,7 @@ static int vx_adjust_audio_level(vx_core_t *chip, int audio, int capture,
256 256
257 257
258#if 0 // not used 258#if 0 // not used
259static int vx_read_audio_level(vx_core_t *chip, int audio, int capture, 259static int vx_read_audio_level(struct vx_core *chip, int audio, int capture,
260 struct vx_audio_level *info) 260 struct vx_audio_level *info)
261{ 261{
262 int err; 262 int err;
@@ -283,7 +283,7 @@ static int vx_read_audio_level(vx_core_t *chip, int audio, int capture,
283 * set the monitoring level and mute state of the given audio 283 * set the monitoring level and mute state of the given audio
284 * no more static, because must be called from vx_pcm to demute monitoring 284 * no more static, because must be called from vx_pcm to demute monitoring
285 */ 285 */
286int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active) 286int vx_set_monitor_level(struct vx_core *chip, int audio, int level, int active)
287{ 287{
288 struct vx_audio_level info; 288 struct vx_audio_level info;
289 289
@@ -301,7 +301,7 @@ int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active)
301/* 301/*
302 * set the mute status of the given audio 302 * set the mute status of the given audio
303 */ 303 */
304static int vx_set_audio_switch(vx_core_t *chip, int audio, int active) 304static int vx_set_audio_switch(struct vx_core *chip, int audio, int active)
305{ 305{
306 struct vx_audio_level info; 306 struct vx_audio_level info;
307 307
@@ -315,7 +315,7 @@ static int vx_set_audio_switch(vx_core_t *chip, int audio, int active)
315/* 315/*
316 * set the mute status of the given audio 316 * set the mute status of the given audio
317 */ 317 */
318static int vx_set_audio_gain(vx_core_t *chip, int audio, int capture, int level) 318static int vx_set_audio_gain(struct vx_core *chip, int audio, int capture, int level)
319{ 319{
320 struct vx_audio_level info; 320 struct vx_audio_level info;
321 321
@@ -329,7 +329,7 @@ static int vx_set_audio_gain(vx_core_t *chip, int audio, int capture, int level)
329/* 329/*
330 * reset all audio levels 330 * reset all audio levels
331 */ 331 */
332static void vx_reset_audio_levels(vx_core_t *chip) 332static void vx_reset_audio_levels(struct vx_core *chip)
333{ 333{
334 unsigned int i, c; 334 unsigned int i, c;
335 struct vx_audio_level info; 335 struct vx_audio_level info;
@@ -375,7 +375,7 @@ struct vx_vu_meter {
375 * @capture: 0 = playback, 1 = capture operation 375 * @capture: 0 = playback, 1 = capture operation
376 * @info: the array of vx_vu_meter records (size = 2). 376 * @info: the array of vx_vu_meter records (size = 2).
377 */ 377 */
378static int vx_get_audio_vu_meter(vx_core_t *chip, int audio, int capture, struct vx_vu_meter *info) 378static int vx_get_audio_vu_meter(struct vx_core *chip, int audio, int capture, struct vx_vu_meter *info)
379{ 379{
380 struct vx_rmh rmh; 380 struct vx_rmh rmh;
381 int i, err; 381 int i, err;
@@ -413,9 +413,9 @@ static int vx_get_audio_vu_meter(vx_core_t *chip, int audio, int capture, struct
413/* 413/*
414 * output level control 414 * output level control
415 */ 415 */
416static int vx_output_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 416static int vx_output_level_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
417{ 417{
418 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 418 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
419 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 419 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
420 uinfo->count = 2; 420 uinfo->count = 2;
421 uinfo->value.integer.min = 0; 421 uinfo->value.integer.min = 0;
@@ -423,9 +423,9 @@ static int vx_output_level_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *u
423 return 0; 423 return 0;
424} 424}
425 425
426static int vx_output_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 426static int vx_output_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
427{ 427{
428 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 428 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
429 int codec = kcontrol->id.index; 429 int codec = kcontrol->id.index;
430 down(&chip->mixer_mutex); 430 down(&chip->mixer_mutex);
431 ucontrol->value.integer.value[0] = chip->output_level[codec][0]; 431 ucontrol->value.integer.value[0] = chip->output_level[codec][0];
@@ -434,9 +434,9 @@ static int vx_output_level_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
434 return 0; 434 return 0;
435} 435}
436 436
437static int vx_output_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 437static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
438{ 438{
439 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 439 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
440 int codec = kcontrol->id.index; 440 int codec = kcontrol->id.index;
441 down(&chip->mixer_mutex); 441 down(&chip->mixer_mutex);
442 if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || 442 if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] ||
@@ -453,7 +453,7 @@ static int vx_output_level_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *u
453 return 0; 453 return 0;
454} 454}
455 455
456static snd_kcontrol_new_t vx_control_output_level = { 456static struct snd_kcontrol_new vx_control_output_level = {
457 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 457 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
458 .name = "Master Playback Volume", 458 .name = "Master Playback Volume",
459 .info = vx_output_level_info, 459 .info = vx_output_level_info,
@@ -464,7 +464,7 @@ static snd_kcontrol_new_t vx_control_output_level = {
464/* 464/*
465 * audio source select 465 * audio source select
466 */ 466 */
467static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 467static int vx_audio_src_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
468{ 468{
469 static char *texts_mic[3] = { 469 static char *texts_mic[3] = {
470 "Digital", "Line", "Mic" 470 "Digital", "Line", "Mic"
@@ -472,7 +472,7 @@ static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
472 static char *texts_vx2[2] = { 472 static char *texts_vx2[2] = {
473 "Digital", "Analog" 473 "Digital", "Analog"
474 }; 474 };
475 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 475 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
476 476
477 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 477 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
478 uinfo->count = 1; 478 uinfo->count = 1;
@@ -492,16 +492,16 @@ static int vx_audio_src_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinf
492 return 0; 492 return 0;
493} 493}
494 494
495static int vx_audio_src_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 495static int vx_audio_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
496{ 496{
497 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 497 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
498 ucontrol->value.enumerated.item[0] = chip->audio_source_target; 498 ucontrol->value.enumerated.item[0] = chip->audio_source_target;
499 return 0; 499 return 0;
500} 500}
501 501
502static int vx_audio_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 502static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
503{ 503{
504 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 504 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
505 down(&chip->mixer_mutex); 505 down(&chip->mixer_mutex);
506 if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { 506 if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) {
507 chip->audio_source_target = ucontrol->value.enumerated.item[0]; 507 chip->audio_source_target = ucontrol->value.enumerated.item[0];
@@ -513,7 +513,7 @@ static int vx_audio_src_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucon
513 return 0; 513 return 0;
514} 514}
515 515
516static snd_kcontrol_new_t vx_control_audio_src = { 516static struct snd_kcontrol_new vx_control_audio_src = {
517 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 517 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
518 .name = "Capture Source", 518 .name = "Capture Source",
519 .info = vx_audio_src_info, 519 .info = vx_audio_src_info,
@@ -524,7 +524,7 @@ static snd_kcontrol_new_t vx_control_audio_src = {
524/* 524/*
525 * clock mode selection 525 * clock mode selection
526 */ 526 */
527static int vx_clock_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 527static int vx_clock_mode_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
528{ 528{
529 static char *texts[3] = { 529 static char *texts[3] = {
530 "Auto", "Internal", "External" 530 "Auto", "Internal", "External"
@@ -540,16 +540,16 @@ static int vx_clock_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
540 return 0; 540 return 0;
541} 541}
542 542
543static int vx_clock_mode_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 543static int vx_clock_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
544{ 544{
545 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 545 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
546 ucontrol->value.enumerated.item[0] = chip->clock_mode; 546 ucontrol->value.enumerated.item[0] = chip->clock_mode;
547 return 0; 547 return 0;
548} 548}
549 549
550static int vx_clock_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 550static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
551{ 551{
552 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 552 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
553 down(&chip->mixer_mutex); 553 down(&chip->mixer_mutex);
554 if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { 554 if (chip->clock_mode != ucontrol->value.enumerated.item[0]) {
555 chip->clock_mode = ucontrol->value.enumerated.item[0]; 555 chip->clock_mode = ucontrol->value.enumerated.item[0];
@@ -561,7 +561,7 @@ static int vx_clock_mode_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
561 return 0; 561 return 0;
562} 562}
563 563
564static snd_kcontrol_new_t vx_control_clock_mode = { 564static struct snd_kcontrol_new vx_control_clock_mode = {
565 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 565 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
566 .name = "Clock Mode", 566 .name = "Clock Mode",
567 .info = vx_clock_mode_info, 567 .info = vx_clock_mode_info,
@@ -572,7 +572,7 @@ static snd_kcontrol_new_t vx_control_clock_mode = {
572/* 572/*
573 * Audio Gain 573 * Audio Gain
574 */ 574 */
575static int vx_audio_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 575static int vx_audio_gain_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
576{ 576{
577 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 577 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
578 uinfo->count = 2; 578 uinfo->count = 2;
@@ -581,9 +581,9 @@ static int vx_audio_gain_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
581 return 0; 581 return 0;
582} 582}
583 583
584static int vx_audio_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 584static int vx_audio_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
585{ 585{
586 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 586 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
587 int audio = kcontrol->private_value & 0xff; 587 int audio = kcontrol->private_value & 0xff;
588 int capture = (kcontrol->private_value >> 8) & 1; 588 int capture = (kcontrol->private_value >> 8) & 1;
589 589
@@ -594,9 +594,9 @@ static int vx_audio_gain_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
594 return 0; 594 return 0;
595} 595}
596 596
597static int vx_audio_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 597static int vx_audio_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
598{ 598{
599 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 599 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
600 int audio = kcontrol->private_value & 0xff; 600 int audio = kcontrol->private_value & 0xff;
601 int capture = (kcontrol->private_value >> 8) & 1; 601 int capture = (kcontrol->private_value >> 8) & 1;
602 602
@@ -612,9 +612,9 @@ static int vx_audio_gain_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
612 return 0; 612 return 0;
613} 613}
614 614
615static int vx_audio_monitor_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 615static int vx_audio_monitor_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
616{ 616{
617 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 617 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
618 int audio = kcontrol->private_value & 0xff; 618 int audio = kcontrol->private_value & 0xff;
619 619
620 down(&chip->mixer_mutex); 620 down(&chip->mixer_mutex);
@@ -624,9 +624,9 @@ static int vx_audio_monitor_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *
624 return 0; 624 return 0;
625} 625}
626 626
627static int vx_audio_monitor_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 627static int vx_audio_monitor_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
628{ 628{
629 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 629 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
630 int audio = kcontrol->private_value & 0xff; 630 int audio = kcontrol->private_value & 0xff;
631 631
632 down(&chip->mixer_mutex); 632 down(&chip->mixer_mutex);
@@ -643,7 +643,7 @@ static int vx_audio_monitor_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *
643 return 0; 643 return 0;
644} 644}
645 645
646static int vx_audio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 646static int vx_audio_sw_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
647{ 647{
648 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 648 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
649 uinfo->count = 2; 649 uinfo->count = 2;
@@ -652,9 +652,9 @@ static int vx_audio_sw_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
652 return 0; 652 return 0;
653} 653}
654 654
655static int vx_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 655static int vx_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
656{ 656{
657 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 657 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
658 int audio = kcontrol->private_value & 0xff; 658 int audio = kcontrol->private_value & 0xff;
659 659
660 down(&chip->mixer_mutex); 660 down(&chip->mixer_mutex);
@@ -664,9 +664,9 @@ static int vx_audio_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
664 return 0; 664 return 0;
665} 665}
666 666
667static int vx_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 667static int vx_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
668{ 668{
669 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 669 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
670 int audio = kcontrol->private_value & 0xff; 670 int audio = kcontrol->private_value & 0xff;
671 671
672 down(&chip->mixer_mutex); 672 down(&chip->mixer_mutex);
@@ -681,9 +681,9 @@ static int vx_audio_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
681 return 0; 681 return 0;
682} 682}
683 683
684static int vx_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 684static int vx_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
685{ 685{
686 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 686 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
687 int audio = kcontrol->private_value & 0xff; 687 int audio = kcontrol->private_value & 0xff;
688 688
689 down(&chip->mixer_mutex); 689 down(&chip->mixer_mutex);
@@ -693,9 +693,9 @@ static int vx_monitor_sw_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
693 return 0; 693 return 0;
694} 694}
695 695
696static int vx_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 696static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
697{ 697{
698 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 698 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
699 int audio = kcontrol->private_value & 0xff; 699 int audio = kcontrol->private_value & 0xff;
700 700
701 down(&chip->mixer_mutex); 701 down(&chip->mixer_mutex);
@@ -712,28 +712,28 @@ static int vx_monitor_sw_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
712 return 0; 712 return 0;
713} 713}
714 714
715static snd_kcontrol_new_t vx_control_audio_gain = { 715static struct snd_kcontrol_new vx_control_audio_gain = {
716 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 716 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
717 /* name will be filled later */ 717 /* name will be filled later */
718 .info = vx_audio_gain_info, 718 .info = vx_audio_gain_info,
719 .get = vx_audio_gain_get, 719 .get = vx_audio_gain_get,
720 .put = vx_audio_gain_put 720 .put = vx_audio_gain_put
721}; 721};
722static snd_kcontrol_new_t vx_control_output_switch = { 722static struct snd_kcontrol_new vx_control_output_switch = {
723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 723 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
724 .name = "PCM Playback Switch", 724 .name = "PCM Playback Switch",
725 .info = vx_audio_sw_info, 725 .info = vx_audio_sw_info,
726 .get = vx_audio_sw_get, 726 .get = vx_audio_sw_get,
727 .put = vx_audio_sw_put 727 .put = vx_audio_sw_put
728}; 728};
729static snd_kcontrol_new_t vx_control_monitor_gain = { 729static struct snd_kcontrol_new vx_control_monitor_gain = {
730 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 730 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
731 .name = "Monitoring Volume", 731 .name = "Monitoring Volume",
732 .info = vx_audio_gain_info, /* shared */ 732 .info = vx_audio_gain_info, /* shared */
733 .get = vx_audio_monitor_get, 733 .get = vx_audio_monitor_get,
734 .put = vx_audio_monitor_put 734 .put = vx_audio_monitor_put
735}; 735};
736static snd_kcontrol_new_t vx_control_monitor_switch = { 736static struct snd_kcontrol_new vx_control_monitor_switch = {
737 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 737 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
738 .name = "Monitoring Switch", 738 .name = "Monitoring Switch",
739 .info = vx_audio_sw_info, /* shared */ 739 .info = vx_audio_sw_info, /* shared */
@@ -745,16 +745,16 @@ static snd_kcontrol_new_t vx_control_monitor_switch = {
745/* 745/*
746 * IEC958 status bits 746 * IEC958 status bits
747 */ 747 */
748static int vx_iec958_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 748static int vx_iec958_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
749{ 749{
750 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 750 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
751 uinfo->count = 1; 751 uinfo->count = 1;
752 return 0; 752 return 0;
753} 753}
754 754
755static int vx_iec958_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 755static int vx_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
756{ 756{
757 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 757 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
758 758
759 down(&chip->mixer_mutex); 759 down(&chip->mixer_mutex);
760 ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; 760 ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff;
@@ -765,7 +765,7 @@ static int vx_iec958_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontro
765 return 0; 765 return 0;
766} 766}
767 767
768static int vx_iec958_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *ucontrol) 768static int vx_iec958_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
769{ 769{
770 ucontrol->value.iec958.status[0] = 0xff; 770 ucontrol->value.iec958.status[0] = 0xff;
771 ucontrol->value.iec958.status[1] = 0xff; 771 ucontrol->value.iec958.status[1] = 0xff;
@@ -774,9 +774,9 @@ static int vx_iec958_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t *u
774 return 0; 774 return 0;
775} 775}
776 776
777static int vx_iec958_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 777static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
778{ 778{
779 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 779 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
780 unsigned int val; 780 unsigned int val;
781 781
782 val = (ucontrol->value.iec958.status[0] << 0) | 782 val = (ucontrol->value.iec958.status[0] << 0) |
@@ -794,7 +794,7 @@ static int vx_iec958_put(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontro
794 return 0; 794 return 0;
795} 795}
796 796
797static snd_kcontrol_new_t vx_control_iec958_mask = { 797static struct snd_kcontrol_new vx_control_iec958_mask = {
798 .access = SNDRV_CTL_ELEM_ACCESS_READ, 798 .access = SNDRV_CTL_ELEM_ACCESS_READ,
799 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 799 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
800 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK), 800 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,MASK),
@@ -802,7 +802,7 @@ static snd_kcontrol_new_t vx_control_iec958_mask = {
802 .get = vx_iec958_mask_get, 802 .get = vx_iec958_mask_get,
803}; 803};
804 804
805static snd_kcontrol_new_t vx_control_iec958 = { 805static struct snd_kcontrol_new vx_control_iec958 = {
806 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 806 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
807 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 807 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
808 .info = vx_iec958_info, 808 .info = vx_iec958_info,
@@ -818,7 +818,7 @@ static snd_kcontrol_new_t vx_control_iec958 = {
818#define METER_MAX 0xff 818#define METER_MAX 0xff
819#define METER_SHIFT 16 819#define METER_SHIFT 16
820 820
821static int vx_vu_meter_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 821static int vx_vu_meter_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
822{ 822{
823 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 823 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
824 uinfo->count = 2; 824 uinfo->count = 2;
@@ -827,9 +827,9 @@ static int vx_vu_meter_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo
827 return 0; 827 return 0;
828} 828}
829 829
830static int vx_vu_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 830static int vx_vu_meter_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
831{ 831{
832 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 832 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
833 struct vx_vu_meter meter[2]; 833 struct vx_vu_meter meter[2];
834 int audio = kcontrol->private_value & 0xff; 834 int audio = kcontrol->private_value & 0xff;
835 int capture = (kcontrol->private_value >> 8) & 1; 835 int capture = (kcontrol->private_value >> 8) & 1;
@@ -840,9 +840,9 @@ static int vx_vu_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucont
840 return 0; 840 return 0;
841} 841}
842 842
843static int vx_peak_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 843static int vx_peak_meter_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
844{ 844{
845 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 845 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
846 struct vx_vu_meter meter[2]; 846 struct vx_vu_meter meter[2];
847 int audio = kcontrol->private_value & 0xff; 847 int audio = kcontrol->private_value & 0xff;
848 int capture = (kcontrol->private_value >> 8) & 1; 848 int capture = (kcontrol->private_value >> 8) & 1;
@@ -853,7 +853,7 @@ static int vx_peak_meter_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
853 return 0; 853 return 0;
854} 854}
855 855
856static int vx_saturation_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) 856static int vx_saturation_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
857{ 857{
858 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 858 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
859 uinfo->count = 2; 859 uinfo->count = 2;
@@ -862,9 +862,9 @@ static int vx_saturation_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uin
862 return 0; 862 return 0;
863} 863}
864 864
865static int vx_saturation_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *ucontrol) 865static int vx_saturation_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
866{ 866{
867 vx_core_t *chip = snd_kcontrol_chip(kcontrol); 867 struct vx_core *chip = snd_kcontrol_chip(kcontrol);
868 struct vx_vu_meter meter[2]; 868 struct vx_vu_meter meter[2];
869 int audio = kcontrol->private_value & 0xff; 869 int audio = kcontrol->private_value & 0xff;
870 870
@@ -874,7 +874,7 @@ static int vx_saturation_get(snd_kcontrol_t *kcontrol, snd_ctl_elem_value_t *uco
874 return 0; 874 return 0;
875} 875}
876 876
877static snd_kcontrol_new_t vx_control_vu_meter = { 877static struct snd_kcontrol_new vx_control_vu_meter = {
878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
879 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 879 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
880 /* name will be filled later */ 880 /* name will be filled later */
@@ -882,7 +882,7 @@ static snd_kcontrol_new_t vx_control_vu_meter = {
882 .get = vx_vu_meter_get, 882 .get = vx_vu_meter_get,
883}; 883};
884 884
885static snd_kcontrol_new_t vx_control_peak_meter = { 885static struct snd_kcontrol_new vx_control_peak_meter = {
886 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 886 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
887 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 887 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
888 /* name will be filled later */ 888 /* name will be filled later */
@@ -890,7 +890,7 @@ static snd_kcontrol_new_t vx_control_peak_meter = {
890 .get = vx_peak_meter_get, 890 .get = vx_peak_meter_get,
891}; 891};
892 892
893static snd_kcontrol_new_t vx_control_saturation = { 893static struct snd_kcontrol_new vx_control_saturation = {
894 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 894 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
895 .name = "Input Saturation", 895 .name = "Input Saturation",
896 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE, 896 .access = SNDRV_CTL_ELEM_ACCESS_READ | SNDRV_CTL_ELEM_ACCESS_VOLATILE,
@@ -904,12 +904,12 @@ static snd_kcontrol_new_t vx_control_saturation = {
904 * 904 *
905 */ 905 */
906 906
907int snd_vx_mixer_new(vx_core_t *chip) 907int snd_vx_mixer_new(struct vx_core *chip)
908{ 908{
909 unsigned int i, c; 909 unsigned int i, c;
910 int err; 910 int err;
911 snd_kcontrol_new_t temp; 911 struct snd_kcontrol_new temp;
912 snd_card_t *card = chip->card; 912 struct snd_card *card = chip->card;
913 char name[32]; 913 char name[32];
914 914
915 strcpy(card->mixername, card->driver); 915 strcpy(card->mixername, card->driver);
diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c
index 2b46758fe86f..464109e421d4 100644
--- a/sound/drivers/vx/vx_pcm.c
+++ b/sound/drivers/vx/vx_pcm.c
@@ -61,7 +61,8 @@
61 */ 61 */
62 62
63/* get the physical page pointer on the given offset */ 63/* get the physical page pointer on the given offset */
64static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned long offset) 64static struct page *snd_pcm_get_vmalloc_page(struct snd_pcm_substream *subs,
65 unsigned long offset)
65{ 66{
66 void *pageptr = subs->runtime->dma_area + offset; 67 void *pageptr = subs->runtime->dma_area + offset;
67 return vmalloc_to_page(pageptr); 68 return vmalloc_to_page(pageptr);
@@ -72,9 +73,9 @@ static struct page *snd_pcm_get_vmalloc_page(snd_pcm_substream_t *subs, unsigned
72 * called from hw_params 73 * called from hw_params
73 * NOTE: this may be called not only once per pcm open! 74 * NOTE: this may be called not only once per pcm open!
74 */ 75 */
75static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size) 76static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, size_t size)
76{ 77{
77 snd_pcm_runtime_t *runtime = subs->runtime; 78 struct snd_pcm_runtime *runtime = subs->runtime;
78 if (runtime->dma_area) { 79 if (runtime->dma_area) {
79 /* already allocated */ 80 /* already allocated */
80 if (runtime->dma_bytes >= size) 81 if (runtime->dma_bytes >= size)
@@ -94,9 +95,9 @@ static int snd_pcm_alloc_vmalloc_buffer(snd_pcm_substream_t *subs, size_t size)
94 * called from hw_free callback 95 * called from hw_free callback
95 * NOTE: this may be called not only once per pcm open! 96 * NOTE: this may be called not only once per pcm open!
96 */ 97 */
97static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs) 98static int snd_pcm_free_vmalloc_buffer(struct snd_pcm_substream *subs)
98{ 99{
99 snd_pcm_runtime_t *runtime = subs->runtime; 100 struct snd_pcm_runtime *runtime = subs->runtime;
100 if (runtime->dma_area) { 101 if (runtime->dma_area) {
101 vfree(runtime->dma_area); 102 vfree(runtime->dma_area);
102 runtime->dma_area = NULL; 103 runtime->dma_area = NULL;
@@ -108,7 +109,8 @@ static int snd_pcm_free_vmalloc_buffer(snd_pcm_substream_t *subs)
108/* 109/*
109 * read three pending pcm bytes via inb() 110 * read three pending pcm bytes via inb()
110 */ 111 */
111static void vx_pcm_read_per_bytes(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe) 112static void vx_pcm_read_per_bytes(struct vx_core *chip, struct snd_pcm_runtime *runtime,
113 struct vx_pipe *pipe)
112{ 114{
113 int offset = pipe->hw_ptr; 115 int offset = pipe->hw_ptr;
114 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset); 116 unsigned char *buf = (unsigned char *)(runtime->dma_area + offset);
@@ -135,7 +137,8 @@ static void vx_pcm_read_per_bytes(vx_core_t *chip, snd_pcm_runtime_t *runtime, v
135 * @pc_time: the pointer for the PC-time to set 137 * @pc_time: the pointer for the PC-time to set
136 * @dsp_time: the pointer for RMH status time array 138 * @dsp_time: the pointer for RMH status time array
137 */ 139 */
138static void vx_set_pcx_time(vx_core_t *chip, pcx_time_t *pc_time, unsigned int *dsp_time) 140static void vx_set_pcx_time(struct vx_core *chip, pcx_time_t *pc_time,
141 unsigned int *dsp_time)
139{ 142{
140 dsp_time[0] = (unsigned int)((*pc_time) >> 24) & PCX_TIME_HI_MASK; 143 dsp_time[0] = (unsigned int)((*pc_time) >> 24) & PCX_TIME_HI_MASK;
141 dsp_time[1] = (unsigned int)(*pc_time) & MASK_DSP_WORD; 144 dsp_time[1] = (unsigned int)(*pc_time) & MASK_DSP_WORD;
@@ -151,7 +154,8 @@ static void vx_set_pcx_time(vx_core_t *chip, pcx_time_t *pc_time, unsigned int *
151 * 154 *
152 * returns the increase of the command length. 155 * returns the increase of the command length.
153 */ 156 */
154static int vx_set_differed_time(vx_core_t *chip, struct vx_rmh *rmh, vx_pipe_t *pipe) 157static int vx_set_differed_time(struct vx_core *chip, struct vx_rmh *rmh,
158 struct vx_pipe *pipe)
155{ 159{
156 /* Update The length added to the RMH command by the timestamp */ 160 /* Update The length added to the RMH command by the timestamp */
157 if (! (pipe->differed_type & DC_DIFFERED_DELAY)) 161 if (! (pipe->differed_type & DC_DIFFERED_DELAY))
@@ -184,7 +188,8 @@ static int vx_set_differed_time(vx_core_t *chip, struct vx_rmh *rmh, vx_pipe_t *
184 * @pipe: the affected pipe 188 * @pipe: the affected pipe
185 * @data: format bitmask 189 * @data: format bitmask
186 */ 190 */
187static int vx_set_stream_format(vx_core_t *chip, vx_pipe_t *pipe, unsigned int data) 191static int vx_set_stream_format(struct vx_core *chip, struct vx_pipe *pipe,
192 unsigned int data)
188{ 193{
189 struct vx_rmh rmh; 194 struct vx_rmh rmh;
190 195
@@ -210,8 +215,8 @@ static int vx_set_stream_format(vx_core_t *chip, vx_pipe_t *pipe, unsigned int d
210 * 215 *
211 * returns 0 if successful, or a negative error code. 216 * returns 0 if successful, or a negative error code.
212 */ 217 */
213static int vx_set_format(vx_core_t *chip, vx_pipe_t *pipe, 218static int vx_set_format(struct vx_core *chip, struct vx_pipe *pipe,
214 snd_pcm_runtime_t *runtime) 219 struct snd_pcm_runtime *runtime)
215{ 220{
216 unsigned int header = HEADER_FMT_BASE; 221 unsigned int header = HEADER_FMT_BASE;
217 222
@@ -239,7 +244,7 @@ static int vx_set_format(vx_core_t *chip, vx_pipe_t *pipe,
239/* 244/*
240 * set / query the IBL size 245 * set / query the IBL size
241 */ 246 */
242static int vx_set_ibl(vx_core_t *chip, struct vx_ibl_info *info) 247static int vx_set_ibl(struct vx_core *chip, struct vx_ibl_info *info)
243{ 248{
244 int err; 249 int err;
245 struct vx_rmh rmh; 250 struct vx_rmh rmh;
@@ -269,7 +274,7 @@ static int vx_set_ibl(vx_core_t *chip, struct vx_ibl_info *info)
269 * 274 *
270 * called from trigger callback only 275 * called from trigger callback only
271 */ 276 */
272static int vx_get_pipe_state(vx_core_t *chip, vx_pipe_t *pipe, int *state) 277static int vx_get_pipe_state(struct vx_core *chip, struct vx_pipe *pipe, int *state)
273{ 278{
274 int err; 279 int err;
275 struct vx_rmh rmh; 280 struct vx_rmh rmh;
@@ -294,7 +299,7 @@ static int vx_get_pipe_state(vx_core_t *chip, vx_pipe_t *pipe, int *state)
294 * you'll need to disconnect the host to get back to the 299 * you'll need to disconnect the host to get back to the
295 * normal mode. 300 * normal mode.
296 */ 301 */
297static int vx_query_hbuffer_size(vx_core_t *chip, vx_pipe_t *pipe) 302static int vx_query_hbuffer_size(struct vx_core *chip, struct vx_pipe *pipe)
298{ 303{
299 int result; 304 int result;
300 struct vx_rmh rmh; 305 struct vx_rmh rmh;
@@ -318,7 +323,7 @@ static int vx_query_hbuffer_size(vx_core_t *chip, vx_pipe_t *pipe)
318 * 323 *
319 * called from trigger callback only 324 * called from trigger callback only
320 */ 325 */
321static int vx_pipe_can_start(vx_core_t *chip, vx_pipe_t *pipe) 326static int vx_pipe_can_start(struct vx_core *chip, struct vx_pipe *pipe)
322{ 327{
323 int err; 328 int err;
324 struct vx_rmh rmh; 329 struct vx_rmh rmh;
@@ -339,7 +344,7 @@ static int vx_pipe_can_start(vx_core_t *chip, vx_pipe_t *pipe)
339 * vx_conf_pipe - tell the pipe to stand by and wait for IRQA. 344 * vx_conf_pipe - tell the pipe to stand by and wait for IRQA.
340 * @pipe: the pipe to be configured 345 * @pipe: the pipe to be configured
341 */ 346 */
342static int vx_conf_pipe(vx_core_t *chip, vx_pipe_t *pipe) 347static int vx_conf_pipe(struct vx_core *chip, struct vx_pipe *pipe)
343{ 348{
344 struct vx_rmh rmh; 349 struct vx_rmh rmh;
345 350
@@ -353,7 +358,7 @@ static int vx_conf_pipe(vx_core_t *chip, vx_pipe_t *pipe)
353/* 358/*
354 * vx_send_irqa - trigger IRQA 359 * vx_send_irqa - trigger IRQA
355 */ 360 */
356static int vx_send_irqa(vx_core_t *chip) 361static int vx_send_irqa(struct vx_core *chip)
357{ 362{
358 struct vx_rmh rmh; 363 struct vx_rmh rmh;
359 364
@@ -378,7 +383,7 @@ static int vx_send_irqa(vx_core_t *chip)
378 * called from trigger callback only 383 * called from trigger callback only
379 * 384 *
380 */ 385 */
381static int vx_toggle_pipe(vx_core_t *chip, vx_pipe_t *pipe, int state) 386static int vx_toggle_pipe(struct vx_core *chip, struct vx_pipe *pipe, int state)
382{ 387{
383 int err, i, cur_state; 388 int err, i, cur_state;
384 389
@@ -431,7 +436,7 @@ static int vx_toggle_pipe(vx_core_t *chip, vx_pipe_t *pipe, int state)
431 * 436 *
432 * called from trigger callback only 437 * called from trigger callback only
433 */ 438 */
434static int vx_stop_pipe(vx_core_t *chip, vx_pipe_t *pipe) 439static int vx_stop_pipe(struct vx_core *chip, struct vx_pipe *pipe)
435{ 440{
436 struct vx_rmh rmh; 441 struct vx_rmh rmh;
437 vx_init_rmh(&rmh, CMD_STOP_PIPE); 442 vx_init_rmh(&rmh, CMD_STOP_PIPE);
@@ -449,12 +454,12 @@ static int vx_stop_pipe(vx_core_t *chip, vx_pipe_t *pipe)
449 * 454 *
450 * return 0 on success, or a negative error code. 455 * return 0 on success, or a negative error code.
451 */ 456 */
452static int vx_alloc_pipe(vx_core_t *chip, int capture, 457static int vx_alloc_pipe(struct vx_core *chip, int capture,
453 int audioid, int num_audio, 458 int audioid, int num_audio,
454 vx_pipe_t **pipep) 459 struct vx_pipe **pipep)
455{ 460{
456 int err; 461 int err;
457 vx_pipe_t *pipe; 462 struct vx_pipe *pipe;
458 struct vx_rmh rmh; 463 struct vx_rmh rmh;
459 int data_mode; 464 int data_mode;
460 465
@@ -499,7 +504,7 @@ static int vx_alloc_pipe(vx_core_t *chip, int capture,
499 * vx_free_pipe - release a pipe 504 * vx_free_pipe - release a pipe
500 * @pipe: pipe to be released 505 * @pipe: pipe to be released
501 */ 506 */
502static int vx_free_pipe(vx_core_t *chip, vx_pipe_t *pipe) 507static int vx_free_pipe(struct vx_core *chip, struct vx_pipe *pipe)
503{ 508{
504 struct vx_rmh rmh; 509 struct vx_rmh rmh;
505 510
@@ -517,7 +522,7 @@ static int vx_free_pipe(vx_core_t *chip, vx_pipe_t *pipe)
517 * 522 *
518 * called from trigger callback only 523 * called from trigger callback only
519 */ 524 */
520static int vx_start_stream(vx_core_t *chip, vx_pipe_t *pipe) 525static int vx_start_stream(struct vx_core *chip, struct vx_pipe *pipe)
521{ 526{
522 struct vx_rmh rmh; 527 struct vx_rmh rmh;
523 528
@@ -533,7 +538,7 @@ static int vx_start_stream(vx_core_t *chip, vx_pipe_t *pipe)
533 * 538 *
534 * called from trigger callback only 539 * called from trigger callback only
535 */ 540 */
536static int vx_stop_stream(vx_core_t *chip, vx_pipe_t *pipe) 541static int vx_stop_stream(struct vx_core *chip, struct vx_pipe *pipe)
537{ 542{
538 struct vx_rmh rmh; 543 struct vx_rmh rmh;
539 544
@@ -547,11 +552,12 @@ static int vx_stop_stream(vx_core_t *chip, vx_pipe_t *pipe)
547 * playback hw information 552 * playback hw information
548 */ 553 */
549 554
550static snd_pcm_hardware_t vx_pcm_playback_hw = { 555static struct snd_pcm_hardware vx_pcm_playback_hw = {
551 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 556 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
552 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/ 557 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/
553 /*SNDRV_PCM_INFO_RESUME*/), 558 /*SNDRV_PCM_INFO_RESUME*/),
554 .formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, 559 .formats = (/*SNDRV_PCM_FMTBIT_U8 |*/
560 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE),
555 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 561 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
556 .rate_min = 5000, 562 .rate_min = 5000,
557 .rate_max = 48000, 563 .rate_max = 48000,
@@ -571,11 +577,11 @@ static void vx_pcm_delayed_start(unsigned long arg);
571/* 577/*
572 * vx_pcm_playback_open - open callback for playback 578 * vx_pcm_playback_open - open callback for playback
573 */ 579 */
574static int vx_pcm_playback_open(snd_pcm_substream_t *subs) 580static int vx_pcm_playback_open(struct snd_pcm_substream *subs)
575{ 581{
576 snd_pcm_runtime_t *runtime = subs->runtime; 582 struct snd_pcm_runtime *runtime = subs->runtime;
577 vx_core_t *chip = snd_pcm_substream_chip(subs); 583 struct vx_core *chip = snd_pcm_substream_chip(subs);
578 vx_pipe_t *pipe = NULL; 584 struct vx_pipe *pipe = NULL;
579 unsigned int audio; 585 unsigned int audio;
580 int err; 586 int err;
581 587
@@ -615,10 +621,10 @@ static int vx_pcm_playback_open(snd_pcm_substream_t *subs)
615/* 621/*
616 * vx_pcm_playback_close - close callback for playback 622 * vx_pcm_playback_close - close callback for playback
617 */ 623 */
618static int vx_pcm_playback_close(snd_pcm_substream_t *subs) 624static int vx_pcm_playback_close(struct snd_pcm_substream *subs)
619{ 625{
620 vx_core_t *chip = snd_pcm_substream_chip(subs); 626 struct vx_core *chip = snd_pcm_substream_chip(subs);
621 vx_pipe_t *pipe; 627 struct vx_pipe *pipe;
622 628
623 if (! subs->runtime->private_data) 629 if (! subs->runtime->private_data)
624 return -EINVAL; 630 return -EINVAL;
@@ -641,7 +647,7 @@ static int vx_pcm_playback_close(snd_pcm_substream_t *subs)
641 * 647 *
642 * NB: call with a certain lock. 648 * NB: call with a certain lock.
643 */ 649 */
644static int vx_notify_end_of_buffer(vx_core_t *chip, vx_pipe_t *pipe) 650static int vx_notify_end_of_buffer(struct vx_core *chip, struct vx_pipe *pipe)
645{ 651{
646 int err; 652 int err;
647 struct vx_rmh rmh; /* use a temporary rmh here */ 653 struct vx_rmh rmh; /* use a temporary rmh here */
@@ -669,7 +675,9 @@ static int vx_notify_end_of_buffer(vx_core_t *chip, vx_pipe_t *pipe)
669 * 675 *
670 * return 0 if ok. 676 * return 0 if ok.
671 */ 677 */
672static int vx_pcm_playback_transfer_chunk(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe, int size) 678static int vx_pcm_playback_transfer_chunk(struct vx_core *chip,
679 struct snd_pcm_runtime *runtime,
680 struct vx_pipe *pipe, int size)
673{ 681{
674 int space, err = 0; 682 int space, err = 0;
675 683
@@ -705,7 +713,9 @@ static int vx_pcm_playback_transfer_chunk(vx_core_t *chip, snd_pcm_runtime_t *ru
705 * so that the caller can check the total transferred size later 713 * so that the caller can check the total transferred size later
706 * (to call snd_pcm_period_elapsed). 714 * (to call snd_pcm_period_elapsed).
707 */ 715 */
708static int vx_update_pipe_position(vx_core_t *chip, snd_pcm_runtime_t *runtime, vx_pipe_t *pipe) 716static int vx_update_pipe_position(struct vx_core *chip,
717 struct snd_pcm_runtime *runtime,
718 struct vx_pipe *pipe)
709{ 719{
710 struct vx_rmh rmh; 720 struct vx_rmh rmh;
711 int err, update; 721 int err, update;
@@ -731,10 +741,12 @@ static int vx_update_pipe_position(vx_core_t *chip, snd_pcm_runtime_t *runtime,
731 * transfer the pending playback buffer data to DSP 741 * transfer the pending playback buffer data to DSP
732 * called from interrupt handler 742 * called from interrupt handler
733 */ 743 */
734static void vx_pcm_playback_transfer(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe, int nchunks) 744static void vx_pcm_playback_transfer(struct vx_core *chip,
745 struct snd_pcm_substream *subs,
746 struct vx_pipe *pipe, int nchunks)
735{ 747{
736 int i, err; 748 int i, err;
737 snd_pcm_runtime_t *runtime = subs->runtime; 749 struct snd_pcm_runtime *runtime = subs->runtime;
738 750
739 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) 751 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
740 return; 752 return;
@@ -749,10 +761,12 @@ static void vx_pcm_playback_transfer(vx_core_t *chip, snd_pcm_substream_t *subs,
749 * update the playback position and call snd_pcm_period_elapsed() if necessary 761 * update the playback position and call snd_pcm_period_elapsed() if necessary
750 * called from interrupt handler 762 * called from interrupt handler
751 */ 763 */
752static void vx_pcm_playback_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe) 764static void vx_pcm_playback_update(struct vx_core *chip,
765 struct snd_pcm_substream *subs,
766 struct vx_pipe *pipe)
753{ 767{
754 int err; 768 int err;
755 snd_pcm_runtime_t *runtime = subs->runtime; 769 struct snd_pcm_runtime *runtime = subs->runtime;
756 770
757 if (pipe->running && ! (chip->chip_status & VX_STAT_IS_STALE)) { 771 if (pipe->running && ! (chip->chip_status & VX_STAT_IS_STALE)) {
758 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0) 772 if ((err = vx_update_pipe_position(chip, runtime, pipe)) < 0)
@@ -771,9 +785,9 @@ static void vx_pcm_playback_update(vx_core_t *chip, snd_pcm_substream_t *subs, v
771 */ 785 */
772static void vx_pcm_delayed_start(unsigned long arg) 786static void vx_pcm_delayed_start(unsigned long arg)
773{ 787{
774 snd_pcm_substream_t *subs = (snd_pcm_substream_t *)arg; 788 struct snd_pcm_substream *subs = (struct snd_pcm_substream *)arg;
775 vx_core_t *chip = subs->pcm->private_data; 789 struct vx_core *chip = subs->pcm->private_data;
776 vx_pipe_t *pipe = subs->runtime->private_data; 790 struct vx_pipe *pipe = subs->runtime->private_data;
777 int err; 791 int err;
778 792
779 /* printk( KERN_DEBUG "DDDD tasklet delayed start jiffies = %ld\n", jiffies);*/ 793 /* printk( KERN_DEBUG "DDDD tasklet delayed start jiffies = %ld\n", jiffies);*/
@@ -792,10 +806,10 @@ static void vx_pcm_delayed_start(unsigned long arg)
792/* 806/*
793 * vx_pcm_playback_trigger - trigger callback for playback 807 * vx_pcm_playback_trigger - trigger callback for playback
794 */ 808 */
795static int vx_pcm_trigger(snd_pcm_substream_t *subs, int cmd) 809static int vx_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
796{ 810{
797 vx_core_t *chip = snd_pcm_substream_chip(subs); 811 struct vx_core *chip = snd_pcm_substream_chip(subs);
798 vx_pipe_t *pipe = subs->runtime->private_data; 812 struct vx_pipe *pipe = subs->runtime->private_data;
799 int err; 813 int err;
800 814
801 if (chip->chip_status & VX_STAT_IS_STALE) 815 if (chip->chip_status & VX_STAT_IS_STALE)
@@ -839,18 +853,18 @@ static int vx_pcm_trigger(snd_pcm_substream_t *subs, int cmd)
839/* 853/*
840 * vx_pcm_playback_pointer - pointer callback for playback 854 * vx_pcm_playback_pointer - pointer callback for playback
841 */ 855 */
842static snd_pcm_uframes_t vx_pcm_playback_pointer(snd_pcm_substream_t *subs) 856static snd_pcm_uframes_t vx_pcm_playback_pointer(struct snd_pcm_substream *subs)
843{ 857{
844 snd_pcm_runtime_t *runtime = subs->runtime; 858 struct snd_pcm_runtime *runtime = subs->runtime;
845 vx_pipe_t *pipe = runtime->private_data; 859 struct vx_pipe *pipe = runtime->private_data;
846 return pipe->position; 860 return pipe->position;
847} 861}
848 862
849/* 863/*
850 * vx_pcm_hw_params - hw_params callback for playback and capture 864 * vx_pcm_hw_params - hw_params callback for playback and capture
851 */ 865 */
852static int vx_pcm_hw_params(snd_pcm_substream_t *subs, 866static int vx_pcm_hw_params(struct snd_pcm_substream *subs,
853 snd_pcm_hw_params_t *hw_params) 867 struct snd_pcm_hw_params *hw_params)
854{ 868{
855 return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params)); 869 return snd_pcm_alloc_vmalloc_buffer(subs, params_buffer_bytes(hw_params));
856} 870}
@@ -858,7 +872,7 @@ static int vx_pcm_hw_params(snd_pcm_substream_t *subs,
858/* 872/*
859 * vx_pcm_hw_free - hw_free callback for playback and capture 873 * vx_pcm_hw_free - hw_free callback for playback and capture
860 */ 874 */
861static int vx_pcm_hw_free(snd_pcm_substream_t *subs) 875static int vx_pcm_hw_free(struct snd_pcm_substream *subs)
862{ 876{
863 return snd_pcm_free_vmalloc_buffer(subs); 877 return snd_pcm_free_vmalloc_buffer(subs);
864} 878}
@@ -866,11 +880,11 @@ static int vx_pcm_hw_free(snd_pcm_substream_t *subs)
866/* 880/*
867 * vx_pcm_prepare - prepare callback for playback and capture 881 * vx_pcm_prepare - prepare callback for playback and capture
868 */ 882 */
869static int vx_pcm_prepare(snd_pcm_substream_t *subs) 883static int vx_pcm_prepare(struct snd_pcm_substream *subs)
870{ 884{
871 vx_core_t *chip = snd_pcm_substream_chip(subs); 885 struct vx_core *chip = snd_pcm_substream_chip(subs);
872 snd_pcm_runtime_t *runtime = subs->runtime; 886 struct snd_pcm_runtime *runtime = subs->runtime;
873 vx_pipe_t *pipe = runtime->private_data; 887 struct vx_pipe *pipe = runtime->private_data;
874 int err, data_mode; 888 int err, data_mode;
875 // int max_size, nchunks; 889 // int max_size, nchunks;
876 890
@@ -897,7 +911,8 @@ static int vx_pcm_prepare(snd_pcm_substream_t *subs)
897 } 911 }
898 912
899 if (chip->pcm_running && chip->freq != runtime->rate) { 913 if (chip->pcm_running && chip->freq != runtime->rate) {
900 snd_printk(KERN_ERR "vx: cannot set different clock %d from the current %d\n", runtime->rate, chip->freq); 914 snd_printk(KERN_ERR "vx: cannot set different clock %d "
915 "from the current %d\n", runtime->rate, chip->freq);
901 return -EINVAL; 916 return -EINVAL;
902 } 917 }
903 vx_set_clock(chip, runtime->rate); 918 vx_set_clock(chip, runtime->rate);
@@ -930,7 +945,7 @@ static int vx_pcm_prepare(snd_pcm_substream_t *subs)
930/* 945/*
931 * operators for PCM playback 946 * operators for PCM playback
932 */ 947 */
933static snd_pcm_ops_t vx_pcm_playback_ops = { 948static struct snd_pcm_ops vx_pcm_playback_ops = {
934 .open = vx_pcm_playback_open, 949 .open = vx_pcm_playback_open,
935 .close = vx_pcm_playback_close, 950 .close = vx_pcm_playback_close,
936 .ioctl = snd_pcm_lib_ioctl, 951 .ioctl = snd_pcm_lib_ioctl,
@@ -947,11 +962,12 @@ static snd_pcm_ops_t vx_pcm_playback_ops = {
947 * playback hw information 962 * playback hw information
948 */ 963 */
949 964
950static snd_pcm_hardware_t vx_pcm_capture_hw = { 965static struct snd_pcm_hardware vx_pcm_capture_hw = {
951 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 966 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
952 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/ 967 SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_MMAP_VALID /*|*/
953 /*SNDRV_PCM_INFO_RESUME*/), 968 /*SNDRV_PCM_INFO_RESUME*/),
954 .formats = /*SNDRV_PCM_FMTBIT_U8 |*/ SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE, 969 .formats = (/*SNDRV_PCM_FMTBIT_U8 |*/
970 SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_3LE),
955 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000, 971 .rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
956 .rate_min = 5000, 972 .rate_min = 5000,
957 .rate_max = 48000, 973 .rate_max = 48000,
@@ -969,12 +985,12 @@ static snd_pcm_hardware_t vx_pcm_capture_hw = {
969/* 985/*
970 * vx_pcm_capture_open - open callback for capture 986 * vx_pcm_capture_open - open callback for capture
971 */ 987 */
972static int vx_pcm_capture_open(snd_pcm_substream_t *subs) 988static int vx_pcm_capture_open(struct snd_pcm_substream *subs)
973{ 989{
974 snd_pcm_runtime_t *runtime = subs->runtime; 990 struct snd_pcm_runtime *runtime = subs->runtime;
975 vx_core_t *chip = snd_pcm_substream_chip(subs); 991 struct vx_core *chip = snd_pcm_substream_chip(subs);
976 vx_pipe_t *pipe; 992 struct vx_pipe *pipe;
977 vx_pipe_t *pipe_out_monitoring = NULL; 993 struct vx_pipe *pipe_out_monitoring = NULL;
978 unsigned int audio; 994 unsigned int audio;
979 int err; 995 int err;
980 996
@@ -1005,9 +1021,11 @@ static int vx_pcm_capture_open(snd_pcm_substream_t *subs)
1005 if an output pipe is available, it's audios still may need to be 1021 if an output pipe is available, it's audios still may need to be
1006 unmuted. hence we'll have to call a mixer entry point. 1022 unmuted. hence we'll have to call a mixer entry point.
1007 */ 1023 */
1008 vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], chip->audio_monitor_active[audio]); 1024 vx_set_monitor_level(chip, audio, chip->audio_monitor[audio],
1025 chip->audio_monitor_active[audio]);
1009 /* assuming stereo */ 1026 /* assuming stereo */
1010 vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], chip->audio_monitor_active[audio+1]); 1027 vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1],
1028 chip->audio_monitor_active[audio+1]);
1011 } 1029 }
1012 1030
1013 pipe->monitoring_pipe = pipe_out_monitoring; /* default value NULL */ 1031 pipe->monitoring_pipe = pipe_out_monitoring; /* default value NULL */
@@ -1026,11 +1044,11 @@ static int vx_pcm_capture_open(snd_pcm_substream_t *subs)
1026/* 1044/*
1027 * vx_pcm_capture_close - close callback for capture 1045 * vx_pcm_capture_close - close callback for capture
1028 */ 1046 */
1029static int vx_pcm_capture_close(snd_pcm_substream_t *subs) 1047static int vx_pcm_capture_close(struct snd_pcm_substream *subs)
1030{ 1048{
1031 vx_core_t *chip = snd_pcm_substream_chip(subs); 1049 struct vx_core *chip = snd_pcm_substream_chip(subs);
1032 vx_pipe_t *pipe; 1050 struct vx_pipe *pipe;
1033 vx_pipe_t *pipe_out_monitoring; 1051 struct vx_pipe *pipe_out_monitoring;
1034 1052
1035 if (! subs->runtime->private_data) 1053 if (! subs->runtime->private_data)
1036 return -EINVAL; 1054 return -EINVAL;
@@ -1062,10 +1080,11 @@ static int vx_pcm_capture_close(snd_pcm_substream_t *subs)
1062/* 1080/*
1063 * vx_pcm_capture_update - update the capture buffer 1081 * vx_pcm_capture_update - update the capture buffer
1064 */ 1082 */
1065static void vx_pcm_capture_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx_pipe_t *pipe) 1083static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream *subs,
1084 struct vx_pipe *pipe)
1066{ 1085{
1067 int size, space, count; 1086 int size, space, count;
1068 snd_pcm_runtime_t *runtime = subs->runtime; 1087 struct snd_pcm_runtime *runtime = subs->runtime;
1069 1088
1070 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) 1089 if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE))
1071 return; 1090 return;
@@ -1135,17 +1154,17 @@ static void vx_pcm_capture_update(vx_core_t *chip, snd_pcm_substream_t *subs, vx
1135/* 1154/*
1136 * vx_pcm_capture_pointer - pointer callback for capture 1155 * vx_pcm_capture_pointer - pointer callback for capture
1137 */ 1156 */
1138static snd_pcm_uframes_t vx_pcm_capture_pointer(snd_pcm_substream_t *subs) 1157static snd_pcm_uframes_t vx_pcm_capture_pointer(struct snd_pcm_substream *subs)
1139{ 1158{
1140 snd_pcm_runtime_t *runtime = subs->runtime; 1159 struct snd_pcm_runtime *runtime = subs->runtime;
1141 vx_pipe_t *pipe = runtime->private_data; 1160 struct vx_pipe *pipe = runtime->private_data;
1142 return bytes_to_frames(runtime, pipe->hw_ptr); 1161 return bytes_to_frames(runtime, pipe->hw_ptr);
1143} 1162}
1144 1163
1145/* 1164/*
1146 * operators for PCM capture 1165 * operators for PCM capture
1147 */ 1166 */
1148static snd_pcm_ops_t vx_pcm_capture_ops = { 1167static struct snd_pcm_ops vx_pcm_capture_ops = {
1149 .open = vx_pcm_capture_open, 1168 .open = vx_pcm_capture_open,
1150 .close = vx_pcm_capture_close, 1169 .close = vx_pcm_capture_close,
1151 .ioctl = snd_pcm_lib_ioctl, 1170 .ioctl = snd_pcm_lib_ioctl,
@@ -1161,10 +1180,10 @@ static snd_pcm_ops_t vx_pcm_capture_ops = {
1161/* 1180/*
1162 * interrupt handler for pcm streams 1181 * interrupt handler for pcm streams
1163 */ 1182 */
1164void vx_pcm_update_intr(vx_core_t *chip, unsigned int events) 1183void vx_pcm_update_intr(struct vx_core *chip, unsigned int events)
1165{ 1184{
1166 unsigned int i; 1185 unsigned int i;
1167 vx_pipe_t *pipe; 1186 struct vx_pipe *pipe;
1168 1187
1169#define EVENT_MASK (END_OF_BUFFER_EVENTS_PENDING|ASYNC_EVENTS_PENDING) 1188#define EVENT_MASK (END_OF_BUFFER_EVENTS_PENDING|ASYNC_EVENTS_PENDING)
1170 1189
@@ -1218,7 +1237,7 @@ void vx_pcm_update_intr(vx_core_t *chip, unsigned int events)
1218/* 1237/*
1219 * vx_init_audio_io - check the availabe audio i/o and allocate pipe arrays 1238 * vx_init_audio_io - check the availabe audio i/o and allocate pipe arrays
1220 */ 1239 */
1221static int vx_init_audio_io(vx_core_t *chip) 1240static int vx_init_audio_io(struct vx_core *chip)
1222{ 1241{
1223 struct vx_rmh rmh; 1242 struct vx_rmh rmh;
1224 int preferred; 1243 int preferred;
@@ -1234,19 +1253,20 @@ static int vx_init_audio_io(vx_core_t *chip)
1234 chip->audio_info = rmh.Stat[1]; 1253 chip->audio_info = rmh.Stat[1];
1235 1254
1236 /* allocate pipes */ 1255 /* allocate pipes */
1237 chip->playback_pipes = kmalloc(sizeof(vx_pipe_t *) * chip->audio_outs, GFP_KERNEL); 1256 chip->playback_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_outs, GFP_KERNEL);
1238 chip->capture_pipes = kmalloc(sizeof(vx_pipe_t *) * chip->audio_ins, GFP_KERNEL); 1257 chip->capture_pipes = kmalloc(sizeof(struct vx_pipe *) * chip->audio_ins, GFP_KERNEL);
1239 if (! chip->playback_pipes || ! chip->capture_pipes) 1258 if (! chip->playback_pipes || ! chip->capture_pipes)
1240 return -ENOMEM; 1259 return -ENOMEM;
1241 1260
1242 memset(chip->playback_pipes, 0, sizeof(vx_pipe_t *) * chip->audio_outs); 1261 memset(chip->playback_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_outs);
1243 memset(chip->capture_pipes, 0, sizeof(vx_pipe_t *) * chip->audio_ins); 1262 memset(chip->capture_pipes, 0, sizeof(struct vx_pipe *) * chip->audio_ins);
1244 1263
1245 preferred = chip->ibl.size; 1264 preferred = chip->ibl.size;
1246 chip->ibl.size = 0; 1265 chip->ibl.size = 0;
1247 vx_set_ibl(chip, &chip->ibl); /* query the info */ 1266 vx_set_ibl(chip, &chip->ibl); /* query the info */
1248 if (preferred > 0) { 1267 if (preferred > 0) {
1249 chip->ibl.size = ((preferred + chip->ibl.granularity - 1) / chip->ibl.granularity) * chip->ibl.granularity; 1268 chip->ibl.size = ((preferred + chip->ibl.granularity - 1) /
1269 chip->ibl.granularity) * chip->ibl.granularity;
1250 if (chip->ibl.size > chip->ibl.max_size) 1270 if (chip->ibl.size > chip->ibl.max_size)
1251 chip->ibl.size = chip->ibl.max_size; 1271 chip->ibl.size = chip->ibl.max_size;
1252 } else 1272 } else
@@ -1260,9 +1280,9 @@ static int vx_init_audio_io(vx_core_t *chip)
1260/* 1280/*
1261 * free callback for pcm 1281 * free callback for pcm
1262 */ 1282 */
1263static void snd_vx_pcm_free(snd_pcm_t *pcm) 1283static void snd_vx_pcm_free(struct snd_pcm *pcm)
1264{ 1284{
1265 vx_core_t *chip = pcm->private_data; 1285 struct vx_core *chip = pcm->private_data;
1266 chip->pcm[pcm->device] = NULL; 1286 chip->pcm[pcm->device] = NULL;
1267 kfree(chip->playback_pipes); 1287 kfree(chip->playback_pipes);
1268 chip->playback_pipes = NULL; 1288 chip->playback_pipes = NULL;
@@ -1273,9 +1293,9 @@ static void snd_vx_pcm_free(snd_pcm_t *pcm)
1273/* 1293/*
1274 * snd_vx_pcm_new - create and initialize a pcm 1294 * snd_vx_pcm_new - create and initialize a pcm
1275 */ 1295 */
1276int snd_vx_pcm_new(vx_core_t *chip) 1296int snd_vx_pcm_new(struct vx_core *chip)
1277{ 1297{
1278 snd_pcm_t *pcm; 1298 struct snd_pcm *pcm;
1279 unsigned int i; 1299 unsigned int i;
1280 int err; 1300 int err;
1281 1301
diff --git a/sound/drivers/vx/vx_uer.c b/sound/drivers/vx/vx_uer.c
index 4fc38bde34f4..7400306b7f28 100644
--- a/sound/drivers/vx/vx_uer.c
+++ b/sound/drivers/vx/vx_uer.c
@@ -31,7 +31,7 @@
31 * vx_modify_board_clock - tell the board that its clock has been modified 31 * vx_modify_board_clock - tell the board that its clock has been modified
32 * @sync: DSP needs to resynchronize its FIFO 32 * @sync: DSP needs to resynchronize its FIFO
33 */ 33 */
34static int vx_modify_board_clock(vx_core_t *chip, int sync) 34static int vx_modify_board_clock(struct vx_core *chip, int sync)
35{ 35{
36 struct vx_rmh rmh; 36 struct vx_rmh rmh;
37 37
@@ -45,7 +45,7 @@ static int vx_modify_board_clock(vx_core_t *chip, int sync)
45/* 45/*
46 * vx_modify_board_inputs - resync audio inputs 46 * vx_modify_board_inputs - resync audio inputs
47 */ 47 */
48static int vx_modify_board_inputs(vx_core_t *chip) 48static int vx_modify_board_inputs(struct vx_core *chip)
49{ 49{
50 struct vx_rmh rmh; 50 struct vx_rmh rmh;
51 51
@@ -59,7 +59,7 @@ static int vx_modify_board_inputs(vx_core_t *chip)
59 * @index: the bit index 59 * @index: the bit index
60 * returns 0 or 1. 60 * returns 0 or 1.
61 */ 61 */
62static int vx_read_one_cbit(vx_core_t *chip, int index) 62static int vx_read_one_cbit(struct vx_core *chip, int index)
63{ 63{
64 unsigned long flags; 64 unsigned long flags;
65 int val; 65 int val;
@@ -82,7 +82,7 @@ static int vx_read_one_cbit(vx_core_t *chip, int index)
82 * @index: the bit index 82 * @index: the bit index
83 * @val: bit value, 0 or 1 83 * @val: bit value, 0 or 1
84 */ 84 */
85static void vx_write_one_cbit(vx_core_t *chip, int index, int val) 85static void vx_write_one_cbit(struct vx_core *chip, int index, int val)
86{ 86{
87 unsigned long flags; 87 unsigned long flags;
88 val = !!val; /* 0 or 1 */ 88 val = !!val; /* 0 or 1 */
@@ -104,7 +104,7 @@ static void vx_write_one_cbit(vx_core_t *chip, int index, int val)
104 * returns the frequency of UER, or 0 if not sync, 104 * returns the frequency of UER, or 0 if not sync,
105 * or a negative error code. 105 * or a negative error code.
106 */ 106 */
107static int vx_read_uer_status(vx_core_t *chip, int *mode) 107static int vx_read_uer_status(struct vx_core *chip, int *mode)
108{ 108{
109 int val, freq; 109 int val, freq;
110 110
@@ -160,7 +160,7 @@ static int vx_read_uer_status(vx_core_t *chip, int *mode)
160 * default : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF 160 * default : HexFreq = (dword) ((double) 28224000 / (double) (Frequency*4)) - 0x000001FF
161 */ 161 */
162 162
163static int vx_calc_clock_from_freq(vx_core_t *chip, int freq) 163static int vx_calc_clock_from_freq(struct vx_core *chip, int freq)
164{ 164{
165 int hexfreq; 165 int hexfreq;
166 166
@@ -187,7 +187,7 @@ static int vx_calc_clock_from_freq(vx_core_t *chip, int freq)
187 * vx_change_clock_source - change the clock source 187 * vx_change_clock_source - change the clock source
188 * @source: the new source 188 * @source: the new source
189 */ 189 */
190static void vx_change_clock_source(vx_core_t *chip, int source) 190static void vx_change_clock_source(struct vx_core *chip, int source)
191{ 191{
192 unsigned long flags; 192 unsigned long flags;
193 193
@@ -205,7 +205,7 @@ static void vx_change_clock_source(vx_core_t *chip, int source)
205/* 205/*
206 * set the internal clock 206 * set the internal clock
207 */ 207 */
208void vx_set_internal_clock(vx_core_t *chip, unsigned int freq) 208void vx_set_internal_clock(struct vx_core *chip, unsigned int freq)
209{ 209{
210 int clock; 210 int clock;
211 unsigned long flags; 211 unsigned long flags;
@@ -228,7 +228,7 @@ void vx_set_internal_clock(vx_core_t *chip, unsigned int freq)
228 * set the iec958 status bits 228 * set the iec958 status bits
229 * @bits: 32-bit status bits 229 * @bits: 32-bit status bits
230 */ 230 */
231void vx_set_iec958_status(vx_core_t *chip, unsigned int bits) 231void vx_set_iec958_status(struct vx_core *chip, unsigned int bits)
232{ 232{
233 int i; 233 int i;
234 234
@@ -243,7 +243,7 @@ void vx_set_iec958_status(vx_core_t *chip, unsigned int bits)
243/* 243/*
244 * vx_set_clock - change the clock and audio source if necessary 244 * vx_set_clock - change the clock and audio source if necessary
245 */ 245 */
246int vx_set_clock(vx_core_t *chip, unsigned int freq) 246int vx_set_clock(struct vx_core *chip, unsigned int freq)
247{ 247{
248 int src_changed = 0; 248 int src_changed = 0;
249 249
@@ -285,7 +285,7 @@ int vx_set_clock(vx_core_t *chip, unsigned int freq)
285/* 285/*
286 * vx_change_frequency - called from interrupt handler 286 * vx_change_frequency - called from interrupt handler
287 */ 287 */
288int vx_change_frequency(vx_core_t *chip) 288int vx_change_frequency(struct vx_core *chip)
289{ 289{
290 int freq; 290 int freq;
291 291