aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 08:50:13 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:18:47 -0500
commiteb4698f347ec908c365504c4edddadd1acd406ea (patch)
tree4962019c8bf4a52e35ab55137e17aa150edf9661 /sound
parent3d19f804ef5f1d15fe001fc8d1ed58fac9d591fb (diff)
[ALSA] Remove xxx_t typedefs: PCI emu10k1
Modules: EMU10K1/EMU10K2 driver Remove xxx_t typedefs from the PCI emu10k1 driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/emu10k1/emu10k1.c10
-rw-r--r--sound/pci/emu10k1/emu10k1_callback.c105
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c39
-rw-r--r--sound/pci/emu10k1/emu10k1_patch.c13
-rw-r--r--sound/pci/emu10k1/emu10k1_synth.c19
-rw-r--r--sound/pci/emu10k1/emu10k1_synth_local.h15
-rw-r--r--sound/pci/emu10k1/emufx.c244
-rw-r--r--sound/pci/emu10k1/emumixer.c229
-rw-r--r--sound/pci/emu10k1/emumpu401.c72
-rw-r--r--sound/pci/emu10k1/emupcm.c354
-rw-r--r--sound/pci/emu10k1/emuproc.c101
-rw-r--r--sound/pci/emu10k1/io.c38
-rw-r--r--sound/pci/emu10k1/irq.c8
-rw-r--r--sound/pci/emu10k1/memory.c94
-rw-r--r--sound/pci/emu10k1/p16v.c254
-rw-r--r--sound/pci/emu10k1/timer.c18
-rw-r--r--sound/pci/emu10k1/voice.c13
17 files changed, 848 insertions, 778 deletions
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 78270f8710ff..9be900224771 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -101,10 +101,10 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
101 const struct pci_device_id *pci_id) 101 const struct pci_device_id *pci_id)
102{ 102{
103 static int dev; 103 static int dev;
104 snd_card_t *card; 104 struct snd_card *card;
105 emu10k1_t *emu; 105 struct snd_emu10k1 *emu;
106#ifdef ENABLE_SYNTH 106#ifdef ENABLE_SYNTH
107 snd_seq_device_t *wave = NULL; 107 struct snd_seq_device *wave = NULL;
108#endif 108#endif
109 int err; 109 int err;
110 110
@@ -186,11 +186,11 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
186 } 186 }
187#ifdef ENABLE_SYNTH 187#ifdef ENABLE_SYNTH
188 if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, 188 if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH,
189 sizeof(snd_emu10k1_synth_arg_t), &wave) < 0 || 189 sizeof(struct snd_emu10k1_synth_arg), &wave) < 0 ||
190 wave == NULL) { 190 wave == NULL) {
191 snd_printk(KERN_WARNING "can't initialize Emu10k1 wavetable synth\n"); 191 snd_printk(KERN_WARNING "can't initialize Emu10k1 wavetable synth\n");
192 } else { 192 } else {
193 snd_emu10k1_synth_arg_t *arg; 193 struct snd_emu10k1_synth_arg *arg;
194 arg = SNDRV_SEQ_DEVICE_ARGPTR(wave); 194 arg = SNDRV_SEQ_DEVICE_ARGPTR(wave);
195 strcpy(wave->name, "Emu-10k1 Synth"); 195 strcpy(wave->name, "Emu-10k1 Synth");
196 arg->hwptr = emu; 196 arg->hwptr = emu;
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index 6589bf24abcd..01965bd99966 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -27,26 +27,28 @@ enum {
27}; 27};
28 28
29/* Keeps track of what we are finding */ 29/* Keeps track of what we are finding */
30typedef struct best_voice { 30struct best_voice {
31 unsigned int time; 31 unsigned int time;
32 int voice; 32 int voice;
33} best_voice_t; 33};
34 34
35/* 35/*
36 * prototypes 36 * prototypes
37 */ 37 */
38static void lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_only); 38static void lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
39static snd_emux_voice_t *get_voice(snd_emux_t *emu, snd_emux_port_t *port); 39 struct best_voice *best, int active_only);
40static int start_voice(snd_emux_voice_t *vp); 40static struct snd_emux_voice *get_voice(struct snd_emux *emu,
41static void trigger_voice(snd_emux_voice_t *vp); 41 struct snd_emux_port *port);
42static void release_voice(snd_emux_voice_t *vp); 42static int start_voice(struct snd_emux_voice *vp);
43static void update_voice(snd_emux_voice_t *vp, int update); 43static void trigger_voice(struct snd_emux_voice *vp);
44static void terminate_voice(snd_emux_voice_t *vp); 44static void release_voice(struct snd_emux_voice *vp);
45static void free_voice(snd_emux_voice_t *vp); 45static void update_voice(struct snd_emux_voice *vp, int update);
46 46static void terminate_voice(struct snd_emux_voice *vp);
47static void set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp); 47static void free_voice(struct snd_emux_voice *vp);
48static void set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp); 48
49static void set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp); 49static void set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
50static void set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
51static void set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp);
50 52
51/* 53/*
52 * Ensure a value is between two points 54 * Ensure a value is between two points
@@ -59,7 +61,7 @@ static void set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp);
59/* 61/*
60 * set up operators 62 * set up operators
61 */ 63 */
62static snd_emux_operators_t emu10k1_ops = { 64static struct snd_emux_operators emu10k1_ops = {
63 .owner = THIS_MODULE, 65 .owner = THIS_MODULE,
64 .get_voice = get_voice, 66 .get_voice = get_voice,
65 .prepare = start_voice, 67 .prepare = start_voice,
@@ -73,7 +75,7 @@ static snd_emux_operators_t emu10k1_ops = {
73}; 75};
74 76
75void 77void
76snd_emu10k1_ops_setup(snd_emux_t *emu) 78snd_emu10k1_ops_setup(struct snd_emux *emu)
77{ 79{
78 emu->ops = emu10k1_ops; 80 emu->ops = emu10k1_ops;
79} 81}
@@ -85,11 +87,11 @@ snd_emu10k1_ops_setup(snd_emux_t *emu)
85 * terminate most inactive voice and give it as a pcm voice. 87 * terminate most inactive voice and give it as a pcm voice.
86 */ 88 */
87int 89int
88snd_emu10k1_synth_get_voice(emu10k1_t *hw) 90snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
89{ 91{
90 snd_emux_t *emu; 92 struct snd_emux *emu;
91 snd_emux_voice_t *vp; 93 struct snd_emux_voice *vp;
92 best_voice_t best[V_END]; 94 struct best_voice best[V_END];
93 unsigned long flags; 95 unsigned long flags;
94 int i; 96 int i;
95 97
@@ -123,10 +125,10 @@ snd_emu10k1_synth_get_voice(emu10k1_t *hw)
123 * turn off the voice (not terminated) 125 * turn off the voice (not terminated)
124 */ 126 */
125static void 127static void
126release_voice(snd_emux_voice_t *vp) 128release_voice(struct snd_emux_voice *vp)
127{ 129{
128 int dcysusv; 130 int dcysusv;
129 emu10k1_t *hw; 131 struct snd_emu10k1 *hw;
130 132
131 hw = vp->hw; 133 hw = vp->hw;
132 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease; 134 dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease;
@@ -140,16 +142,16 @@ release_voice(snd_emux_voice_t *vp)
140 * terminate the voice 142 * terminate the voice
141 */ 143 */
142static void 144static void
143terminate_voice(snd_emux_voice_t *vp) 145terminate_voice(struct snd_emux_voice *vp)
144{ 146{
145 emu10k1_t *hw; 147 struct snd_emu10k1 *hw;
146 148
147 snd_assert(vp, return); 149 snd_assert(vp, return);
148 hw = vp->hw; 150 hw = vp->hw;
149 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK); 151 snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
150 if (vp->block) { 152 if (vp->block) {
151 emu10k1_memblk_t *emem; 153 struct snd_emu10k1_memblk *emem;
152 emem = (emu10k1_memblk_t *)vp->block; 154 emem = (struct snd_emu10k1_memblk *)vp->block;
153 if (emem->map_locked > 0) 155 if (emem->map_locked > 0)
154 emem->map_locked--; 156 emem->map_locked--;
155 } 157 }
@@ -159,9 +161,9 @@ terminate_voice(snd_emux_voice_t *vp)
159 * release the voice to system 161 * release the voice to system
160 */ 162 */
161static void 163static void
162free_voice(snd_emux_voice_t *vp) 164free_voice(struct snd_emux_voice *vp)
163{ 165{
164 emu10k1_t *hw; 166 struct snd_emu10k1 *hw;
165 167
166 hw = vp->hw; 168 hw = vp->hw;
167 if (vp->ch >= 0) { 169 if (vp->ch >= 0) {
@@ -181,9 +183,9 @@ free_voice(snd_emux_voice_t *vp)
181 * update registers 183 * update registers
182 */ 184 */
183static void 185static void
184update_voice(snd_emux_voice_t *vp, int update) 186update_voice(struct snd_emux_voice *vp, int update)
185{ 187{
186 emu10k1_t *hw; 188 struct snd_emu10k1 *hw;
187 189
188 hw = vp->hw; 190 hw = vp->hw;
189 if (update & SNDRV_EMUX_UPDATE_VOLUME) 191 if (update & SNDRV_EMUX_UPDATE_VOLUME)
@@ -210,10 +212,11 @@ update_voice(snd_emux_voice_t *vp, int update)
210 */ 212 */
211/* spinlock held! */ 213/* spinlock held! */
212static void 214static void
213lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_only) 215lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
216 struct best_voice *best, int active_only)
214{ 217{
215 snd_emux_voice_t *vp; 218 struct snd_emux_voice *vp;
216 best_voice_t *bp; 219 struct best_voice *bp;
217 int i; 220 int i;
218 221
219 for (i = 0; i < V_END; i++) { 222 for (i = 0; i < V_END; i++) {
@@ -274,12 +277,12 @@ lookup_voices(snd_emux_t *emu, emu10k1_t *hw, best_voice_t *best, int active_onl
274 * 277 *
275 * emu->voice_lock is already held. 278 * emu->voice_lock is already held.
276 */ 279 */
277static snd_emux_voice_t * 280static struct snd_emux_voice *
278get_voice(snd_emux_t *emu, snd_emux_port_t *port) 281get_voice(struct snd_emux *emu, struct snd_emux_port *port)
279{ 282{
280 emu10k1_t *hw; 283 struct snd_emu10k1 *hw;
281 snd_emux_voice_t *vp; 284 struct snd_emux_voice *vp;
282 best_voice_t best[V_END]; 285 struct best_voice best[V_END];
283 int i; 286 int i;
284 287
285 hw = emu->hw; 288 hw = emu->hw;
@@ -290,7 +293,7 @@ get_voice(snd_emux_t *emu, snd_emux_port_t *port)
290 vp = &emu->voices[best[i].voice]; 293 vp = &emu->voices[best[i].voice];
291 if (vp->ch < 0) { 294 if (vp->ch < 0) {
292 /* allocate a voice */ 295 /* allocate a voice */
293 emu10k1_voice_t *hwvoice; 296 struct snd_emu10k1_voice *hwvoice;
294 if (snd_emu10k1_voice_alloc(hw, EMU10K1_SYNTH, 1, &hwvoice) < 0 || hwvoice == NULL) 297 if (snd_emu10k1_voice_alloc(hw, EMU10K1_SYNTH, 1, &hwvoice) < 0 || hwvoice == NULL)
295 continue; 298 continue;
296 vp->ch = hwvoice->number; 299 vp->ch = hwvoice->number;
@@ -308,21 +311,21 @@ get_voice(snd_emux_t *emu, snd_emux_port_t *port)
308 * prepare envelopes and LFOs 311 * prepare envelopes and LFOs
309 */ 312 */
310static int 313static int
311start_voice(snd_emux_voice_t *vp) 314start_voice(struct snd_emux_voice *vp)
312{ 315{
313 unsigned int temp; 316 unsigned int temp;
314 int ch; 317 int ch;
315 unsigned int addr, mapped_offset; 318 unsigned int addr, mapped_offset;
316 snd_midi_channel_t *chan; 319 struct snd_midi_channel *chan;
317 emu10k1_t *hw; 320 struct snd_emu10k1 *hw;
318 emu10k1_memblk_t *emem; 321 struct snd_emu10k1_memblk *emem;
319 322
320 hw = vp->hw; 323 hw = vp->hw;
321 ch = vp->ch; 324 ch = vp->ch;
322 snd_assert(ch >= 0, return -EINVAL); 325 snd_assert(ch >= 0, return -EINVAL);
323 chan = vp->chan; 326 chan = vp->chan;
324 327
325 emem = (emu10k1_memblk_t *)vp->block; 328 emem = (struct snd_emu10k1_memblk *)vp->block;
326 if (emem == NULL) 329 if (emem == NULL)
327 return -EINVAL; 330 return -EINVAL;
328 emem->map_locked++; 331 emem->map_locked++;
@@ -463,15 +466,15 @@ start_voice(snd_emux_voice_t *vp)
463 * Start envelope 466 * Start envelope
464 */ 467 */
465static void 468static void
466trigger_voice(snd_emux_voice_t *vp) 469trigger_voice(struct snd_emux_voice *vp)
467{ 470{
468 unsigned int temp, ptarget; 471 unsigned int temp, ptarget;
469 emu10k1_t *hw; 472 struct snd_emu10k1 *hw;
470 emu10k1_memblk_t *emem; 473 struct snd_emu10k1_memblk *emem;
471 474
472 hw = vp->hw; 475 hw = vp->hw;
473 476
474 emem = (emu10k1_memblk_t *)vp->block; 477 emem = (struct snd_emu10k1_memblk *)vp->block;
475 if (! emem || emem->mapped_page < 0) 478 if (! emem || emem->mapped_page < 0)
476 return; /* not mapped */ 479 return; /* not mapped */
477 480
@@ -495,7 +498,7 @@ trigger_voice(snd_emux_voice_t *vp)
495 498
496/* set lfo1 modulation height and cutoff */ 499/* set lfo1 modulation height and cutoff */
497static void 500static void
498set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp) 501set_fmmod(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
499{ 502{
500 unsigned short fmmod; 503 unsigned short fmmod;
501 short pitch; 504 short pitch;
@@ -513,7 +516,7 @@ set_fmmod(emu10k1_t *hw, snd_emux_voice_t *vp)
513 516
514/* set lfo2 pitch & frequency */ 517/* set lfo2 pitch & frequency */
515static void 518static void
516set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp) 519set_fm2frq2(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
517{ 520{
518 unsigned short fm2frq2; 521 unsigned short fm2frq2;
519 short pitch; 522 short pitch;
@@ -531,7 +534,7 @@ set_fm2frq2(emu10k1_t *hw, snd_emux_voice_t *vp)
531 534
532/* set filterQ */ 535/* set filterQ */
533static void 536static void
534set_filterQ(emu10k1_t *hw, snd_emux_voice_t *vp) 537set_filterQ(struct snd_emu10k1 *hw, struct snd_emux_voice *vp)
535{ 538{
536 unsigned int val; 539 unsigned int val;
537 val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE; 540 val = snd_emu10k1_ptr_read(hw, CCCA, vp->ch) & ~CCCA_RESONANCE;
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 2d1ebe8c6b41..f9855073a0a9 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -52,7 +52,7 @@ MODULE_LICENSE("GPL");
52 * EMU10K1 init / done 52 * EMU10K1 init / done
53 *************************************************************************/ 53 *************************************************************************/
54 54
55void snd_emu10k1_voice_init(emu10k1_t * emu, int ch) 55void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int ch)
56{ 56{
57 snd_emu10k1_ptr_write(emu, DCYSUSV, ch, 0); 57 snd_emu10k1_ptr_write(emu, DCYSUSV, ch, 0);
58 snd_emu10k1_ptr_write(emu, IP, ch, 0); 58 snd_emu10k1_ptr_write(emu, IP, ch, 0);
@@ -97,7 +97,7 @@ void snd_emu10k1_voice_init(emu10k1_t * emu, int ch)
97 } 97 }
98} 98}
99 99
100static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir) 100static int __devinit snd_emu10k1_init(struct snd_emu10k1 * emu, int enable_ir)
101{ 101{
102 int ch, idx, err; 102 int ch, idx, err;
103 unsigned int silent_page; 103 unsigned int silent_page;
@@ -336,14 +336,14 @@ static int __devinit snd_emu10k1_init(emu10k1_t * emu, int enable_ir)
336 336
337 snd_emu10k1_intr_enable(emu, INTE_PCIERRORENABLE); 337 snd_emu10k1_intr_enable(emu, INTE_PCIERRORENABLE);
338 338
339 emu->reserved_page = (emu10k1_memblk_t *)snd_emu10k1_synth_alloc(emu, 4096); 339 emu->reserved_page = (struct snd_emu10k1_memblk *)snd_emu10k1_synth_alloc(emu, 4096);
340 if (emu->reserved_page) 340 if (emu->reserved_page)
341 emu->reserved_page->map_locked = 1; 341 emu->reserved_page->map_locked = 1;
342 342
343 return 0; 343 return 0;
344} 344}
345 345
346static int snd_emu10k1_done(emu10k1_t * emu) 346static int snd_emu10k1_done(struct snd_emu10k1 * emu)
347{ 347{
348 int ch; 348 int ch;
349 349
@@ -384,7 +384,7 @@ static int snd_emu10k1_done(emu10k1_t * emu)
384 384
385 /* remove reserved page */ 385 /* remove reserved page */
386 if (emu->reserved_page != NULL) { 386 if (emu->reserved_page != NULL) {
387 snd_emu10k1_synth_free(emu, (snd_util_memblk_t *)emu->reserved_page); 387 snd_emu10k1_synth_free(emu, (struct snd_util_memblk *)emu->reserved_page);
388 emu->reserved_page = NULL; 388 emu->reserved_page = NULL;
389 } 389 }
390 390
@@ -474,7 +474,7 @@ static int snd_emu10k1_done(emu10k1_t * emu)
474 * register. 474 * register.
475 */ 475 */
476 476
477static void snd_emu10k1_ecard_write(emu10k1_t * emu, unsigned int value) 477static void snd_emu10k1_ecard_write(struct snd_emu10k1 * emu, unsigned int value)
478{ 478{
479 unsigned short count; 479 unsigned short count;
480 unsigned int data; 480 unsigned int data;
@@ -512,7 +512,7 @@ static void snd_emu10k1_ecard_write(emu10k1_t * emu, unsigned int value)
512 * channel. 512 * channel.
513 */ 513 */
514 514
515static void snd_emu10k1_ecard_setadcgain(emu10k1_t * emu, 515static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
516 unsigned short gain) 516 unsigned short gain)
517{ 517{
518 unsigned int bit; 518 unsigned int bit;
@@ -540,7 +540,7 @@ static void snd_emu10k1_ecard_setadcgain(emu10k1_t * emu,
540 snd_emu10k1_ecard_write(emu, emu->ecard_ctrl); 540 snd_emu10k1_ecard_write(emu, emu->ecard_ctrl);
541} 541}
542 542
543static int __devinit snd_emu10k1_ecard_init(emu10k1_t * emu) 543static int __devinit snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
544{ 544{
545 unsigned int hc_value; 545 unsigned int hc_value;
546 546
@@ -580,7 +580,7 @@ static int __devinit snd_emu10k1_ecard_init(emu10k1_t * emu)
580 return 0; 580 return 0;
581} 581}
582 582
583static int __devinit snd_emu10k1_cardbus_init(emu10k1_t * emu) 583static int __devinit snd_emu10k1_cardbus_init(struct snd_emu10k1 * emu)
584{ 584{
585 unsigned long special_port; 585 unsigned long special_port;
586 unsigned int value; 586 unsigned int value;
@@ -609,7 +609,7 @@ static int __devinit snd_emu10k1_cardbus_init(emu10k1_t * emu)
609 * Create the EMU10K1 instance 609 * Create the EMU10K1 instance
610 */ 610 */
611 611
612static int snd_emu10k1_free(emu10k1_t *emu) 612static int snd_emu10k1_free(struct snd_emu10k1 *emu)
613{ 613{
614 if (emu->port) { /* avoid access to already used hardware */ 614 if (emu->port) { /* avoid access to already used hardware */
615 snd_emu10k1_fx8010_tram_setup(emu, 0); 615 snd_emu10k1_fx8010_tram_setup(emu, 0);
@@ -634,13 +634,13 @@ static int snd_emu10k1_free(emu10k1_t *emu)
634 return 0; 634 return 0;
635} 635}
636 636
637static int snd_emu10k1_dev_free(snd_device_t *device) 637static int snd_emu10k1_dev_free(struct snd_device *device)
638{ 638{
639 emu10k1_t *emu = device->device_data; 639 struct snd_emu10k1 *emu = device->device_data;
640 return snd_emu10k1_free(emu); 640 return snd_emu10k1_free(emu);
641} 641}
642 642
643static emu_chip_details_t emu_chip_details[] = { 643static struct snd_emu_chip_details emu_chip_details[] = {
644 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/ 644 /* Audigy 2 Value AC3 out does not work yet. Need to find out how to turn off interpolators.*/
645 /* Tested by James@superbug.co.uk 3rd July 2005 */ 645 /* Tested by James@superbug.co.uk 3rd July 2005 */
646 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102, 646 {.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
@@ -890,21 +890,21 @@ static emu_chip_details_t emu_chip_details[] = {
890 { } /* terminator */ 890 { } /* terminator */
891}; 891};
892 892
893int __devinit snd_emu10k1_create(snd_card_t * card, 893int __devinit snd_emu10k1_create(struct snd_card *card,
894 struct pci_dev * pci, 894 struct pci_dev * pci,
895 unsigned short extin_mask, 895 unsigned short extin_mask,
896 unsigned short extout_mask, 896 unsigned short extout_mask,
897 long max_cache_bytes, 897 long max_cache_bytes,
898 int enable_ir, 898 int enable_ir,
899 uint subsystem, 899 uint subsystem,
900 emu10k1_t ** remu) 900 struct snd_emu10k1 ** remu)
901{ 901{
902 emu10k1_t *emu; 902 struct snd_emu10k1 *emu;
903 int err; 903 int err;
904 int is_audigy; 904 int is_audigy;
905 unsigned char revision; 905 unsigned char revision;
906 const emu_chip_details_t *c; 906 const struct snd_emu_chip_details *c;
907 static snd_device_ops_t ops = { 907 static struct snd_device_ops ops = {
908 .dev_free = snd_emu10k1_dev_free, 908 .dev_free = snd_emu10k1_dev_free,
909 }; 909 };
910 910
@@ -1041,7 +1041,8 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
1041 snd_emu10k1_free(emu); 1041 snd_emu10k1_free(emu);
1042 return -ENOMEM; 1042 return -ENOMEM;
1043 } 1043 }
1044 emu->memhdr->block_extra_size = sizeof(emu10k1_memblk_t) - sizeof(snd_util_memblk_t); 1044 emu->memhdr->block_extra_size = sizeof(struct snd_emu10k1_memblk) -
1045 sizeof(struct snd_util_memblk);
1045 1046
1046 pci_set_master(pci); 1047 pci_set_master(pci);
1047 1048
diff --git a/sound/pci/emu10k1/emu10k1_patch.c b/sound/pci/emu10k1/emu10k1_patch.c
index 4df668eb32b4..42bae6f7e9a4 100644
--- a/sound/pci/emu10k1/emu10k1_patch.c
+++ b/sound/pci/emu10k1/emu10k1_patch.c
@@ -35,14 +35,15 @@
35 * allocate a sample block and copy data from userspace 35 * allocate a sample block and copy data from userspace
36 */ 36 */
37int 37int
38snd_emu10k1_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp, 38snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
39 snd_util_memhdr_t *hdr, const void __user *data, long count) 39 struct snd_util_memhdr *hdr,
40 const void __user *data, long count)
40{ 41{
41 int offset; 42 int offset;
42 int truesize, size, loopsize, blocksize; 43 int truesize, size, loopsize, blocksize;
43 int loopend, sampleend; 44 int loopend, sampleend;
44 unsigned int start_addr; 45 unsigned int start_addr;
45 emu10k1_t *emu; 46 struct snd_emu10k1 *emu;
46 47
47 emu = rec->hw; 48 emu = rec->hw;
48 snd_assert(sp != NULL, return -EINVAL); 49 snd_assert(sp != NULL, return -EINVAL);
@@ -205,10 +206,10 @@ snd_emu10k1_sample_new(snd_emux_t *rec, snd_sf_sample_t *sp,
205 * free a sample block 206 * free a sample block
206 */ 207 */
207int 208int
208snd_emu10k1_sample_free(snd_emux_t *rec, snd_sf_sample_t *sp, 209snd_emu10k1_sample_free(struct snd_emux *rec, struct snd_sf_sample *sp,
209 snd_util_memhdr_t *hdr) 210 struct snd_util_memhdr *hdr)
210{ 211{
211 emu10k1_t *emu; 212 struct snd_emu10k1 *emu;
212 213
213 emu = rec->hw; 214 emu = rec->hw;
214 snd_assert(sp != NULL, return -EINVAL); 215 snd_assert(sp != NULL, return -EINVAL);
diff --git a/sound/pci/emu10k1/emu10k1_synth.c b/sound/pci/emu10k1/emu10k1_synth.c
index 8bd58d1dcc26..1fa393f22a99 100644
--- a/sound/pci/emu10k1/emu10k1_synth.c
+++ b/sound/pci/emu10k1/emu10k1_synth.c
@@ -28,11 +28,11 @@ MODULE_LICENSE("GPL");
28/* 28/*
29 * create a new hardware dependent device for Emu10k1 29 * create a new hardware dependent device for Emu10k1
30 */ 30 */
31static int snd_emu10k1_synth_new_device(snd_seq_device_t *dev) 31static int snd_emu10k1_synth_new_device(struct snd_seq_device *dev)
32{ 32{
33 snd_emux_t *emu; 33 struct snd_emux *emu;
34 emu10k1_t *hw; 34 struct snd_emu10k1 *hw;
35 snd_emu10k1_synth_arg_t *arg; 35 struct snd_emu10k1_synth_arg *arg;
36 unsigned long flags; 36 unsigned long flags;
37 37
38 arg = SNDRV_SEQ_DEVICE_ARGPTR(dev); 38 arg = SNDRV_SEQ_DEVICE_ARGPTR(dev);
@@ -76,10 +76,10 @@ static int snd_emu10k1_synth_new_device(snd_seq_device_t *dev)
76 return 0; 76 return 0;
77} 77}
78 78
79static int snd_emu10k1_synth_delete_device(snd_seq_device_t *dev) 79static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
80{ 80{
81 snd_emux_t *emu; 81 struct snd_emux *emu;
82 emu10k1_t *hw; 82 struct snd_emu10k1 *hw;
83 unsigned long flags; 83 unsigned long flags;
84 84
85 if (dev->driver_data == NULL) 85 if (dev->driver_data == NULL)
@@ -104,11 +104,12 @@ static int snd_emu10k1_synth_delete_device(snd_seq_device_t *dev)
104static int __init alsa_emu10k1_synth_init(void) 104static int __init alsa_emu10k1_synth_init(void)
105{ 105{
106 106
107 static snd_seq_dev_ops_t ops = { 107 static struct snd_seq_dev_ops ops = {
108 snd_emu10k1_synth_new_device, 108 snd_emu10k1_synth_new_device,
109 snd_emu10k1_synth_delete_device, 109 snd_emu10k1_synth_delete_device,
110 }; 110 };
111 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops, sizeof(snd_emu10k1_synth_arg_t)); 111 return snd_seq_device_register_driver(SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH, &ops,
112 sizeof(struct snd_emu10k1_synth_arg));
112} 113}
113 114
114static void __exit alsa_emu10k1_synth_exit(void) 115static void __exit alsa_emu10k1_synth_exit(void)
diff --git a/sound/pci/emu10k1/emu10k1_synth_local.h b/sound/pci/emu10k1/emu10k1_synth_local.h
index 7f50b01ddb76..308ddc84bb4d 100644
--- a/sound/pci/emu10k1/emu10k1_synth_local.h
+++ b/sound/pci/emu10k1/emu10k1_synth_local.h
@@ -26,13 +26,18 @@
26#include <sound/emu10k1_synth.h> 26#include <sound/emu10k1_synth.h>
27 27
28/* emu10k1_patch.c */ 28/* emu10k1_patch.c */
29int snd_emu10k1_sample_new(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *_data, long count); 29int snd_emu10k1_sample_new(struct snd_emux *private_data,
30int snd_emu10k1_sample_free(snd_emux_t *private_data, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr); 30 struct snd_sf_sample *sp,
31int snd_emu10k1_memhdr_init(snd_emux_t *emu); 31 struct snd_util_memhdr *hdr,
32 const void __user *_data, long count);
33int snd_emu10k1_sample_free(struct snd_emux *private_data,
34 struct snd_sf_sample *sp,
35 struct snd_util_memhdr *hdr);
36int snd_emu10k1_memhdr_init(struct snd_emux *emu);
32 37
33/* emu10k1_callback.c */ 38/* emu10k1_callback.c */
34void snd_emu10k1_ops_setup(snd_emux_t *emu); 39void snd_emu10k1_ops_setup(struct snd_emux *emu);
35int snd_emu10k1_synth_get_voice(emu10k1_t *hw); 40int snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw);
36 41
37 42
38#endif /* __EMU10K1_SYNTH_LOCAL_H */ 43#endif /* __EMU10K1_SYNTH_LOCAL_H */
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 03e8c1678952..f4452c5cb4cd 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -309,9 +309,10 @@ static inline void snd_leave_user(mm_segment_t fs)
309 * controls 309 * controls
310 */ 310 */
311 311
312static int snd_emu10k1_gpr_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 312static int snd_emu10k1_gpr_ctl_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
313{ 313{
314 snd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t *)kcontrol->private_value; 314 struct snd_emu10k1_fx8010_ctl *ctl =
315 (struct snd_emu10k1_fx8010_ctl *) kcontrol->private_value;
315 316
316 if (ctl->min == 0 && ctl->max == 1) 317 if (ctl->min == 0 && ctl->max == 1)
317 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 318 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
@@ -323,10 +324,11 @@ static int snd_emu10k1_gpr_ctl_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_
323 return 0; 324 return 0;
324} 325}
325 326
326static int snd_emu10k1_gpr_ctl_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 327static int snd_emu10k1_gpr_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
327{ 328{
328 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 329 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
329 snd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t *)kcontrol->private_value; 330 struct snd_emu10k1_fx8010_ctl *ctl =
331 (struct snd_emu10k1_fx8010_ctl *) kcontrol->private_value;
330 unsigned long flags; 332 unsigned long flags;
331 unsigned int i; 333 unsigned int i;
332 334
@@ -337,10 +339,11 @@ static int snd_emu10k1_gpr_ctl_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
337 return 0; 339 return 0;
338} 340}
339 341
340static int snd_emu10k1_gpr_ctl_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 342static int snd_emu10k1_gpr_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
341{ 343{
342 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 344 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
343 snd_emu10k1_fx8010_ctl_t *ctl = (snd_emu10k1_fx8010_ctl_t *)kcontrol->private_value; 345 struct snd_emu10k1_fx8010_ctl *ctl =
346 (struct snd_emu10k1_fx8010_ctl *) kcontrol->private_value;
344 unsigned long flags; 347 unsigned long flags;
345 unsigned int nval, val; 348 unsigned int nval, val;
346 unsigned int i, j; 349 unsigned int i, j;
@@ -393,9 +396,9 @@ static int snd_emu10k1_gpr_ctl_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value
393 * Interrupt handler 396 * Interrupt handler
394 */ 397 */
395 398
396static void snd_emu10k1_fx8010_interrupt(emu10k1_t *emu) 399static void snd_emu10k1_fx8010_interrupt(struct snd_emu10k1 *emu)
397{ 400{
398 snd_emu10k1_fx8010_irq_t *irq, *nirq; 401 struct snd_emu10k1_fx8010_irq *irq, *nirq;
399 402
400 irq = emu->fx8010.irq_handlers; 403 irq = emu->fx8010.irq_handlers;
401 while (irq) { 404 while (irq) {
@@ -409,13 +412,13 @@ static void snd_emu10k1_fx8010_interrupt(emu10k1_t *emu)
409 } 412 }
410} 413}
411 414
412int snd_emu10k1_fx8010_register_irq_handler(emu10k1_t *emu, 415int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
413 snd_fx8010_irq_handler_t *handler, 416 snd_fx8010_irq_handler_t *handler,
414 unsigned char gpr_running, 417 unsigned char gpr_running,
415 void *private_data, 418 void *private_data,
416 snd_emu10k1_fx8010_irq_t **r_irq) 419 struct snd_emu10k1_fx8010_irq **r_irq)
417{ 420{
418 snd_emu10k1_fx8010_irq_t *irq; 421 struct snd_emu10k1_fx8010_irq *irq;
419 unsigned long flags; 422 unsigned long flags;
420 423
421 irq = kmalloc(sizeof(*irq), GFP_ATOMIC); 424 irq = kmalloc(sizeof(*irq), GFP_ATOMIC);
@@ -440,10 +443,10 @@ int snd_emu10k1_fx8010_register_irq_handler(emu10k1_t *emu,
440 return 0; 443 return 0;
441} 444}
442 445
443int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu, 446int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
444 snd_emu10k1_fx8010_irq_t *irq) 447 struct snd_emu10k1_fx8010_irq *irq)
445{ 448{
446 snd_emu10k1_fx8010_irq_t *tmp; 449 struct snd_emu10k1_fx8010_irq *tmp;
447 unsigned long flags; 450 unsigned long flags;
448 451
449 spin_lock_irqsave(&emu->fx8010.irq_lock, flags); 452 spin_lock_irqsave(&emu->fx8010.irq_lock, flags);
@@ -468,7 +471,8 @@ int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu,
468 * EMU10K1 effect manager 471 * EMU10K1 effect manager
469 *************************************************************************/ 472 *************************************************************************/
470 473
471static void snd_emu10k1_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr, 474static void snd_emu10k1_write_op(struct snd_emu10k1_fx8010_code *icode,
475 unsigned int *ptr,
472 u32 op, u32 r, u32 a, u32 x, u32 y) 476 u32 op, u32 r, u32 a, u32 x, u32 y)
473{ 477{
474 u_int32_t *code; 478 u_int32_t *code;
@@ -483,7 +487,8 @@ static void snd_emu10k1_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr
483#define OP(icode, ptr, op, r, a, x, y) \ 487#define OP(icode, ptr, op, r, a, x, y) \
484 snd_emu10k1_write_op(icode, ptr, op, r, a, x, y) 488 snd_emu10k1_write_op(icode, ptr, op, r, a, x, y)
485 489
486static void snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned int *ptr, 490static void snd_emu10k1_audigy_write_op(struct snd_emu10k1_fx8010_code *icode,
491 unsigned int *ptr,
487 u32 op, u32 r, u32 a, u32 x, u32 y) 492 u32 op, u32 r, u32 a, u32 x, u32 y)
488{ 493{
489 u_int32_t *code; 494 u_int32_t *code;
@@ -498,19 +503,20 @@ static void snd_emu10k1_audigy_write_op(emu10k1_fx8010_code_t *icode, unsigned i
498#define A_OP(icode, ptr, op, r, a, x, y) \ 503#define A_OP(icode, ptr, op, r, a, x, y) \
499 snd_emu10k1_audigy_write_op(icode, ptr, op, r, a, x, y) 504 snd_emu10k1_audigy_write_op(icode, ptr, op, r, a, x, y)
500 505
501static void snd_emu10k1_efx_write(emu10k1_t *emu, unsigned int pc, unsigned int data) 506static void snd_emu10k1_efx_write(struct snd_emu10k1 *emu, unsigned int pc, unsigned int data)
502{ 507{
503 pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE; 508 pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
504 snd_emu10k1_ptr_write(emu, pc, 0, data); 509 snd_emu10k1_ptr_write(emu, pc, 0, data);
505} 510}
506 511
507unsigned int snd_emu10k1_efx_read(emu10k1_t *emu, unsigned int pc) 512unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc)
508{ 513{
509 pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE; 514 pc += emu->audigy ? A_MICROCODEBASE : MICROCODEBASE;
510 return snd_emu10k1_ptr_read(emu, pc, 0); 515 return snd_emu10k1_ptr_read(emu, pc, 0);
511} 516}
512 517
513static int snd_emu10k1_gpr_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 518static int snd_emu10k1_gpr_poke(struct snd_emu10k1 *emu,
519 struct snd_emu10k1_fx8010_code *icode)
514{ 520{
515 int gpr; 521 int gpr;
516 u32 val; 522 u32 val;
@@ -525,7 +531,8 @@ static int snd_emu10k1_gpr_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
525 return 0; 531 return 0;
526} 532}
527 533
528static int snd_emu10k1_gpr_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 534static int snd_emu10k1_gpr_peek(struct snd_emu10k1 *emu,
535 struct snd_emu10k1_fx8010_code *icode)
529{ 536{
530 int gpr; 537 int gpr;
531 u32 val; 538 u32 val;
@@ -539,7 +546,8 @@ static int snd_emu10k1_gpr_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
539 return 0; 546 return 0;
540} 547}
541 548
542static int snd_emu10k1_tram_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 549static int snd_emu10k1_tram_poke(struct snd_emu10k1 *emu,
550 struct snd_emu10k1_fx8010_code *icode)
543{ 551{
544 int tram; 552 int tram;
545 u32 addr, val; 553 u32 addr, val;
@@ -561,7 +569,8 @@ static int snd_emu10k1_tram_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
561 return 0; 569 return 0;
562} 570}
563 571
564static int snd_emu10k1_tram_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 572static int snd_emu10k1_tram_peek(struct snd_emu10k1 *emu,
573 struct snd_emu10k1_fx8010_code *icode)
565{ 574{
566 int tram; 575 int tram;
567 u32 val, addr; 576 u32 val, addr;
@@ -583,7 +592,8 @@ static int snd_emu10k1_tram_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
583 return 0; 592 return 0;
584} 593}
585 594
586static int snd_emu10k1_code_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 595static int snd_emu10k1_code_poke(struct snd_emu10k1 *emu,
596 struct snd_emu10k1_fx8010_code *icode)
587{ 597{
588 u32 pc, lo, hi; 598 u32 pc, lo, hi;
589 599
@@ -599,7 +609,8 @@ static int snd_emu10k1_code_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
599 return 0; 609 return 0;
600} 610}
601 611
602static int snd_emu10k1_code_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 612static int snd_emu10k1_code_peek(struct snd_emu10k1 *emu,
613 struct snd_emu10k1_fx8010_code *icode)
603{ 614{
604 u32 pc; 615 u32 pc;
605 616
@@ -614,10 +625,11 @@ static int snd_emu10k1_code_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
614 return 0; 625 return 0;
615} 626}
616 627
617static snd_emu10k1_fx8010_ctl_t *snd_emu10k1_look_for_ctl(emu10k1_t *emu, snd_ctl_elem_id_t *id) 628static struct snd_emu10k1_fx8010_ctl *
629snd_emu10k1_look_for_ctl(struct snd_emu10k1 *emu, struct snd_ctl_elem_id *id)
618{ 630{
619 snd_emu10k1_fx8010_ctl_t *ctl; 631 struct snd_emu10k1_fx8010_ctl *ctl;
620 snd_kcontrol_t *kcontrol; 632 struct snd_kcontrol *kcontrol;
621 struct list_head *list; 633 struct list_head *list;
622 634
623 list_for_each(list, &emu->fx8010.gpr_ctl) { 635 list_for_each(list, &emu->fx8010.gpr_ctl) {
@@ -631,13 +643,14 @@ static snd_emu10k1_fx8010_ctl_t *snd_emu10k1_look_for_ctl(emu10k1_t *emu, snd_ct
631 return NULL; 643 return NULL;
632} 644}
633 645
634static int snd_emu10k1_verify_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 646static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
647 struct snd_emu10k1_fx8010_code *icode)
635{ 648{
636 unsigned int i; 649 unsigned int i;
637 snd_ctl_elem_id_t __user *_id; 650 struct snd_ctl_elem_id __user *_id;
638 snd_ctl_elem_id_t id; 651 struct snd_ctl_elem_id id;
639 emu10k1_fx8010_control_gpr_t __user *_gctl; 652 struct snd_emu10k1_fx8010_control_gpr __user *_gctl;
640 emu10k1_fx8010_control_gpr_t *gctl; 653 struct snd_emu10k1_fx8010_control_gpr *gctl;
641 int err; 654 int err;
642 655
643 for (i = 0, _id = icode->gpr_del_controls; 656 for (i = 0, _id = icode->gpr_del_controls;
@@ -685,28 +698,29 @@ static int snd_emu10k1_verify_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *ic
685 return err; 698 return err;
686} 699}
687 700
688static void snd_emu10k1_ctl_private_free(snd_kcontrol_t *kctl) 701static void snd_emu10k1_ctl_private_free(struct snd_kcontrol *kctl)
689{ 702{
690 snd_emu10k1_fx8010_ctl_t *ctl; 703 struct snd_emu10k1_fx8010_ctl *ctl;
691 704
692 ctl = (snd_emu10k1_fx8010_ctl_t *)kctl->private_value; 705 ctl = (struct snd_emu10k1_fx8010_ctl *) kctl->private_value;
693 kctl->private_value = 0; 706 kctl->private_value = 0;
694 list_del(&ctl->list); 707 list_del(&ctl->list);
695 kfree(ctl); 708 kfree(ctl);
696} 709}
697 710
698static int snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 711static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,
712 struct snd_emu10k1_fx8010_code *icode)
699{ 713{
700 unsigned int i, j; 714 unsigned int i, j;
701 emu10k1_fx8010_control_gpr_t __user *_gctl; 715 struct snd_emu10k1_fx8010_control_gpr __user *_gctl;
702 emu10k1_fx8010_control_gpr_t *gctl; 716 struct snd_emu10k1_fx8010_control_gpr *gctl;
703 snd_emu10k1_fx8010_ctl_t *ctl, *nctl; 717 struct snd_emu10k1_fx8010_ctl *ctl, *nctl;
704 snd_kcontrol_new_t knew; 718 struct snd_kcontrol_new knew;
705 snd_kcontrol_t *kctl; 719 struct snd_kcontrol *kctl;
706 snd_ctl_elem_value_t *val; 720 struct snd_ctl_elem_value *val;
707 int err = 0; 721 int err = 0;
708 722
709 val = (snd_ctl_elem_value_t *)kmalloc(sizeof(*val), GFP_KERNEL); 723 val = kmalloc(sizeof(*val), GFP_KERNEL);
710 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); 724 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
711 nctl = kmalloc(sizeof(*nctl), GFP_KERNEL); 725 nctl = kmalloc(sizeof(*nctl), GFP_KERNEL);
712 if (!val || !gctl || !nctl) { 726 if (!val || !gctl || !nctl) {
@@ -751,7 +765,7 @@ static int snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode
751 nctl->max = gctl->max; 765 nctl->max = gctl->max;
752 nctl->translation = gctl->translation; 766 nctl->translation = gctl->translation;
753 if (ctl == NULL) { 767 if (ctl == NULL) {
754 ctl = (snd_emu10k1_fx8010_ctl_t *)kmalloc(sizeof(*ctl), GFP_KERNEL); 768 ctl = kmalloc(sizeof(*ctl), GFP_KERNEL);
755 if (ctl == NULL) { 769 if (ctl == NULL) {
756 err = -ENOMEM; 770 err = -ENOMEM;
757 goto __error; 771 goto __error;
@@ -782,13 +796,14 @@ static int snd_emu10k1_add_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode
782 return err; 796 return err;
783} 797}
784 798
785static int snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 799static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu,
800 struct snd_emu10k1_fx8010_code *icode)
786{ 801{
787 unsigned int i; 802 unsigned int i;
788 snd_ctl_elem_id_t id; 803 struct snd_ctl_elem_id id;
789 snd_ctl_elem_id_t __user *_id; 804 struct snd_ctl_elem_id __user *_id;
790 snd_emu10k1_fx8010_ctl_t *ctl; 805 struct snd_emu10k1_fx8010_ctl *ctl;
791 snd_card_t *card = emu->card; 806 struct snd_card *card = emu->card;
792 807
793 for (i = 0, _id = icode->gpr_del_controls; 808 for (i = 0, _id = icode->gpr_del_controls;
794 i < icode->gpr_del_control_count; i++, _id++) { 809 i < icode->gpr_del_control_count; i++, _id++) {
@@ -803,14 +818,15 @@ static int snd_emu10k1_del_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode
803 return 0; 818 return 0;
804} 819}
805 820
806static int snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 821static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu,
822 struct snd_emu10k1_fx8010_code *icode)
807{ 823{
808 unsigned int i = 0, j; 824 unsigned int i = 0, j;
809 unsigned int total = 0; 825 unsigned int total = 0;
810 emu10k1_fx8010_control_gpr_t *gctl; 826 struct snd_emu10k1_fx8010_control_gpr *gctl;
811 emu10k1_fx8010_control_gpr_t __user *_gctl; 827 struct snd_emu10k1_fx8010_control_gpr __user *_gctl;
812 snd_emu10k1_fx8010_ctl_t *ctl; 828 struct snd_emu10k1_fx8010_ctl *ctl;
813 snd_ctl_elem_id_t *id; 829 struct snd_ctl_elem_id *id;
814 struct list_head *list; 830 struct list_head *list;
815 831
816 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL); 832 gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
@@ -851,7 +867,8 @@ static int snd_emu10k1_list_controls(emu10k1_t *emu, emu10k1_fx8010_code_t *icod
851 return 0; 867 return 0;
852} 868}
853 869
854static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 870static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu,
871 struct snd_emu10k1_fx8010_code *icode)
855{ 872{
856 int err = 0; 873 int err = 0;
857 874
@@ -882,7 +899,8 @@ static int snd_emu10k1_icode_poke(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
882 return err; 899 return err;
883} 900}
884 901
885static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode) 902static int snd_emu10k1_icode_peek(struct snd_emu10k1 *emu,
903 struct snd_emu10k1_fx8010_code *icode)
886{ 904{
887 int err; 905 int err;
888 906
@@ -900,11 +918,12 @@ static int snd_emu10k1_icode_peek(emu10k1_t *emu, emu10k1_fx8010_code_t *icode)
900 return err; 918 return err;
901} 919}
902 920
903static int snd_emu10k1_ipcm_poke(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm) 921static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,
922 struct snd_emu10k1_fx8010_pcm_rec *ipcm)
904{ 923{
905 unsigned int i; 924 unsigned int i;
906 int err = 0; 925 int err = 0;
907 snd_emu10k1_fx8010_pcm_t *pcm; 926 struct snd_emu10k1_fx8010_pcm *pcm;
908 927
909 if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT) 928 if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
910 return -EINVAL; 929 return -EINVAL;
@@ -945,11 +964,12 @@ static int snd_emu10k1_ipcm_poke(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm)
945 return err; 964 return err;
946} 965}
947 966
948static int snd_emu10k1_ipcm_peek(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm) 967static int snd_emu10k1_ipcm_peek(struct snd_emu10k1 *emu,
968 struct snd_emu10k1_fx8010_pcm_rec *ipcm)
949{ 969{
950 unsigned int i; 970 unsigned int i;
951 int err = 0; 971 int err = 0;
952 snd_emu10k1_fx8010_pcm_t *pcm; 972 struct snd_emu10k1_fx8010_pcm *pcm;
953 973
954 if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT) 974 if (ipcm->substream >= EMU10K1_FX8010_PCM_COUNT)
955 return -EINVAL; 975 return -EINVAL;
@@ -979,7 +999,9 @@ static int snd_emu10k1_ipcm_peek(emu10k1_t *emu, emu10k1_fx8010_pcm_t *ipcm)
979#define SND_EMU10K1_PLAYBACK_CHANNELS 8 999#define SND_EMU10K1_PLAYBACK_CHANNELS 8
980#define SND_EMU10K1_CAPTURE_CHANNELS 4 1000#define SND_EMU10K1_CAPTURE_CHANNELS 4
981 1001
982static void __devinit snd_emu10k1_init_mono_control(emu10k1_fx8010_control_gpr_t *ctl, const char *name, int gpr, int defval) 1002static void __devinit
1003snd_emu10k1_init_mono_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
1004 const char *name, int gpr, int defval)
983{ 1005{
984 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1006 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
985 strcpy(ctl->id.name, name); 1007 strcpy(ctl->id.name, name);
@@ -990,7 +1012,9 @@ static void __devinit snd_emu10k1_init_mono_control(emu10k1_fx8010_control_gpr_t
990 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1012 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
991} 1013}
992 1014
993static void __devinit snd_emu10k1_init_stereo_control(emu10k1_fx8010_control_gpr_t *ctl, const char *name, int gpr, int defval) 1015static void __devinit
1016snd_emu10k1_init_stereo_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
1017 const char *name, int gpr, int defval)
994{ 1018{
995 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1019 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
996 strcpy(ctl->id.name, name); 1020 strcpy(ctl->id.name, name);
@@ -1002,7 +1026,9 @@ static void __devinit snd_emu10k1_init_stereo_control(emu10k1_fx8010_control_gpr
1002 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100; 1026 ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
1003} 1027}
1004 1028
1005static void __devinit snd_emu10k1_init_mono_onoff_control(emu10k1_fx8010_control_gpr_t *ctl, const char *name, int gpr, int defval) 1029static void __devinit
1030snd_emu10k1_init_mono_onoff_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
1031 const char *name, int gpr, int defval)
1006{ 1032{
1007 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1033 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
1008 strcpy(ctl->id.name, name); 1034 strcpy(ctl->id.name, name);
@@ -1013,7 +1039,9 @@ static void __devinit snd_emu10k1_init_mono_onoff_control(emu10k1_fx8010_control
1013 ctl->translation = EMU10K1_GPR_TRANSLATION_ONOFF; 1039 ctl->translation = EMU10K1_GPR_TRANSLATION_ONOFF;
1014} 1040}
1015 1041
1016static void __devinit snd_emu10k1_init_stereo_onoff_control(emu10k1_fx8010_control_gpr_t *ctl, const char *name, int gpr, int defval) 1042static void __devinit
1043snd_emu10k1_init_stereo_onoff_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
1044 const char *name, int gpr, int defval)
1017{ 1045{
1018 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1046 ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
1019 strcpy(ctl->id.name, name); 1047 strcpy(ctl->id.name, name);
@@ -1030,7 +1058,7 @@ static void __devinit snd_emu10k1_init_stereo_onoff_control(emu10k1_fx8010_contr
1030 * initial DSP configuration for Audigy 1058 * initial DSP configuration for Audigy
1031 */ 1059 */
1032 1060
1033static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu) 1061static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
1034{ 1062{
1035 int err, i, z, gpr, nctl; 1063 int err, i, z, gpr, nctl;
1036 const int playback = 10; 1064 const int playback = 10;
@@ -1038,8 +1066,8 @@ static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
1038 const int stereo_mix = capture + 2; 1066 const int stereo_mix = capture + 2;
1039 const int tmp = 0x88; 1067 const int tmp = 0x88;
1040 u32 ptr; 1068 u32 ptr;
1041 emu10k1_fx8010_code_t *icode = NULL; 1069 struct snd_emu10k1_fx8010_code *icode = NULL;
1042 emu10k1_fx8010_control_gpr_t *controls = NULL, *ctl; 1070 struct snd_emu10k1_fx8010_control_gpr *controls = NULL, *ctl;
1043 u32 *gpr_map; 1071 u32 *gpr_map;
1044 mm_segment_t seg; 1072 mm_segment_t seg;
1045 1073
@@ -1047,8 +1075,11 @@ static int __devinit _snd_emu10k1_audigy_init_efx(emu10k1_t *emu)
1047 INIT_LIST_HEAD(&emu->fx8010.gpr_ctl); 1075 INIT_LIST_HEAD(&emu->fx8010.gpr_ctl);
1048 1076
1049 if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL || 1077 if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL ||
1050 (icode->gpr_map = (u_int32_t __user *)kcalloc(512 + 256 + 256 + 2 * 1024, sizeof(u_int32_t), GFP_KERNEL)) == NULL || 1078 (icode->gpr_map = (u_int32_t __user *)
1051 (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(*controls), GFP_KERNEL)) == NULL) { 1079 kcalloc(512 + 256 + 256 + 2 * 1024, sizeof(u_int32_t),
1080 GFP_KERNEL)) == NULL ||
1081 (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,
1082 sizeof(*controls), GFP_KERNEL)) == NULL) {
1052 err = -ENOMEM; 1083 err = -ENOMEM;
1053 goto __err; 1084 goto __err;
1054 } 1085 }
@@ -1434,7 +1465,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1434 1465
1435 seg = snd_enter_user(); 1466 seg = snd_enter_user();
1436 icode->gpr_add_control_count = nctl; 1467 icode->gpr_add_control_count = nctl;
1437 icode->gpr_add_controls = (emu10k1_fx8010_control_gpr_t __user *)controls; 1468 icode->gpr_add_controls = (struct snd_emu10k1_fx8010_control_gpr __user *)controls;
1438 err = snd_emu10k1_icode_poke(emu, icode); 1469 err = snd_emu10k1_icode_poke(emu, icode);
1439 snd_leave_user(seg); 1470 snd_leave_user(seg);
1440 1471
@@ -1454,14 +1485,14 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
1454 1485
1455/* when volume = max, then copy only to avoid volume modification */ 1486/* when volume = max, then copy only to avoid volume modification */
1456/* with iMAC0 (negative values) */ 1487/* with iMAC0 (negative values) */
1457static void __devinit _volume(emu10k1_fx8010_code_t *icode, u32 *ptr, u32 dst, u32 src, u32 vol) 1488static void __devinit _volume(struct snd_emu10k1_fx8010_code *icode, u32 *ptr, u32 dst, u32 src, u32 vol)
1458{ 1489{
1459 OP(icode, ptr, iMAC0, dst, C_00000000, src, vol); 1490 OP(icode, ptr, iMAC0, dst, C_00000000, src, vol);
1460 OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff); 1491 OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff);
1461 OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000001); 1492 OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000001);
1462 OP(icode, ptr, iACC3, dst, src, C_00000000, C_00000000); 1493 OP(icode, ptr, iACC3, dst, src, C_00000000, C_00000000);
1463} 1494}
1464static void __devinit _volume_add(emu10k1_fx8010_code_t *icode, u32 *ptr, u32 dst, u32 src, u32 vol) 1495static void __devinit _volume_add(struct snd_emu10k1_fx8010_code *icode, u32 *ptr, u32 dst, u32 src, u32 vol)
1465{ 1496{
1466 OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff); 1497 OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff);
1467 OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002); 1498 OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002);
@@ -1469,7 +1500,7 @@ static void __devinit _volume_add(emu10k1_fx8010_code_t *icode, u32 *ptr, u32 ds
1469 OP(icode, ptr, iSKIP, C_00000000, C_7fffffff, C_7fffffff, C_00000001); 1500 OP(icode, ptr, iSKIP, C_00000000, C_7fffffff, C_7fffffff, C_00000001);
1470 OP(icode, ptr, iMAC0, dst, dst, src, vol); 1501 OP(icode, ptr, iMAC0, dst, dst, src, vol);
1471} 1502}
1472static void __devinit _volume_out(emu10k1_fx8010_code_t *icode, u32 *ptr, u32 dst, u32 src, u32 vol) 1503static void __devinit _volume_out(struct snd_emu10k1_fx8010_code *icode, u32 *ptr, u32 dst, u32 src, u32 vol)
1473{ 1504{
1474 OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff); 1505 OP(icode, ptr, iANDXOR, C_00000000, vol, C_ffffffff, C_7fffffff);
1475 OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002); 1506 OP(icode, ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002);
@@ -1500,13 +1531,13 @@ static void __devinit _volume_out(emu10k1_fx8010_code_t *icode, u32 *ptr, u32 ds
1500 _SWITCH_NEG(icode, ptr, GPR(dst), GPR(src)) 1531 _SWITCH_NEG(icode, ptr, GPR(dst), GPR(src))
1501 1532
1502 1533
1503static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu) 1534static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
1504{ 1535{
1505 int err, i, z, gpr, tmp, playback, capture; 1536 int err, i, z, gpr, tmp, playback, capture;
1506 u32 ptr; 1537 u32 ptr;
1507 emu10k1_fx8010_code_t *icode; 1538 struct snd_emu10k1_fx8010_code *icode;
1508 emu10k1_fx8010_pcm_t *ipcm = NULL; 1539 struct snd_emu10k1_fx8010_pcm_rec *ipcm = NULL;
1509 emu10k1_fx8010_control_gpr_t *controls = NULL, *ctl; 1540 struct snd_emu10k1_fx8010_control_gpr *controls = NULL, *ctl;
1510 u32 *gpr_map; 1541 u32 *gpr_map;
1511 mm_segment_t seg; 1542 mm_segment_t seg;
1512 1543
@@ -1515,8 +1546,12 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
1515 1546
1516 if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL) 1547 if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL)
1517 return -ENOMEM; 1548 return -ENOMEM;
1518 if ((icode->gpr_map = (u_int32_t __user *)kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), GFP_KERNEL)) == NULL || 1549 if ((icode->gpr_map = (u_int32_t __user *)
1519 (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, sizeof(emu10k1_fx8010_control_gpr_t), GFP_KERNEL)) == NULL || 1550 kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t),
1551 GFP_KERNEL)) == NULL ||
1552 (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS,
1553 sizeof(struct snd_emu10k1_fx8010_control_gpr),
1554 GFP_KERNEL)) == NULL ||
1520 (ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL)) == NULL) { 1555 (ipcm = kzalloc(sizeof(*ipcm), GFP_KERNEL)) == NULL) {
1521 err = -ENOMEM; 1556 err = -ENOMEM;
1522 goto __err; 1557 goto __err;
@@ -2050,7 +2085,7 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
2050 goto __err; 2085 goto __err;
2051 seg = snd_enter_user(); 2086 seg = snd_enter_user();
2052 icode->gpr_add_control_count = i; 2087 icode->gpr_add_control_count = i;
2053 icode->gpr_add_controls = (emu10k1_fx8010_control_gpr_t __user *)controls; 2088 icode->gpr_add_controls = (struct snd_emu10k1_fx8010_control_gpr __user *)controls;
2054 err = snd_emu10k1_icode_poke(emu, icode); 2089 err = snd_emu10k1_icode_poke(emu, icode);
2055 snd_leave_user(seg); 2090 snd_leave_user(seg);
2056 if (err >= 0) 2091 if (err >= 0)
@@ -2065,7 +2100,7 @@ static int __devinit _snd_emu10k1_init_efx(emu10k1_t *emu)
2065 return err; 2100 return err;
2066} 2101}
2067 2102
2068int __devinit snd_emu10k1_init_efx(emu10k1_t *emu) 2103int __devinit snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
2069{ 2104{
2070 if (emu->audigy) 2105 if (emu->audigy)
2071 return _snd_emu10k1_audigy_init_efx(emu); 2106 return _snd_emu10k1_audigy_init_efx(emu);
@@ -2073,7 +2108,7 @@ int __devinit snd_emu10k1_init_efx(emu10k1_t *emu)
2073 return _snd_emu10k1_init_efx(emu); 2108 return _snd_emu10k1_init_efx(emu);
2074} 2109}
2075 2110
2076void snd_emu10k1_free_efx(emu10k1_t *emu) 2111void snd_emu10k1_free_efx(struct snd_emu10k1 *emu)
2077{ 2112{
2078 /* stop processor */ 2113 /* stop processor */
2079 if (emu->audigy) 2114 if (emu->audigy)
@@ -2083,7 +2118,7 @@ void snd_emu10k1_free_efx(emu10k1_t *emu)
2083} 2118}
2084 2119
2085#if 0 // FIXME: who use them? 2120#if 0 // FIXME: who use them?
2086int snd_emu10k1_fx8010_tone_control_activate(emu10k1_t *emu, int output) 2121int snd_emu10k1_fx8010_tone_control_activate(struct snd_emu10k1 *emu, int output)
2087{ 2122{
2088 if (output < 0 || output >= 6) 2123 if (output < 0 || output >= 6)
2089 return -EINVAL; 2124 return -EINVAL;
@@ -2091,7 +2126,7 @@ int snd_emu10k1_fx8010_tone_control_activate(emu10k1_t *emu, int output)
2091 return 0; 2126 return 0;
2092} 2127}
2093 2128
2094int snd_emu10k1_fx8010_tone_control_deactivate(emu10k1_t *emu, int output) 2129int snd_emu10k1_fx8010_tone_control_deactivate(struct snd_emu10k1 *emu, int output)
2095{ 2130{
2096 if (output < 0 || output >= 6) 2131 if (output < 0 || output >= 6)
2097 return -EINVAL; 2132 return -EINVAL;
@@ -2100,7 +2135,7 @@ int snd_emu10k1_fx8010_tone_control_deactivate(emu10k1_t *emu, int output)
2100} 2135}
2101#endif 2136#endif
2102 2137
2103int snd_emu10k1_fx8010_tram_setup(emu10k1_t *emu, u32 size) 2138int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size)
2104{ 2139{
2105 u8 size_reg = 0; 2140 u8 size_reg = 0;
2106 2141
@@ -2142,7 +2177,7 @@ int snd_emu10k1_fx8010_tram_setup(emu10k1_t *emu, u32 size)
2142 return 0; 2177 return 0;
2143} 2178}
2144 2179
2145static int snd_emu10k1_fx8010_open(snd_hwdep_t * hw, struct file *file) 2180static int snd_emu10k1_fx8010_open(struct snd_hwdep * hw, struct file *file)
2146{ 2181{
2147 return 0; 2182 return 0;
2148} 2183}
@@ -2155,7 +2190,8 @@ static void copy_string(char *dst, char *src, char *null, int idx)
2155 strcpy(dst, src); 2190 strcpy(dst, src);
2156} 2191}
2157 2192
2158static int snd_emu10k1_fx8010_info(emu10k1_t *emu, emu10k1_fx8010_info_t *info) 2193static int snd_emu10k1_fx8010_info(struct snd_emu10k1 *emu,
2194 struct snd_emu10k1_fx8010_info *info)
2159{ 2195{
2160 char **fxbus, **extin, **extout; 2196 char **fxbus, **extin, **extout;
2161 unsigned short fxbus_mask, extin_mask, extout_mask; 2197 unsigned short fxbus_mask, extin_mask, extout_mask;
@@ -2181,19 +2217,19 @@ static int snd_emu10k1_fx8010_info(emu10k1_t *emu, emu10k1_fx8010_info_t *info)
2181 return 0; 2217 return 0;
2182} 2218}
2183 2219
2184static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigned int cmd, unsigned long arg) 2220static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, unsigned int cmd, unsigned long arg)
2185{ 2221{
2186 emu10k1_t *emu = hw->private_data; 2222 struct snd_emu10k1 *emu = hw->private_data;
2187 emu10k1_fx8010_info_t *info; 2223 struct snd_emu10k1_fx8010_info *info;
2188 emu10k1_fx8010_code_t *icode; 2224 struct snd_emu10k1_fx8010_code *icode;
2189 emu10k1_fx8010_pcm_t *ipcm; 2225 struct snd_emu10k1_fx8010_pcm_rec *ipcm;
2190 unsigned int addr; 2226 unsigned int addr;
2191 void __user *argp = (void __user *)arg; 2227 void __user *argp = (void __user *)arg;
2192 int res; 2228 int res;
2193 2229
2194 switch (cmd) { 2230 switch (cmd) {
2195 case SNDRV_EMU10K1_IOCTL_INFO: 2231 case SNDRV_EMU10K1_IOCTL_INFO:
2196 info = (emu10k1_fx8010_info_t *)kmalloc(sizeof(*info), GFP_KERNEL); 2232 info = kmalloc(sizeof(*info), GFP_KERNEL);
2197 if (!info) 2233 if (!info)
2198 return -ENOMEM; 2234 return -ENOMEM;
2199 if ((res = snd_emu10k1_fx8010_info(emu, info)) < 0) { 2235 if ((res = snd_emu10k1_fx8010_info(emu, info)) < 0) {
@@ -2209,7 +2245,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
2209 case SNDRV_EMU10K1_IOCTL_CODE_POKE: 2245 case SNDRV_EMU10K1_IOCTL_CODE_POKE:
2210 if (!capable(CAP_SYS_ADMIN)) 2246 if (!capable(CAP_SYS_ADMIN))
2211 return -EPERM; 2247 return -EPERM;
2212 icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL); 2248 icode = kmalloc(sizeof(*icode), GFP_KERNEL);
2213 if (icode == NULL) 2249 if (icode == NULL)
2214 return -ENOMEM; 2250 return -ENOMEM;
2215 if (copy_from_user(icode, argp, sizeof(*icode))) { 2251 if (copy_from_user(icode, argp, sizeof(*icode))) {
@@ -2220,7 +2256,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
2220 kfree(icode); 2256 kfree(icode);
2221 return res; 2257 return res;
2222 case SNDRV_EMU10K1_IOCTL_CODE_PEEK: 2258 case SNDRV_EMU10K1_IOCTL_CODE_PEEK:
2223 icode = (emu10k1_fx8010_code_t *)kmalloc(sizeof(*icode), GFP_KERNEL); 2259 icode = kmalloc(sizeof(*icode), GFP_KERNEL);
2224 if (icode == NULL) 2260 if (icode == NULL)
2225 return -ENOMEM; 2261 return -ENOMEM;
2226 if (copy_from_user(icode, argp, sizeof(*icode))) { 2262 if (copy_from_user(icode, argp, sizeof(*icode))) {
@@ -2235,7 +2271,7 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
2235 kfree(icode); 2271 kfree(icode);
2236 return res; 2272 return res;
2237 case SNDRV_EMU10K1_IOCTL_PCM_POKE: 2273 case SNDRV_EMU10K1_IOCTL_PCM_POKE:
2238 ipcm = (emu10k1_fx8010_pcm_t *)kmalloc(sizeof(*ipcm), GFP_KERNEL); 2274 ipcm = kmalloc(sizeof(*ipcm), GFP_KERNEL);
2239 if (ipcm == NULL) 2275 if (ipcm == NULL)
2240 return -ENOMEM; 2276 return -ENOMEM;
2241 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) { 2277 if (copy_from_user(ipcm, argp, sizeof(*ipcm))) {
@@ -2327,14 +2363,14 @@ static int snd_emu10k1_fx8010_ioctl(snd_hwdep_t * hw, struct file *file, unsigne
2327 return -ENOTTY; 2363 return -ENOTTY;
2328} 2364}
2329 2365
2330static int snd_emu10k1_fx8010_release(snd_hwdep_t * hw, struct file *file) 2366static int snd_emu10k1_fx8010_release(struct snd_hwdep * hw, struct file *file)
2331{ 2367{
2332 return 0; 2368 return 0;
2333} 2369}
2334 2370
2335int __devinit snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep) 2371int __devinit snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct snd_hwdep ** rhwdep)
2336{ 2372{
2337 snd_hwdep_t *hw; 2373 struct snd_hwdep *hw;
2338 int err; 2374 int err;
2339 2375
2340 if (rhwdep) 2376 if (rhwdep)
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index 7cc831ccd0cb..98fb8139427b 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -35,17 +35,17 @@
35 35
36#define AC97_ID_STAC9758 0x83847658 36#define AC97_ID_STAC9758 0x83847658
37 37
38static int snd_emu10k1_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 38static int snd_emu10k1_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
39{ 39{
40 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958; 40 uinfo->type = SNDRV_CTL_ELEM_TYPE_IEC958;
41 uinfo->count = 1; 41 uinfo->count = 1;
42 return 0; 42 return 0;
43} 43}
44 44
45static int snd_emu10k1_spdif_get(snd_kcontrol_t * kcontrol, 45static int snd_emu10k1_spdif_get(struct snd_kcontrol *kcontrol,
46 snd_ctl_elem_value_t * ucontrol) 46 struct snd_ctl_elem_value *ucontrol)
47{ 47{
48 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 48 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
49 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 49 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
50 unsigned long flags; 50 unsigned long flags;
51 51
@@ -58,8 +58,8 @@ static int snd_emu10k1_spdif_get(snd_kcontrol_t * kcontrol,
58 return 0; 58 return 0;
59} 59}
60 60
61static int snd_emu10k1_spdif_get_mask(snd_kcontrol_t * kcontrol, 61static int snd_emu10k1_spdif_get_mask(struct snd_kcontrol *kcontrol,
62 snd_ctl_elem_value_t * ucontrol) 62 struct snd_ctl_elem_value *ucontrol)
63{ 63{
64 ucontrol->value.iec958.status[0] = 0xff; 64 ucontrol->value.iec958.status[0] = 0xff;
65 ucontrol->value.iec958.status[1] = 0xff; 65 ucontrol->value.iec958.status[1] = 0xff;
@@ -69,7 +69,7 @@ static int snd_emu10k1_spdif_get_mask(snd_kcontrol_t * kcontrol,
69} 69}
70 70
71#if 0 71#if 0
72static int snd_audigy_spdif_output_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 72static int snd_audigy_spdif_output_rate_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
73{ 73{
74 static char *texts[] = {"44100", "48000", "96000"}; 74 static char *texts[] = {"44100", "48000", "96000"};
75 75
@@ -82,10 +82,10 @@ static int snd_audigy_spdif_output_rate_info(snd_kcontrol_t *kcontrol, snd_ctl_e
82 return 0; 82 return 0;
83} 83}
84 84
85static int snd_audigy_spdif_output_rate_get(snd_kcontrol_t * kcontrol, 85static int snd_audigy_spdif_output_rate_get(struct snd_kcontrol *kcontrol,
86 snd_ctl_elem_value_t * ucontrol) 86 struct snd_ctl_elem_value *ucontrol)
87{ 87{
88 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 88 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
89 unsigned int tmp; 89 unsigned int tmp;
90 unsigned long flags; 90 unsigned long flags;
91 91
@@ -109,10 +109,10 @@ static int snd_audigy_spdif_output_rate_get(snd_kcontrol_t * kcontrol,
109 return 0; 109 return 0;
110} 110}
111 111
112static int snd_audigy_spdif_output_rate_put(snd_kcontrol_t * kcontrol, 112static int snd_audigy_spdif_output_rate_put(struct snd_kcontrol *kcontrol,
113 snd_ctl_elem_value_t * ucontrol) 113 struct snd_ctl_elem_value *ucontrol)
114{ 114{
115 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 115 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
116 int change; 116 int change;
117 unsigned int reg, val, tmp; 117 unsigned int reg, val, tmp;
118 unsigned long flags; 118 unsigned long flags;
@@ -143,7 +143,7 @@ static int snd_audigy_spdif_output_rate_put(snd_kcontrol_t * kcontrol,
143 return change; 143 return change;
144} 144}
145 145
146static snd_kcontrol_new_t snd_audigy_spdif_output_rate = 146static struct snd_kcontrol_new snd_audigy_spdif_output_rate =
147{ 147{
148 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, 148 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
149 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 149 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -155,10 +155,10 @@ static snd_kcontrol_new_t snd_audigy_spdif_output_rate =
155}; 155};
156#endif 156#endif
157 157
158static int snd_emu10k1_spdif_put(snd_kcontrol_t * kcontrol, 158static int snd_emu10k1_spdif_put(struct snd_kcontrol *kcontrol,
159 snd_ctl_elem_value_t * ucontrol) 159 struct snd_ctl_elem_value *ucontrol)
160{ 160{
161 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 161 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
162 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 162 unsigned int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
163 int change; 163 int change;
164 unsigned int val; 164 unsigned int val;
@@ -178,7 +178,7 @@ static int snd_emu10k1_spdif_put(snd_kcontrol_t * kcontrol,
178 return change; 178 return change;
179} 179}
180 180
181static snd_kcontrol_new_t snd_emu10k1_spdif_mask_control = 181static struct snd_kcontrol_new snd_emu10k1_spdif_mask_control =
182{ 182{
183 .access = SNDRV_CTL_ELEM_ACCESS_READ, 183 .access = SNDRV_CTL_ELEM_ACCESS_READ,
184 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 184 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -188,7 +188,7 @@ static snd_kcontrol_new_t snd_emu10k1_spdif_mask_control =
188 .get = snd_emu10k1_spdif_get_mask 188 .get = snd_emu10k1_spdif_get_mask
189}; 189};
190 190
191static snd_kcontrol_new_t snd_emu10k1_spdif_control = 191static struct snd_kcontrol_new snd_emu10k1_spdif_control =
192{ 192{
193 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 193 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
194 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT), 194 .name = SNDRV_CTL_NAME_IEC958("",PLAYBACK,DEFAULT),
@@ -199,7 +199,7 @@ static snd_kcontrol_new_t snd_emu10k1_spdif_control =
199}; 199};
200 200
201 201
202static void update_emu10k1_fxrt(emu10k1_t *emu, int voice, unsigned char *route) 202static void update_emu10k1_fxrt(struct snd_emu10k1 *emu, int voice, unsigned char *route)
203{ 203{
204 if (emu->audigy) { 204 if (emu->audigy) {
205 snd_emu10k1_ptr_write(emu, A_FXRT1, voice, 205 snd_emu10k1_ptr_write(emu, A_FXRT1, voice,
@@ -212,7 +212,7 @@ static void update_emu10k1_fxrt(emu10k1_t *emu, int voice, unsigned char *route)
212 } 212 }
213} 213}
214 214
215static void update_emu10k1_send_volume(emu10k1_t *emu, int voice, unsigned char *volume) 215static void update_emu10k1_send_volume(struct snd_emu10k1 *emu, int voice, unsigned char *volume)
216{ 216{
217 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_A, voice, volume[0]); 217 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_A, voice, volume[0]);
218 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_B, voice, volume[1]); 218 snd_emu10k1_ptr_write(emu, PTRX_FXSENDAMOUNT_B, voice, volume[1]);
@@ -229,9 +229,9 @@ static void update_emu10k1_send_volume(emu10k1_t *emu, int voice, unsigned char
229 229
230/* PCM stream controls */ 230/* PCM stream controls */
231 231
232static int snd_emu10k1_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 232static int snd_emu10k1_send_routing_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
233{ 233{
234 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 234 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
235 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 235 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
236 uinfo->count = emu->audigy ? 3*8 : 3*4; 236 uinfo->count = emu->audigy ? 3*8 : 3*4;
237 uinfo->value.integer.min = 0; 237 uinfo->value.integer.min = 0;
@@ -239,12 +239,13 @@ static int snd_emu10k1_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
239 return 0; 239 return 0;
240} 240}
241 241
242static int snd_emu10k1_send_routing_get(snd_kcontrol_t * kcontrol, 242static int snd_emu10k1_send_routing_get(struct snd_kcontrol *kcontrol,
243 snd_ctl_elem_value_t * ucontrol) 243 struct snd_ctl_elem_value *ucontrol)
244{ 244{
245 unsigned long flags; 245 unsigned long flags;
246 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 246 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
247 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 247 struct snd_emu10k1_pcm_mixer *mix =
248 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
248 int voice, idx; 249 int voice, idx;
249 int num_efx = emu->audigy ? 8 : 4; 250 int num_efx = emu->audigy ? 8 : 4;
250 int mask = emu->audigy ? 0x3f : 0x0f; 251 int mask = emu->audigy ? 0x3f : 0x0f;
@@ -258,12 +259,13 @@ static int snd_emu10k1_send_routing_get(snd_kcontrol_t * kcontrol,
258 return 0; 259 return 0;
259} 260}
260 261
261static int snd_emu10k1_send_routing_put(snd_kcontrol_t * kcontrol, 262static int snd_emu10k1_send_routing_put(struct snd_kcontrol *kcontrol,
262 snd_ctl_elem_value_t * ucontrol) 263 struct snd_ctl_elem_value *ucontrol)
263{ 264{
264 unsigned long flags; 265 unsigned long flags;
265 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 266 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
266 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 267 struct snd_emu10k1_pcm_mixer *mix =
268 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
267 int change = 0, voice, idx, val; 269 int change = 0, voice, idx, val;
268 int num_efx = emu->audigy ? 8 : 4; 270 int num_efx = emu->audigy ? 8 : 4;
269 int mask = emu->audigy ? 0x3f : 0x0f; 271 int mask = emu->audigy ? 0x3f : 0x0f;
@@ -292,7 +294,7 @@ static int snd_emu10k1_send_routing_put(snd_kcontrol_t * kcontrol,
292 return change; 294 return change;
293} 295}
294 296
295static snd_kcontrol_new_t snd_emu10k1_send_routing_control = 297static struct snd_kcontrol_new snd_emu10k1_send_routing_control =
296{ 298{
297 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 299 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
298 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 300 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -303,9 +305,9 @@ static snd_kcontrol_new_t snd_emu10k1_send_routing_control =
303 .put = snd_emu10k1_send_routing_put 305 .put = snd_emu10k1_send_routing_put
304}; 306};
305 307
306static int snd_emu10k1_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 308static int snd_emu10k1_send_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
307{ 309{
308 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 310 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
309 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 311 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
310 uinfo->count = emu->audigy ? 3*8 : 3*4; 312 uinfo->count = emu->audigy ? 3*8 : 3*4;
311 uinfo->value.integer.min = 0; 313 uinfo->value.integer.min = 0;
@@ -313,12 +315,13 @@ static int snd_emu10k1_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
313 return 0; 315 return 0;
314} 316}
315 317
316static int snd_emu10k1_send_volume_get(snd_kcontrol_t * kcontrol, 318static int snd_emu10k1_send_volume_get(struct snd_kcontrol *kcontrol,
317 snd_ctl_elem_value_t * ucontrol) 319 struct snd_ctl_elem_value *ucontrol)
318{ 320{
319 unsigned long flags; 321 unsigned long flags;
320 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 322 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
321 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 323 struct snd_emu10k1_pcm_mixer *mix =
324 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
322 int idx; 325 int idx;
323 int num_efx = emu->audigy ? 8 : 4; 326 int num_efx = emu->audigy ? 8 : 4;
324 327
@@ -329,12 +332,13 @@ static int snd_emu10k1_send_volume_get(snd_kcontrol_t * kcontrol,
329 return 0; 332 return 0;
330} 333}
331 334
332static int snd_emu10k1_send_volume_put(snd_kcontrol_t * kcontrol, 335static int snd_emu10k1_send_volume_put(struct snd_kcontrol *kcontrol,
333 snd_ctl_elem_value_t * ucontrol) 336 struct snd_ctl_elem_value *ucontrol)
334{ 337{
335 unsigned long flags; 338 unsigned long flags;
336 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 339 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
337 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 340 struct snd_emu10k1_pcm_mixer *mix =
341 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
338 int change = 0, idx, val; 342 int change = 0, idx, val;
339 int num_efx = emu->audigy ? 8 : 4; 343 int num_efx = emu->audigy ? 8 : 4;
340 344
@@ -361,7 +365,7 @@ static int snd_emu10k1_send_volume_put(snd_kcontrol_t * kcontrol,
361 return change; 365 return change;
362} 366}
363 367
364static snd_kcontrol_new_t snd_emu10k1_send_volume_control = 368static struct snd_kcontrol_new snd_emu10k1_send_volume_control =
365{ 369{
366 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 370 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
367 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 371 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -372,7 +376,7 @@ static snd_kcontrol_new_t snd_emu10k1_send_volume_control =
372 .put = snd_emu10k1_send_volume_put 376 .put = snd_emu10k1_send_volume_put
373}; 377};
374 378
375static int snd_emu10k1_attn_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 379static int snd_emu10k1_attn_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
376{ 380{
377 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 381 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
378 uinfo->count = 3; 382 uinfo->count = 3;
@@ -381,11 +385,12 @@ static int snd_emu10k1_attn_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *
381 return 0; 385 return 0;
382} 386}
383 387
384static int snd_emu10k1_attn_get(snd_kcontrol_t * kcontrol, 388static int snd_emu10k1_attn_get(struct snd_kcontrol *kcontrol,
385 snd_ctl_elem_value_t * ucontrol) 389 struct snd_ctl_elem_value *ucontrol)
386{ 390{
387 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 391 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
388 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 392 struct snd_emu10k1_pcm_mixer *mix =
393 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
389 unsigned long flags; 394 unsigned long flags;
390 int idx; 395 int idx;
391 396
@@ -396,12 +401,13 @@ static int snd_emu10k1_attn_get(snd_kcontrol_t * kcontrol,
396 return 0; 401 return 0;
397} 402}
398 403
399static int snd_emu10k1_attn_put(snd_kcontrol_t * kcontrol, 404static int snd_emu10k1_attn_put(struct snd_kcontrol *kcontrol,
400 snd_ctl_elem_value_t * ucontrol) 405 struct snd_ctl_elem_value *ucontrol)
401{ 406{
402 unsigned long flags; 407 unsigned long flags;
403 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 408 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
404 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 409 struct snd_emu10k1_pcm_mixer *mix =
410 &emu->pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
405 int change = 0, idx, val; 411 int change = 0, idx, val;
406 412
407 spin_lock_irqsave(&emu->reg_lock, flags); 413 spin_lock_irqsave(&emu->reg_lock, flags);
@@ -424,7 +430,7 @@ static int snd_emu10k1_attn_put(snd_kcontrol_t * kcontrol,
424 return change; 430 return change;
425} 431}
426 432
427static snd_kcontrol_new_t snd_emu10k1_attn_control = 433static struct snd_kcontrol_new snd_emu10k1_attn_control =
428{ 434{
429 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 435 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
430 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 436 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -437,9 +443,9 @@ static snd_kcontrol_new_t snd_emu10k1_attn_control =
437 443
438/* Mutichannel PCM stream controls */ 444/* Mutichannel PCM stream controls */
439 445
440static int snd_emu10k1_efx_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 446static int snd_emu10k1_efx_send_routing_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
441{ 447{
442 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 448 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
443 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 449 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
444 uinfo->count = emu->audigy ? 8 : 4; 450 uinfo->count = emu->audigy ? 8 : 4;
445 uinfo->value.integer.min = 0; 451 uinfo->value.integer.min = 0;
@@ -447,12 +453,13 @@ static int snd_emu10k1_efx_send_routing_info(snd_kcontrol_t *kcontrol, snd_ctl_e
447 return 0; 453 return 0;
448} 454}
449 455
450static int snd_emu10k1_efx_send_routing_get(snd_kcontrol_t * kcontrol, 456static int snd_emu10k1_efx_send_routing_get(struct snd_kcontrol *kcontrol,
451 snd_ctl_elem_value_t * ucontrol) 457 struct snd_ctl_elem_value *ucontrol)
452{ 458{
453 unsigned long flags; 459 unsigned long flags;
454 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 460 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
455 emu10k1_pcm_mixer_t *mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 461 struct snd_emu10k1_pcm_mixer *mix =
462 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
456 int idx; 463 int idx;
457 int num_efx = emu->audigy ? 8 : 4; 464 int num_efx = emu->audigy ? 8 : 4;
458 int mask = emu->audigy ? 0x3f : 0x0f; 465 int mask = emu->audigy ? 0x3f : 0x0f;
@@ -465,13 +472,13 @@ static int snd_emu10k1_efx_send_routing_get(snd_kcontrol_t * kcontrol,
465 return 0; 472 return 0;
466} 473}
467 474
468static int snd_emu10k1_efx_send_routing_put(snd_kcontrol_t * kcontrol, 475static int snd_emu10k1_efx_send_routing_put(struct snd_kcontrol *kcontrol,
469 snd_ctl_elem_value_t * ucontrol) 476 struct snd_ctl_elem_value *ucontrol)
470{ 477{
471 unsigned long flags; 478 unsigned long flags;
472 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 479 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
473 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 480 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
474 emu10k1_pcm_mixer_t *mix = &emu->efx_pcm_mixer[ch]; 481 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
475 int change = 0, idx, val; 482 int change = 0, idx, val;
476 int num_efx = emu->audigy ? 8 : 4; 483 int num_efx = emu->audigy ? 8 : 4;
477 int mask = emu->audigy ? 0x3f : 0x0f; 484 int mask = emu->audigy ? 0x3f : 0x0f;
@@ -495,7 +502,7 @@ static int snd_emu10k1_efx_send_routing_put(snd_kcontrol_t * kcontrol,
495 return change; 502 return change;
496} 503}
497 504
498static snd_kcontrol_new_t snd_emu10k1_efx_send_routing_control = 505static struct snd_kcontrol_new snd_emu10k1_efx_send_routing_control =
499{ 506{
500 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 507 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
501 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 508 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -506,9 +513,9 @@ static snd_kcontrol_new_t snd_emu10k1_efx_send_routing_control =
506 .put = snd_emu10k1_efx_send_routing_put 513 .put = snd_emu10k1_efx_send_routing_put
507}; 514};
508 515
509static int snd_emu10k1_efx_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 516static int snd_emu10k1_efx_send_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
510{ 517{
511 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 518 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
512 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 519 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
513 uinfo->count = emu->audigy ? 8 : 4; 520 uinfo->count = emu->audigy ? 8 : 4;
514 uinfo->value.integer.min = 0; 521 uinfo->value.integer.min = 0;
@@ -516,12 +523,13 @@ static int snd_emu10k1_efx_send_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_el
516 return 0; 523 return 0;
517} 524}
518 525
519static int snd_emu10k1_efx_send_volume_get(snd_kcontrol_t * kcontrol, 526static int snd_emu10k1_efx_send_volume_get(struct snd_kcontrol *kcontrol,
520 snd_ctl_elem_value_t * ucontrol) 527 struct snd_ctl_elem_value *ucontrol)
521{ 528{
522 unsigned long flags; 529 unsigned long flags;
523 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 530 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
524 emu10k1_pcm_mixer_t *mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 531 struct snd_emu10k1_pcm_mixer *mix =
532 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
525 int idx; 533 int idx;
526 int num_efx = emu->audigy ? 8 : 4; 534 int num_efx = emu->audigy ? 8 : 4;
527 535
@@ -532,13 +540,13 @@ static int snd_emu10k1_efx_send_volume_get(snd_kcontrol_t * kcontrol,
532 return 0; 540 return 0;
533} 541}
534 542
535static int snd_emu10k1_efx_send_volume_put(snd_kcontrol_t * kcontrol, 543static int snd_emu10k1_efx_send_volume_put(struct snd_kcontrol *kcontrol,
536 snd_ctl_elem_value_t * ucontrol) 544 struct snd_ctl_elem_value *ucontrol)
537{ 545{
538 unsigned long flags; 546 unsigned long flags;
539 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 547 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
540 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 548 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
541 emu10k1_pcm_mixer_t *mix = &emu->efx_pcm_mixer[ch]; 549 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
542 int change = 0, idx, val; 550 int change = 0, idx, val;
543 int num_efx = emu->audigy ? 8 : 4; 551 int num_efx = emu->audigy ? 8 : 4;
544 552
@@ -561,7 +569,7 @@ static int snd_emu10k1_efx_send_volume_put(snd_kcontrol_t * kcontrol,
561} 569}
562 570
563 571
564static snd_kcontrol_new_t snd_emu10k1_efx_send_volume_control = 572static struct snd_kcontrol_new snd_emu10k1_efx_send_volume_control =
565{ 573{
566 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 574 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
567 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 575 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -572,7 +580,7 @@ static snd_kcontrol_new_t snd_emu10k1_efx_send_volume_control =
572 .put = snd_emu10k1_efx_send_volume_put 580 .put = snd_emu10k1_efx_send_volume_put
573}; 581};
574 582
575static int snd_emu10k1_efx_attn_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 583static int snd_emu10k1_efx_attn_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
576{ 584{
577 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 585 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
578 uinfo->count = 1; 586 uinfo->count = 1;
@@ -581,11 +589,12 @@ static int snd_emu10k1_efx_attn_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info
581 return 0; 589 return 0;
582} 590}
583 591
584static int snd_emu10k1_efx_attn_get(snd_kcontrol_t * kcontrol, 592static int snd_emu10k1_efx_attn_get(struct snd_kcontrol *kcontrol,
585 snd_ctl_elem_value_t * ucontrol) 593 struct snd_ctl_elem_value *ucontrol)
586{ 594{
587 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 595 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
588 emu10k1_pcm_mixer_t *mix = &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)]; 596 struct snd_emu10k1_pcm_mixer *mix =
597 &emu->efx_pcm_mixer[snd_ctl_get_ioffidx(kcontrol, &ucontrol->id)];
589 unsigned long flags; 598 unsigned long flags;
590 599
591 spin_lock_irqsave(&emu->reg_lock, flags); 600 spin_lock_irqsave(&emu->reg_lock, flags);
@@ -594,13 +603,13 @@ static int snd_emu10k1_efx_attn_get(snd_kcontrol_t * kcontrol,
594 return 0; 603 return 0;
595} 604}
596 605
597static int snd_emu10k1_efx_attn_put(snd_kcontrol_t * kcontrol, 606static int snd_emu10k1_efx_attn_put(struct snd_kcontrol *kcontrol,
598 snd_ctl_elem_value_t * ucontrol) 607 struct snd_ctl_elem_value *ucontrol)
599{ 608{
600 unsigned long flags; 609 unsigned long flags;
601 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 610 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
602 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 611 int ch = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
603 emu10k1_pcm_mixer_t *mix = &emu->efx_pcm_mixer[ch]; 612 struct snd_emu10k1_pcm_mixer *mix = &emu->efx_pcm_mixer[ch];
604 int change = 0, val; 613 int change = 0, val;
605 614
606 spin_lock_irqsave(&emu->reg_lock, flags); 615 spin_lock_irqsave(&emu->reg_lock, flags);
@@ -618,7 +627,7 @@ static int snd_emu10k1_efx_attn_put(snd_kcontrol_t * kcontrol,
618 return change; 627 return change;
619} 628}
620 629
621static snd_kcontrol_new_t snd_emu10k1_efx_attn_control = 630static struct snd_kcontrol_new snd_emu10k1_efx_attn_control =
622{ 631{
623 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE, 632 .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | SNDRV_CTL_ELEM_ACCESS_INACTIVE,
624 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 633 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
@@ -629,7 +638,7 @@ static snd_kcontrol_new_t snd_emu10k1_efx_attn_control =
629 .put = snd_emu10k1_efx_attn_put 638 .put = snd_emu10k1_efx_attn_put
630}; 639};
631 640
632static int snd_emu10k1_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 641static int snd_emu10k1_shared_spdif_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
633{ 642{
634 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 643 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
635 uinfo->count = 1; 644 uinfo->count = 1;
@@ -638,10 +647,10 @@ static int snd_emu10k1_shared_spdif_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
638 return 0; 647 return 0;
639} 648}
640 649
641static int snd_emu10k1_shared_spdif_get(snd_kcontrol_t * kcontrol, 650static int snd_emu10k1_shared_spdif_get(struct snd_kcontrol *kcontrol,
642 snd_ctl_elem_value_t * ucontrol) 651 struct snd_ctl_elem_value *ucontrol)
643{ 652{
644 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 653 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
645 654
646 if (emu->audigy) 655 if (emu->audigy)
647 ucontrol->value.integer.value[0] = inl(emu->port + A_IOCFG) & A_IOCFG_GPOUT0 ? 1 : 0; 656 ucontrol->value.integer.value[0] = inl(emu->port + A_IOCFG) & A_IOCFG_GPOUT0 ? 1 : 0;
@@ -650,11 +659,11 @@ static int snd_emu10k1_shared_spdif_get(snd_kcontrol_t * kcontrol,
650 return 0; 659 return 0;
651} 660}
652 661
653static int snd_emu10k1_shared_spdif_put(snd_kcontrol_t * kcontrol, 662static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol,
654 snd_ctl_elem_value_t * ucontrol) 663 struct snd_ctl_elem_value *ucontrol)
655{ 664{
656 unsigned long flags; 665 unsigned long flags;
657 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 666 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
658 unsigned int reg, val; 667 unsigned int reg, val;
659 int change = 0; 668 int change = 0;
660 669
@@ -681,7 +690,7 @@ static int snd_emu10k1_shared_spdif_put(snd_kcontrol_t * kcontrol,
681 return change; 690 return change;
682} 691}
683 692
684static snd_kcontrol_new_t snd_emu10k1_shared_spdif __devinitdata = 693static struct snd_kcontrol_new snd_emu10k1_shared_spdif __devinitdata =
685{ 694{
686 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 695 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
687 .name = "SB Live Analog/Digital Output Jack", 696 .name = "SB Live Analog/Digital Output Jack",
@@ -690,7 +699,7 @@ static snd_kcontrol_new_t snd_emu10k1_shared_spdif __devinitdata =
690 .put = snd_emu10k1_shared_spdif_put 699 .put = snd_emu10k1_shared_spdif_put
691}; 700};
692 701
693static snd_kcontrol_new_t snd_audigy_shared_spdif __devinitdata = 702static struct snd_kcontrol_new snd_audigy_shared_spdif __devinitdata =
694{ 703{
695 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 704 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
696 .name = "Audigy Analog/Digital Output Jack", 705 .name = "Audigy Analog/Digital Output Jack",
@@ -701,35 +710,35 @@ static snd_kcontrol_new_t snd_audigy_shared_spdif __devinitdata =
701 710
702/* 711/*
703 */ 712 */
704static void snd_emu10k1_mixer_free_ac97(ac97_t *ac97) 713static void snd_emu10k1_mixer_free_ac97(struct snd_ac97 *ac97)
705{ 714{
706 emu10k1_t *emu = ac97->private_data; 715 struct snd_emu10k1 *emu = ac97->private_data;
707 emu->ac97 = NULL; 716 emu->ac97 = NULL;
708} 717}
709 718
710/* 719/*
711 */ 720 */
712static int remove_ctl(snd_card_t *card, const char *name) 721static int remove_ctl(struct snd_card *card, const char *name)
713{ 722{
714 snd_ctl_elem_id_t id; 723 struct snd_ctl_elem_id id;
715 memset(&id, 0, sizeof(id)); 724 memset(&id, 0, sizeof(id));
716 strcpy(id.name, name); 725 strcpy(id.name, name);
717 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 726 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
718 return snd_ctl_remove_id(card, &id); 727 return snd_ctl_remove_id(card, &id);
719} 728}
720 729
721static snd_kcontrol_t *ctl_find(snd_card_t *card, const char *name) 730static struct snd_kcontrol *ctl_find(struct snd_card *card, const char *name)
722{ 731{
723 snd_ctl_elem_id_t sid; 732 struct snd_ctl_elem_id sid;
724 memset(&sid, 0, sizeof(sid)); 733 memset(&sid, 0, sizeof(sid));
725 strcpy(sid.name, name); 734 strcpy(sid.name, name);
726 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 735 sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
727 return snd_ctl_find_id(card, &sid); 736 return snd_ctl_find_id(card, &sid);
728} 737}
729 738
730static int rename_ctl(snd_card_t *card, const char *src, const char *dst) 739static int rename_ctl(struct snd_card *card, const char *src, const char *dst)
731{ 740{
732 snd_kcontrol_t *kctl = ctl_find(card, src); 741 struct snd_kcontrol *kctl = ctl_find(card, src);
733 if (kctl) { 742 if (kctl) {
734 strcpy(kctl->id.name, dst); 743 strcpy(kctl->id.name, dst);
735 return 0; 744 return 0;
@@ -737,12 +746,12 @@ static int rename_ctl(snd_card_t *card, const char *src, const char *dst)
737 return -ENOENT; 746 return -ENOENT;
738} 747}
739 748
740int __devinit snd_emu10k1_mixer(emu10k1_t *emu, 749int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
741 int pcm_device, int multi_device) 750 int pcm_device, int multi_device)
742{ 751{
743 int err, pcm; 752 int err, pcm;
744 snd_kcontrol_t *kctl; 753 struct snd_kcontrol *kctl;
745 snd_card_t *card = emu->card; 754 struct snd_card *card = emu->card;
746 char **c; 755 char **c;
747 static char *emu10k1_remove_ctls[] = { 756 static char *emu10k1_remove_ctls[] = {
748 /* no AC97 mono, surround, center/lfe */ 757 /* no AC97 mono, surround, center/lfe */
@@ -795,9 +804,9 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu,
795 }; 804 };
796 805
797 if (emu->card_capabilities->ac97_chip) { 806 if (emu->card_capabilities->ac97_chip) {
798 ac97_bus_t *pbus; 807 struct snd_ac97_bus *pbus;
799 ac97_template_t ac97; 808 struct snd_ac97_template ac97;
800 static ac97_bus_ops_t ops = { 809 static struct snd_ac97_bus_ops ops = {
801 .write = snd_emu10k1_ac97_write, 810 .write = snd_emu10k1_ac97_write,
802 .read = snd_emu10k1_ac97_read, 811 .read = snd_emu10k1_ac97_read,
803 }; 812 };
@@ -894,7 +903,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu,
894 903
895 /* initialize the routing and volume table for each pcm playback stream */ 904 /* initialize the routing and volume table for each pcm playback stream */
896 for (pcm = 0; pcm < 32; pcm++) { 905 for (pcm = 0; pcm < 32; pcm++) {
897 emu10k1_pcm_mixer_t *mix; 906 struct snd_emu10k1_pcm_mixer *mix;
898 int v; 907 int v;
899 908
900 mix = &emu->pcm_mixer[pcm]; 909 mix = &emu->pcm_mixer[pcm];
@@ -914,7 +923,7 @@ int __devinit snd_emu10k1_mixer(emu10k1_t *emu,
914 923
915 /* initialize the routing and volume table for the multichannel playback stream */ 924 /* initialize the routing and volume table for the multichannel playback stream */
916 for (pcm = 0; pcm < NUM_EFX_PLAYBACK; pcm++) { 925 for (pcm = 0; pcm < NUM_EFX_PLAYBACK; pcm++) {
917 emu10k1_pcm_mixer_t *mix; 926 struct snd_emu10k1_pcm_mixer *mix;
918 int v; 927 int v;
919 928
920 mix = &emu->efx_pcm_mixer[pcm]; 929 mix = &emu->efx_pcm_mixer[pcm];
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index eb57458a9665..d96eb455103f 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -28,7 +28,8 @@
28#define EMU10K1_MIDI_MODE_INPUT (1<<0) 28#define EMU10K1_MIDI_MODE_INPUT (1<<0)
29#define EMU10K1_MIDI_MODE_OUTPUT (1<<1) 29#define EMU10K1_MIDI_MODE_OUTPUT (1<<1)
30 30
31static inline unsigned char mpu401_read(emu10k1_t *emu, emu10k1_midi_t *mpu, int idx) 31static inline unsigned char mpu401_read(struct snd_emu10k1 *emu,
32 struct snd_emu10k1_midi *mpu, int idx)
32{ 33{
33 if (emu->audigy) 34 if (emu->audigy)
34 return (unsigned char)snd_emu10k1_ptr_read(emu, mpu->port + idx, 0); 35 return (unsigned char)snd_emu10k1_ptr_read(emu, mpu->port + idx, 0);
@@ -36,7 +37,8 @@ static inline unsigned char mpu401_read(emu10k1_t *emu, emu10k1_midi_t *mpu, int
36 return inb(emu->port + mpu->port + idx); 37 return inb(emu->port + mpu->port + idx);
37} 38}
38 39
39static inline void mpu401_write(emu10k1_t *emu, emu10k1_midi_t *mpu, int data, int idx) 40static inline void mpu401_write(struct snd_emu10k1 *emu,
41 struct snd_emu10k1_midi *mpu, int data, int idx)
40{ 42{
41 if (emu->audigy) 43 if (emu->audigy)
42 snd_emu10k1_ptr_write(emu, mpu->port + idx, 0, data); 44 snd_emu10k1_ptr_write(emu, mpu->port + idx, 0, data);
@@ -56,7 +58,7 @@ static inline void mpu401_write(emu10k1_t *emu, emu10k1_midi_t *mpu, int data, i
56#define MPU401_ENTER_UART 0x3f 58#define MPU401_ENTER_UART 0x3f
57#define MPU401_ACK 0xfe 59#define MPU401_ACK 0xfe
58 60
59static void mpu401_clear_rx(emu10k1_t *emu, emu10k1_midi_t *mpu) 61static void mpu401_clear_rx(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *mpu)
60{ 62{
61 int timeout = 100000; 63 int timeout = 100000;
62 for (; timeout > 0 && mpu401_input_avail(emu, mpu); timeout--) 64 for (; timeout > 0 && mpu401_input_avail(emu, mpu); timeout--)
@@ -71,7 +73,7 @@ static void mpu401_clear_rx(emu10k1_t *emu, emu10k1_midi_t *mpu)
71 73
72 */ 74 */
73 75
74static void do_emu10k1_midi_interrupt(emu10k1_t *emu, emu10k1_midi_t *midi, unsigned int status) 76static void do_emu10k1_midi_interrupt(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *midi, unsigned int status)
75{ 77{
76 unsigned char byte; 78 unsigned char byte;
77 79
@@ -104,17 +106,17 @@ static void do_emu10k1_midi_interrupt(emu10k1_t *emu, emu10k1_midi_t *midi, unsi
104 spin_unlock(&midi->output_lock); 106 spin_unlock(&midi->output_lock);
105} 107}
106 108
107static void snd_emu10k1_midi_interrupt(emu10k1_t *emu, unsigned int status) 109static void snd_emu10k1_midi_interrupt(struct snd_emu10k1 *emu, unsigned int status)
108{ 110{
109 do_emu10k1_midi_interrupt(emu, &emu->midi, status); 111 do_emu10k1_midi_interrupt(emu, &emu->midi, status);
110} 112}
111 113
112static void snd_emu10k1_midi_interrupt2(emu10k1_t *emu, unsigned int status) 114static void snd_emu10k1_midi_interrupt2(struct snd_emu10k1 *emu, unsigned int status)
113{ 115{
114 do_emu10k1_midi_interrupt(emu, &emu->midi2, status); 116 do_emu10k1_midi_interrupt(emu, &emu->midi2, status);
115} 117}
116 118
117static void snd_emu10k1_midi_cmd(emu10k1_t * emu, emu10k1_midi_t *midi, unsigned char cmd, int ack) 119static void snd_emu10k1_midi_cmd(struct snd_emu10k1 * emu, struct snd_emu10k1_midi *midi, unsigned char cmd, int ack)
118{ 120{
119 unsigned long flags; 121 unsigned long flags;
120 int timeout, ok; 122 int timeout, ok;
@@ -146,10 +148,10 @@ static void snd_emu10k1_midi_cmd(emu10k1_t * emu, emu10k1_midi_t *midi, unsigned
146 mpu401_read_data(emu, midi)); 148 mpu401_read_data(emu, midi));
147} 149}
148 150
149static int snd_emu10k1_midi_input_open(snd_rawmidi_substream_t * substream) 151static int snd_emu10k1_midi_input_open(struct snd_rawmidi_substream *substream)
150{ 152{
151 emu10k1_t *emu; 153 struct snd_emu10k1 *emu;
152 emu10k1_midi_t *midi = (emu10k1_midi_t *)substream->rmidi->private_data; 154 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
153 unsigned long flags; 155 unsigned long flags;
154 156
155 emu = midi->emu; 157 emu = midi->emu;
@@ -167,10 +169,10 @@ static int snd_emu10k1_midi_input_open(snd_rawmidi_substream_t * substream)
167 return 0; 169 return 0;
168} 170}
169 171
170static int snd_emu10k1_midi_output_open(snd_rawmidi_substream_t * substream) 172static int snd_emu10k1_midi_output_open(struct snd_rawmidi_substream *substream)
171{ 173{
172 emu10k1_t *emu; 174 struct snd_emu10k1 *emu;
173 emu10k1_midi_t *midi = (emu10k1_midi_t *)substream->rmidi->private_data; 175 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
174 unsigned long flags; 176 unsigned long flags;
175 177
176 emu = midi->emu; 178 emu = midi->emu;
@@ -188,10 +190,10 @@ static int snd_emu10k1_midi_output_open(snd_rawmidi_substream_t * substream)
188 return 0; 190 return 0;
189} 191}
190 192
191static int snd_emu10k1_midi_input_close(snd_rawmidi_substream_t * substream) 193static int snd_emu10k1_midi_input_close(struct snd_rawmidi_substream *substream)
192{ 194{
193 emu10k1_t *emu; 195 struct snd_emu10k1 *emu;
194 emu10k1_midi_t *midi = (emu10k1_midi_t *)substream->rmidi->private_data; 196 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
195 unsigned long flags; 197 unsigned long flags;
196 198
197 emu = midi->emu; 199 emu = midi->emu;
@@ -209,10 +211,10 @@ static int snd_emu10k1_midi_input_close(snd_rawmidi_substream_t * substream)
209 return 0; 211 return 0;
210} 212}
211 213
212static int snd_emu10k1_midi_output_close(snd_rawmidi_substream_t * substream) 214static int snd_emu10k1_midi_output_close(struct snd_rawmidi_substream *substream)
213{ 215{
214 emu10k1_t *emu; 216 struct snd_emu10k1 *emu;
215 emu10k1_midi_t *midi = (emu10k1_midi_t *)substream->rmidi->private_data; 217 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
216 unsigned long flags; 218 unsigned long flags;
217 219
218 emu = midi->emu; 220 emu = midi->emu;
@@ -230,10 +232,10 @@ static int snd_emu10k1_midi_output_close(snd_rawmidi_substream_t * substream)
230 return 0; 232 return 0;
231} 233}
232 234
233static void snd_emu10k1_midi_input_trigger(snd_rawmidi_substream_t * substream, int up) 235static void snd_emu10k1_midi_input_trigger(struct snd_rawmidi_substream *substream, int up)
234{ 236{
235 emu10k1_t *emu; 237 struct snd_emu10k1 *emu;
236 emu10k1_midi_t *midi = (emu10k1_midi_t *)substream->rmidi->private_data; 238 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
237 emu = midi->emu; 239 emu = midi->emu;
238 snd_assert(emu, return); 240 snd_assert(emu, return);
239 241
@@ -243,10 +245,10 @@ static void snd_emu10k1_midi_input_trigger(snd_rawmidi_substream_t * substream,
243 snd_emu10k1_intr_disable(emu, midi->rx_enable); 245 snd_emu10k1_intr_disable(emu, midi->rx_enable);
244} 246}
245 247
246static void snd_emu10k1_midi_output_trigger(snd_rawmidi_substream_t * substream, int up) 248static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substream, int up)
247{ 249{
248 emu10k1_t *emu; 250 struct snd_emu10k1 *emu;
249 emu10k1_midi_t *midi = (emu10k1_midi_t *)substream->rmidi->private_data; 251 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)substream->rmidi->private_data;
250 unsigned long flags; 252 unsigned long flags;
251 253
252 emu = midi->emu; 254 emu = midi->emu;
@@ -283,30 +285,30 @@ static void snd_emu10k1_midi_output_trigger(snd_rawmidi_substream_t * substream,
283 285
284 */ 286 */
285 287
286static snd_rawmidi_ops_t snd_emu10k1_midi_output = 288static struct snd_rawmidi_ops snd_emu10k1_midi_output =
287{ 289{
288 .open = snd_emu10k1_midi_output_open, 290 .open = snd_emu10k1_midi_output_open,
289 .close = snd_emu10k1_midi_output_close, 291 .close = snd_emu10k1_midi_output_close,
290 .trigger = snd_emu10k1_midi_output_trigger, 292 .trigger = snd_emu10k1_midi_output_trigger,
291}; 293};
292 294
293static snd_rawmidi_ops_t snd_emu10k1_midi_input = 295static struct snd_rawmidi_ops snd_emu10k1_midi_input =
294{ 296{
295 .open = snd_emu10k1_midi_input_open, 297 .open = snd_emu10k1_midi_input_open,
296 .close = snd_emu10k1_midi_input_close, 298 .close = snd_emu10k1_midi_input_close,
297 .trigger = snd_emu10k1_midi_input_trigger, 299 .trigger = snd_emu10k1_midi_input_trigger,
298}; 300};
299 301
300static void snd_emu10k1_midi_free(snd_rawmidi_t *rmidi) 302static void snd_emu10k1_midi_free(struct snd_rawmidi *rmidi)
301{ 303{
302 emu10k1_midi_t *midi = (emu10k1_midi_t *)rmidi->private_data; 304 struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)rmidi->private_data;
303 midi->interrupt = NULL; 305 midi->interrupt = NULL;
304 midi->rmidi = NULL; 306 midi->rmidi = NULL;
305} 307}
306 308
307static int __devinit emu10k1_midi_init(emu10k1_t *emu, emu10k1_midi_t *midi, int device, char *name) 309static int __devinit emu10k1_midi_init(struct snd_emu10k1 *emu, struct snd_emu10k1_midi *midi, int device, char *name)
308{ 310{
309 snd_rawmidi_t *rmidi; 311 struct snd_rawmidi *rmidi;
310 int err; 312 int err;
311 313
312 if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0) 314 if ((err = snd_rawmidi_new(emu->card, name, device, 1, 1, &rmidi)) < 0)
@@ -327,9 +329,9 @@ static int __devinit emu10k1_midi_init(emu10k1_t *emu, emu10k1_midi_t *midi, int
327 return 0; 329 return 0;
328} 330}
329 331
330int __devinit snd_emu10k1_midi(emu10k1_t *emu) 332int __devinit snd_emu10k1_midi(struct snd_emu10k1 *emu)
331{ 333{
332 emu10k1_midi_t *midi = &emu->midi; 334 struct snd_emu10k1_midi *midi = &emu->midi;
333 int err; 335 int err;
334 336
335 if ((err = emu10k1_midi_init(emu, midi, 0, "EMU10K1 MPU-401 (UART)")) < 0) 337 if ((err = emu10k1_midi_init(emu, midi, 0, "EMU10K1 MPU-401 (UART)")) < 0)
@@ -344,9 +346,9 @@ int __devinit snd_emu10k1_midi(emu10k1_t *emu)
344 return 0; 346 return 0;
345} 347}
346 348
347int __devinit snd_emu10k1_audigy_midi(emu10k1_t *emu) 349int __devinit snd_emu10k1_audigy_midi(struct snd_emu10k1 *emu)
348{ 350{
349 emu10k1_midi_t *midi; 351 struct snd_emu10k1_midi *midi;
350 int err; 352 int err;
351 353
352 midi = &emu->midi; 354 midi = &emu->midi;
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index 166f7c4d28c9..8e6caf581c0c 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -35,9 +35,10 @@
35#include <sound/core.h> 35#include <sound/core.h>
36#include <sound/emu10k1.h> 36#include <sound/emu10k1.h>
37 37
38static void snd_emu10k1_pcm_interrupt(emu10k1_t *emu, emu10k1_voice_t *voice) 38static void snd_emu10k1_pcm_interrupt(struct snd_emu10k1 *emu,
39 struct snd_emu10k1_voice *voice)
39{ 40{
40 emu10k1_pcm_t *epcm; 41 struct snd_emu10k1_pcm *epcm;
41 42
42 if ((epcm = voice->epcm) == NULL) 43 if ((epcm = voice->epcm) == NULL)
43 return; 44 return;
@@ -52,7 +53,8 @@ static void snd_emu10k1_pcm_interrupt(emu10k1_t *emu, emu10k1_voice_t *voice)
52 snd_pcm_period_elapsed(epcm->substream); 53 snd_pcm_period_elapsed(epcm->substream);
53} 54}
54 55
55static void snd_emu10k1_pcm_ac97adc_interrupt(emu10k1_t *emu, unsigned int status) 56static void snd_emu10k1_pcm_ac97adc_interrupt(struct snd_emu10k1 *emu,
57 unsigned int status)
56{ 58{
57#if 0 59#if 0
58 if (status & IPR_ADCBUFHALFFULL) { 60 if (status & IPR_ADCBUFHALFFULL) {
@@ -63,7 +65,8 @@ static void snd_emu10k1_pcm_ac97adc_interrupt(emu10k1_t *emu, unsigned int statu
63 snd_pcm_period_elapsed(emu->pcm_capture_substream); 65 snd_pcm_period_elapsed(emu->pcm_capture_substream);
64} 66}
65 67
66static void snd_emu10k1_pcm_ac97mic_interrupt(emu10k1_t *emu, unsigned int status) 68static void snd_emu10k1_pcm_ac97mic_interrupt(struct snd_emu10k1 *emu,
69 unsigned int status)
67{ 70{
68#if 0 71#if 0
69 if (status & IPR_MICBUFHALFFULL) { 72 if (status & IPR_MICBUFHALFFULL) {
@@ -74,7 +77,8 @@ static void snd_emu10k1_pcm_ac97mic_interrupt(emu10k1_t *emu, unsigned int statu
74 snd_pcm_period_elapsed(emu->pcm_capture_mic_substream); 77 snd_pcm_period_elapsed(emu->pcm_capture_mic_substream);
75} 78}
76 79
77static void snd_emu10k1_pcm_efx_interrupt(emu10k1_t *emu, unsigned int status) 80static void snd_emu10k1_pcm_efx_interrupt(struct snd_emu10k1 *emu,
81 unsigned int status)
78{ 82{
79#if 0 83#if 0
80 if (status & IPR_EFXBUFHALFFULL) { 84 if (status & IPR_EFXBUFHALFFULL) {
@@ -85,11 +89,11 @@ static void snd_emu10k1_pcm_efx_interrupt(emu10k1_t *emu, unsigned int status)
85 snd_pcm_period_elapsed(emu->pcm_capture_efx_substream); 89 snd_pcm_period_elapsed(emu->pcm_capture_efx_substream);
86} 90}
87 91
88static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(snd_pcm_substream_t * substream) 92static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(struct snd_pcm_substream *substream)
89{ 93{
90 emu10k1_t *emu = snd_pcm_substream_chip(substream); 94 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
91 snd_pcm_runtime_t *runtime = substream->runtime; 95 struct snd_pcm_runtime *runtime = substream->runtime;
92 emu10k1_pcm_t *epcm = runtime->private_data; 96 struct snd_emu10k1_pcm *epcm = runtime->private_data;
93 unsigned int ptr; 97 unsigned int ptr;
94 98
95 if (!epcm->running) 99 if (!epcm->running)
@@ -102,7 +106,7 @@ static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(snd_pcm_substream_t *
102 return ptr; 106 return ptr;
103} 107}
104 108
105static int snd_emu10k1_pcm_channel_alloc(emu10k1_pcm_t * epcm, int voices) 109static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voices)
106{ 110{
107 int err, i; 111 int err, i;
108 112
@@ -167,7 +171,7 @@ static unsigned int capture_period_sizes[31] = {
167 384*128,448*128,512*128 171 384*128,448*128,512*128
168}; 172};
169 173
170static snd_pcm_hw_constraint_list_t hw_constraints_capture_period_sizes = { 174static struct snd_pcm_hw_constraint_list hw_constraints_capture_period_sizes = {
171 .count = 31, 175 .count = 31,
172 .list = capture_period_sizes, 176 .list = capture_period_sizes,
173 .mask = 0 177 .mask = 0
@@ -177,7 +181,7 @@ static unsigned int capture_rates[8] = {
177 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000 181 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000
178}; 182};
179 183
180static snd_pcm_hw_constraint_list_t hw_constraints_capture_rates = { 184static struct snd_pcm_hw_constraint_list hw_constraints_capture_rates = {
181 .count = 8, 185 .count = 8,
182 .list = capture_rates, 186 .list = capture_rates,
183 .mask = 0 187 .mask = 0
@@ -271,15 +275,15 @@ static inline int emu10k1_ccis(int stereo, int w_16)
271 } 275 }
272} 276}
273 277
274static void snd_emu10k1_pcm_init_voice(emu10k1_t *emu, 278static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
275 int master, int extra, 279 int master, int extra,
276 emu10k1_voice_t *evoice, 280 struct snd_emu10k1_voice *evoice,
277 unsigned int start_addr, 281 unsigned int start_addr,
278 unsigned int end_addr, 282 unsigned int end_addr,
279 emu10k1_pcm_mixer_t *mix) 283 struct snd_emu10k1_pcm_mixer *mix)
280{ 284{
281 snd_pcm_substream_t *substream = evoice->epcm->substream; 285 struct snd_pcm_substream *substream = evoice->epcm->substream;
282 snd_pcm_runtime_t *runtime = substream->runtime; 286 struct snd_pcm_runtime *runtime = substream->runtime;
283 unsigned int silent_page, tmp; 287 unsigned int silent_page, tmp;
284 int voice, stereo, w_16; 288 int voice, stereo, w_16;
285 unsigned char attn, send_amount[8]; 289 unsigned char attn, send_amount[8];
@@ -392,12 +396,12 @@ static void snd_emu10k1_pcm_init_voice(emu10k1_t *emu,
392 spin_unlock_irqrestore(&emu->reg_lock, flags); 396 spin_unlock_irqrestore(&emu->reg_lock, flags);
393} 397}
394 398
395static int snd_emu10k1_playback_hw_params(snd_pcm_substream_t * substream, 399static int snd_emu10k1_playback_hw_params(struct snd_pcm_substream *substream,
396 snd_pcm_hw_params_t * hw_params) 400 struct snd_pcm_hw_params *hw_params)
397{ 401{
398 emu10k1_t *emu = snd_pcm_substream_chip(substream); 402 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
399 snd_pcm_runtime_t *runtime = substream->runtime; 403 struct snd_pcm_runtime *runtime = substream->runtime;
400 emu10k1_pcm_t *epcm = runtime->private_data; 404 struct snd_emu10k1_pcm *epcm = runtime->private_data;
401 int err; 405 int err;
402 406
403 if ((err = snd_emu10k1_pcm_channel_alloc(epcm, params_channels(hw_params))) < 0) 407 if ((err = snd_emu10k1_pcm_channel_alloc(epcm, params_channels(hw_params))) < 0)
@@ -412,7 +416,7 @@ static int snd_emu10k1_playback_hw_params(snd_pcm_substream_t * substream,
412 epcm->start_addr = 0; 416 epcm->start_addr = 0;
413 if (! epcm->memblk) 417 if (! epcm->memblk)
414 return -ENOMEM; 418 return -ENOMEM;
415 mapped = ((emu10k1_memblk_t *)epcm->memblk)->mapped_page; 419 mapped = ((struct snd_emu10k1_memblk *)epcm->memblk)->mapped_page;
416 if (mapped < 0) 420 if (mapped < 0)
417 return -ENOMEM; 421 return -ENOMEM;
418 epcm->start_addr = mapped << PAGE_SHIFT; 422 epcm->start_addr = mapped << PAGE_SHIFT;
@@ -420,11 +424,11 @@ static int snd_emu10k1_playback_hw_params(snd_pcm_substream_t * substream,
420 return 0; 424 return 0;
421} 425}
422 426
423static int snd_emu10k1_playback_hw_free(snd_pcm_substream_t * substream) 427static int snd_emu10k1_playback_hw_free(struct snd_pcm_substream *substream)
424{ 428{
425 emu10k1_t *emu = snd_pcm_substream_chip(substream); 429 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
426 snd_pcm_runtime_t *runtime = substream->runtime; 430 struct snd_pcm_runtime *runtime = substream->runtime;
427 emu10k1_pcm_t *epcm; 431 struct snd_emu10k1_pcm *epcm;
428 432
429 if (runtime->private_data == NULL) 433 if (runtime->private_data == NULL)
430 return 0; 434 return 0;
@@ -450,11 +454,11 @@ static int snd_emu10k1_playback_hw_free(snd_pcm_substream_t * substream)
450 return 0; 454 return 0;
451} 455}
452 456
453static int snd_emu10k1_efx_playback_hw_free(snd_pcm_substream_t * substream) 457static int snd_emu10k1_efx_playback_hw_free(struct snd_pcm_substream *substream)
454{ 458{
455 emu10k1_t *emu = snd_pcm_substream_chip(substream); 459 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
456 snd_pcm_runtime_t *runtime = substream->runtime; 460 struct snd_pcm_runtime *runtime = substream->runtime;
457 emu10k1_pcm_t *epcm; 461 struct snd_emu10k1_pcm *epcm;
458 int i; 462 int i;
459 463
460 if (runtime->private_data == NULL) 464 if (runtime->private_data == NULL)
@@ -479,11 +483,11 @@ static int snd_emu10k1_efx_playback_hw_free(snd_pcm_substream_t * substream)
479 return 0; 483 return 0;
480} 484}
481 485
482static int snd_emu10k1_playback_prepare(snd_pcm_substream_t * substream) 486static int snd_emu10k1_playback_prepare(struct snd_pcm_substream *substream)
483{ 487{
484 emu10k1_t *emu = snd_pcm_substream_chip(substream); 488 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
485 snd_pcm_runtime_t *runtime = substream->runtime; 489 struct snd_pcm_runtime *runtime = substream->runtime;
486 emu10k1_pcm_t *epcm = runtime->private_data; 490 struct snd_emu10k1_pcm *epcm = runtime->private_data;
487 unsigned int start_addr, end_addr; 491 unsigned int start_addr, end_addr;
488 492
489 start_addr = epcm->start_addr; 493 start_addr = epcm->start_addr;
@@ -507,11 +511,11 @@ static int snd_emu10k1_playback_prepare(snd_pcm_substream_t * substream)
507 return 0; 511 return 0;
508} 512}
509 513
510static int snd_emu10k1_efx_playback_prepare(snd_pcm_substream_t * substream) 514static int snd_emu10k1_efx_playback_prepare(struct snd_pcm_substream *substream)
511{ 515{
512 emu10k1_t *emu = snd_pcm_substream_chip(substream); 516 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
513 snd_pcm_runtime_t *runtime = substream->runtime; 517 struct snd_pcm_runtime *runtime = substream->runtime;
514 emu10k1_pcm_t *epcm = runtime->private_data; 518 struct snd_emu10k1_pcm *epcm = runtime->private_data;
515 unsigned int start_addr, end_addr; 519 unsigned int start_addr, end_addr;
516 unsigned int channel_size; 520 unsigned int channel_size;
517 int i; 521 int i;
@@ -543,7 +547,7 @@ static int snd_emu10k1_efx_playback_prepare(snd_pcm_substream_t * substream)
543 return 0; 547 return 0;
544} 548}
545 549
546static snd_pcm_hardware_t snd_emu10k1_efx_playback = 550static struct snd_pcm_hardware snd_emu10k1_efx_playback =
547{ 551{
548 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_NONINTERLEAVED | 552 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_NONINTERLEAVED |
549 SNDRV_PCM_INFO_BLOCK_TRANSFER | 553 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -562,22 +566,22 @@ static snd_pcm_hardware_t snd_emu10k1_efx_playback =
562 .fifo_size = 0, 566 .fifo_size = 0,
563}; 567};
564 568
565static int snd_emu10k1_capture_hw_params(snd_pcm_substream_t * substream, 569static int snd_emu10k1_capture_hw_params(struct snd_pcm_substream *substream,
566 snd_pcm_hw_params_t * hw_params) 570 struct snd_pcm_hw_params *hw_params)
567{ 571{
568 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 572 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
569} 573}
570 574
571static int snd_emu10k1_capture_hw_free(snd_pcm_substream_t * substream) 575static int snd_emu10k1_capture_hw_free(struct snd_pcm_substream *substream)
572{ 576{
573 return snd_pcm_lib_free_pages(substream); 577 return snd_pcm_lib_free_pages(substream);
574} 578}
575 579
576static int snd_emu10k1_capture_prepare(snd_pcm_substream_t * substream) 580static int snd_emu10k1_capture_prepare(struct snd_pcm_substream *substream)
577{ 581{
578 emu10k1_t *emu = snd_pcm_substream_chip(substream); 582 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
579 snd_pcm_runtime_t *runtime = substream->runtime; 583 struct snd_pcm_runtime *runtime = substream->runtime;
580 emu10k1_pcm_t *epcm = runtime->private_data; 584 struct snd_emu10k1_pcm *epcm = runtime->private_data;
581 int idx; 585 int idx;
582 586
583 /* zeroing the buffer size will stop capture */ 587 /* zeroing the buffer size will stop capture */
@@ -620,9 +624,9 @@ static int snd_emu10k1_capture_prepare(snd_pcm_substream_t * substream)
620 return 0; 624 return 0;
621} 625}
622 626
623static void snd_emu10k1_playback_invalidate_cache(emu10k1_t *emu, int extra, emu10k1_voice_t *evoice) 627static void snd_emu10k1_playback_invalidate_cache(struct snd_emu10k1 *emu, int extra, struct snd_emu10k1_voice *evoice)
624{ 628{
625 snd_pcm_runtime_t *runtime; 629 struct snd_pcm_runtime *runtime;
626 unsigned int voice, stereo, i, ccis, cra = 64, cs, sample; 630 unsigned int voice, stereo, i, ccis, cra = 64, cs, sample;
627 631
628 if (evoice == NULL) 632 if (evoice == NULL)
@@ -655,12 +659,12 @@ static void snd_emu10k1_playback_invalidate_cache(emu10k1_t *emu, int extra, emu
655 } 659 }
656} 660}
657 661
658static void snd_emu10k1_playback_prepare_voice(emu10k1_t *emu, emu10k1_voice_t *evoice, 662static void snd_emu10k1_playback_prepare_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice,
659 int master, int extra, 663 int master, int extra,
660 emu10k1_pcm_mixer_t *mix) 664 struct snd_emu10k1_pcm_mixer *mix)
661{ 665{
662 snd_pcm_substream_t *substream; 666 struct snd_pcm_substream *substream;
663 snd_pcm_runtime_t *runtime; 667 struct snd_pcm_runtime *runtime;
664 unsigned int attn, vattn; 668 unsigned int attn, vattn;
665 unsigned int voice, tmp; 669 unsigned int voice, tmp;
666 670
@@ -680,10 +684,10 @@ static void snd_emu10k1_playback_prepare_voice(emu10k1_t *emu, emu10k1_voice_t *
680 snd_emu10k1_voice_clear_loop_stop(emu, voice); 684 snd_emu10k1_voice_clear_loop_stop(emu, voice);
681} 685}
682 686
683static void snd_emu10k1_playback_trigger_voice(emu10k1_t *emu, emu10k1_voice_t *evoice, int master, int extra) 687static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice, int master, int extra)
684{ 688{
685 snd_pcm_substream_t *substream; 689 struct snd_pcm_substream *substream;
686 snd_pcm_runtime_t *runtime; 690 struct snd_pcm_runtime *runtime;
687 unsigned int voice, pitch, pitch_target; 691 unsigned int voice, pitch, pitch_target;
688 692
689 if (evoice == NULL) /* skip second voice for mono */ 693 if (evoice == NULL) /* skip second voice for mono */
@@ -702,7 +706,7 @@ static void snd_emu10k1_playback_trigger_voice(emu10k1_t *emu, emu10k1_voice_t *
702 snd_emu10k1_voice_intr_enable(emu, voice); 706 snd_emu10k1_voice_intr_enable(emu, voice);
703} 707}
704 708
705static void snd_emu10k1_playback_stop_voice(emu10k1_t *emu, emu10k1_voice_t *evoice) 709static void snd_emu10k1_playback_stop_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice)
706{ 710{
707 unsigned int voice; 711 unsigned int voice;
708 712
@@ -718,13 +722,13 @@ static void snd_emu10k1_playback_stop_voice(emu10k1_t *emu, emu10k1_voice_t *evo
718 snd_emu10k1_ptr_write(emu, IP, voice, 0); 722 snd_emu10k1_ptr_write(emu, IP, voice, 0);
719} 723}
720 724
721static int snd_emu10k1_playback_trigger(snd_pcm_substream_t * substream, 725static int snd_emu10k1_playback_trigger(struct snd_pcm_substream *substream,
722 int cmd) 726 int cmd)
723{ 727{
724 emu10k1_t *emu = snd_pcm_substream_chip(substream); 728 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
725 snd_pcm_runtime_t *runtime = substream->runtime; 729 struct snd_pcm_runtime *runtime = substream->runtime;
726 emu10k1_pcm_t *epcm = runtime->private_data; 730 struct snd_emu10k1_pcm *epcm = runtime->private_data;
727 emu10k1_pcm_mixer_t *mix; 731 struct snd_emu10k1_pcm_mixer *mix;
728 int result = 0; 732 int result = 0;
729 733
730 // printk("trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", (int)emu, cmd, substream->ops->pointer(substream)); 734 // printk("trigger - emu10k1 = 0x%x, cmd = %i, pointer = %i\n", (int)emu, cmd, substream->ops->pointer(substream));
@@ -759,12 +763,12 @@ static int snd_emu10k1_playback_trigger(snd_pcm_substream_t * substream,
759 return result; 763 return result;
760} 764}
761 765
762static int snd_emu10k1_capture_trigger(snd_pcm_substream_t * substream, 766static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
763 int cmd) 767 int cmd)
764{ 768{
765 emu10k1_t *emu = snd_pcm_substream_chip(substream); 769 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
766 snd_pcm_runtime_t *runtime = substream->runtime; 770 struct snd_pcm_runtime *runtime = substream->runtime;
767 emu10k1_pcm_t *epcm = runtime->private_data; 771 struct snd_emu10k1_pcm *epcm = runtime->private_data;
768 int result = 0; 772 int result = 0;
769 773
770 spin_lock(&emu->reg_lock); 774 spin_lock(&emu->reg_lock);
@@ -819,11 +823,11 @@ static int snd_emu10k1_capture_trigger(snd_pcm_substream_t * substream,
819 return result; 823 return result;
820} 824}
821 825
822static snd_pcm_uframes_t snd_emu10k1_playback_pointer(snd_pcm_substream_t * substream) 826static snd_pcm_uframes_t snd_emu10k1_playback_pointer(struct snd_pcm_substream *substream)
823{ 827{
824 emu10k1_t *emu = snd_pcm_substream_chip(substream); 828 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
825 snd_pcm_runtime_t *runtime = substream->runtime; 829 struct snd_pcm_runtime *runtime = substream->runtime;
826 emu10k1_pcm_t *epcm = runtime->private_data; 830 struct snd_emu10k1_pcm *epcm = runtime->private_data;
827 unsigned int ptr; 831 unsigned int ptr;
828 832
829 if (!epcm->running) 833 if (!epcm->running)
@@ -847,12 +851,12 @@ static snd_pcm_uframes_t snd_emu10k1_playback_pointer(snd_pcm_substream_t * subs
847} 851}
848 852
849 853
850static int snd_emu10k1_efx_playback_trigger(snd_pcm_substream_t * substream, 854static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream,
851 int cmd) 855 int cmd)
852{ 856{
853 emu10k1_t *emu = snd_pcm_substream_chip(substream); 857 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
854 snd_pcm_runtime_t *runtime = substream->runtime; 858 struct snd_pcm_runtime *runtime = substream->runtime;
855 emu10k1_pcm_t *epcm = runtime->private_data; 859 struct snd_emu10k1_pcm *epcm = runtime->private_data;
856 int i; 860 int i;
857 int result = 0; 861 int result = 0;
858 862
@@ -896,11 +900,11 @@ static int snd_emu10k1_efx_playback_trigger(snd_pcm_substream_t * substream,
896} 900}
897 901
898 902
899static snd_pcm_uframes_t snd_emu10k1_capture_pointer(snd_pcm_substream_t * substream) 903static snd_pcm_uframes_t snd_emu10k1_capture_pointer(struct snd_pcm_substream *substream)
900{ 904{
901 emu10k1_t *emu = snd_pcm_substream_chip(substream); 905 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
902 snd_pcm_runtime_t *runtime = substream->runtime; 906 struct snd_pcm_runtime *runtime = substream->runtime;
903 emu10k1_pcm_t *epcm = runtime->private_data; 907 struct snd_emu10k1_pcm *epcm = runtime->private_data;
904 unsigned int ptr; 908 unsigned int ptr;
905 909
906 if (!epcm->running) 910 if (!epcm->running)
@@ -917,7 +921,7 @@ static snd_pcm_uframes_t snd_emu10k1_capture_pointer(snd_pcm_substream_t * subst
917 * Playback support device description 921 * Playback support device description
918 */ 922 */
919 923
920static snd_pcm_hardware_t snd_emu10k1_playback = 924static struct snd_pcm_hardware snd_emu10k1_playback =
921{ 925{
922 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 926 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
923 SNDRV_PCM_INFO_BLOCK_TRANSFER | 927 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -940,7 +944,7 @@ static snd_pcm_hardware_t snd_emu10k1_playback =
940 * Capture support device description 944 * Capture support device description
941 */ 945 */
942 946
943static snd_pcm_hardware_t snd_emu10k1_capture = 947static struct snd_pcm_hardware snd_emu10k1_capture =
944{ 948{
945 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 949 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
946 SNDRV_PCM_INFO_BLOCK_TRANSFER | 950 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -963,9 +967,9 @@ static snd_pcm_hardware_t snd_emu10k1_capture =
963 * 967 *
964 */ 968 */
965 969
966static void snd_emu10k1_pcm_mixer_notify1(emu10k1_t *emu, snd_kcontrol_t *kctl, int idx, int activate) 970static void snd_emu10k1_pcm_mixer_notify1(struct snd_emu10k1 *emu, struct snd_kcontrol *kctl, int idx, int activate)
967{ 971{
968 snd_ctl_elem_id_t id; 972 struct snd_ctl_elem_id id;
969 973
970 if (! kctl) 974 if (! kctl)
971 return; 975 return;
@@ -978,29 +982,29 @@ static void snd_emu10k1_pcm_mixer_notify1(emu10k1_t *emu, snd_kcontrol_t *kctl,
978 snd_ctl_build_ioff(&id, kctl, idx)); 982 snd_ctl_build_ioff(&id, kctl, idx));
979} 983}
980 984
981static void snd_emu10k1_pcm_mixer_notify(emu10k1_t *emu, int idx, int activate) 985static void snd_emu10k1_pcm_mixer_notify(struct snd_emu10k1 *emu, int idx, int activate)
982{ 986{
983 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_send_routing, idx, activate); 987 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_send_routing, idx, activate);
984 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_send_volume, idx, activate); 988 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_send_volume, idx, activate);
985 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_attn, idx, activate); 989 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_attn, idx, activate);
986} 990}
987 991
988static void snd_emu10k1_pcm_efx_mixer_notify(emu10k1_t *emu, int idx, int activate) 992static void snd_emu10k1_pcm_efx_mixer_notify(struct snd_emu10k1 *emu, int idx, int activate)
989{ 993{
990 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_send_routing, idx, activate); 994 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_send_routing, idx, activate);
991 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_send_volume, idx, activate); 995 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_send_volume, idx, activate);
992 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_attn, idx, activate); 996 snd_emu10k1_pcm_mixer_notify1(emu, emu->ctl_efx_attn, idx, activate);
993} 997}
994 998
995static void snd_emu10k1_pcm_free_substream(snd_pcm_runtime_t *runtime) 999static void snd_emu10k1_pcm_free_substream(struct snd_pcm_runtime *runtime)
996{ 1000{
997 kfree(runtime->private_data); 1001 kfree(runtime->private_data);
998} 1002}
999 1003
1000static int snd_emu10k1_efx_playback_close(snd_pcm_substream_t * substream) 1004static int snd_emu10k1_efx_playback_close(struct snd_pcm_substream *substream)
1001{ 1005{
1002 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1006 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1003 emu10k1_pcm_mixer_t *mix; 1007 struct snd_emu10k1_pcm_mixer *mix;
1004 int i; 1008 int i;
1005 1009
1006 for (i=0; i < NUM_EFX_PLAYBACK; i++) { 1010 for (i=0; i < NUM_EFX_PLAYBACK; i++) {
@@ -1011,12 +1015,12 @@ static int snd_emu10k1_efx_playback_close(snd_pcm_substream_t * substream)
1011 return 0; 1015 return 0;
1012} 1016}
1013 1017
1014static int snd_emu10k1_efx_playback_open(snd_pcm_substream_t * substream) 1018static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream)
1015{ 1019{
1016 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1020 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1017 emu10k1_pcm_t *epcm; 1021 struct snd_emu10k1_pcm *epcm;
1018 emu10k1_pcm_mixer_t *mix; 1022 struct snd_emu10k1_pcm_mixer *mix;
1019 snd_pcm_runtime_t *runtime = substream->runtime; 1023 struct snd_pcm_runtime *runtime = substream->runtime;
1020 int i; 1024 int i;
1021 1025
1022 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 1026 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
@@ -1044,12 +1048,12 @@ static int snd_emu10k1_efx_playback_open(snd_pcm_substream_t * substream)
1044 return 0; 1048 return 0;
1045} 1049}
1046 1050
1047static int snd_emu10k1_playback_open(snd_pcm_substream_t * substream) 1051static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
1048{ 1052{
1049 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1053 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1050 emu10k1_pcm_t *epcm; 1054 struct snd_emu10k1_pcm *epcm;
1051 emu10k1_pcm_mixer_t *mix; 1055 struct snd_emu10k1_pcm_mixer *mix;
1052 snd_pcm_runtime_t *runtime = substream->runtime; 1056 struct snd_pcm_runtime *runtime = substream->runtime;
1053 int i, err; 1057 int i, err;
1054 1058
1055 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 1059 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
@@ -1081,21 +1085,21 @@ static int snd_emu10k1_playback_open(snd_pcm_substream_t * substream)
1081 return 0; 1085 return 0;
1082} 1086}
1083 1087
1084static int snd_emu10k1_playback_close(snd_pcm_substream_t * substream) 1088static int snd_emu10k1_playback_close(struct snd_pcm_substream *substream)
1085{ 1089{
1086 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1090 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1087 emu10k1_pcm_mixer_t *mix = &emu->pcm_mixer[substream->number]; 1091 struct snd_emu10k1_pcm_mixer *mix = &emu->pcm_mixer[substream->number];
1088 1092
1089 mix->epcm = NULL; 1093 mix->epcm = NULL;
1090 snd_emu10k1_pcm_mixer_notify(emu, substream->number, 0); 1094 snd_emu10k1_pcm_mixer_notify(emu, substream->number, 0);
1091 return 0; 1095 return 0;
1092} 1096}
1093 1097
1094static int snd_emu10k1_capture_open(snd_pcm_substream_t * substream) 1098static int snd_emu10k1_capture_open(struct snd_pcm_substream *substream)
1095{ 1099{
1096 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1100 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1097 snd_pcm_runtime_t *runtime = substream->runtime; 1101 struct snd_pcm_runtime *runtime = substream->runtime;
1098 emu10k1_pcm_t *epcm; 1102 struct snd_emu10k1_pcm *epcm;
1099 1103
1100 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 1104 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
1101 if (epcm == NULL) 1105 if (epcm == NULL)
@@ -1118,20 +1122,20 @@ static int snd_emu10k1_capture_open(snd_pcm_substream_t * substream)
1118 return 0; 1122 return 0;
1119} 1123}
1120 1124
1121static int snd_emu10k1_capture_close(snd_pcm_substream_t * substream) 1125static int snd_emu10k1_capture_close(struct snd_pcm_substream *substream)
1122{ 1126{
1123 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1127 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1124 1128
1125 emu->capture_interrupt = NULL; 1129 emu->capture_interrupt = NULL;
1126 emu->pcm_capture_substream = NULL; 1130 emu->pcm_capture_substream = NULL;
1127 return 0; 1131 return 0;
1128} 1132}
1129 1133
1130static int snd_emu10k1_capture_mic_open(snd_pcm_substream_t * substream) 1134static int snd_emu10k1_capture_mic_open(struct snd_pcm_substream *substream)
1131{ 1135{
1132 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1136 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1133 emu10k1_pcm_t *epcm; 1137 struct snd_emu10k1_pcm *epcm;
1134 snd_pcm_runtime_t *runtime = substream->runtime; 1138 struct snd_pcm_runtime *runtime = substream->runtime;
1135 1139
1136 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 1140 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
1137 if (epcm == NULL) 1141 if (epcm == NULL)
@@ -1156,20 +1160,20 @@ static int snd_emu10k1_capture_mic_open(snd_pcm_substream_t * substream)
1156 return 0; 1160 return 0;
1157} 1161}
1158 1162
1159static int snd_emu10k1_capture_mic_close(snd_pcm_substream_t * substream) 1163static int snd_emu10k1_capture_mic_close(struct snd_pcm_substream *substream)
1160{ 1164{
1161 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1165 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1162 1166
1163 emu->capture_interrupt = NULL; 1167 emu->capture_interrupt = NULL;
1164 emu->pcm_capture_mic_substream = NULL; 1168 emu->pcm_capture_mic_substream = NULL;
1165 return 0; 1169 return 0;
1166} 1170}
1167 1171
1168static int snd_emu10k1_capture_efx_open(snd_pcm_substream_t * substream) 1172static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
1169{ 1173{
1170 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1174 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1171 emu10k1_pcm_t *epcm; 1175 struct snd_emu10k1_pcm *epcm;
1172 snd_pcm_runtime_t *runtime = substream->runtime; 1176 struct snd_pcm_runtime *runtime = substream->runtime;
1173 int nefx = emu->audigy ? 64 : 32; 1177 int nefx = emu->audigy ? 64 : 32;
1174 int idx; 1178 int idx;
1175 1179
@@ -1206,16 +1210,16 @@ static int snd_emu10k1_capture_efx_open(snd_pcm_substream_t * substream)
1206 return 0; 1210 return 0;
1207} 1211}
1208 1212
1209static int snd_emu10k1_capture_efx_close(snd_pcm_substream_t * substream) 1213static int snd_emu10k1_capture_efx_close(struct snd_pcm_substream *substream)
1210{ 1214{
1211 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1215 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1212 1216
1213 emu->capture_interrupt = NULL; 1217 emu->capture_interrupt = NULL;
1214 emu->pcm_capture_efx_substream = NULL; 1218 emu->pcm_capture_efx_substream = NULL;
1215 return 0; 1219 return 0;
1216} 1220}
1217 1221
1218static snd_pcm_ops_t snd_emu10k1_playback_ops = { 1222static struct snd_pcm_ops snd_emu10k1_playback_ops = {
1219 .open = snd_emu10k1_playback_open, 1223 .open = snd_emu10k1_playback_open,
1220 .close = snd_emu10k1_playback_close, 1224 .close = snd_emu10k1_playback_close,
1221 .ioctl = snd_pcm_lib_ioctl, 1225 .ioctl = snd_pcm_lib_ioctl,
@@ -1227,7 +1231,7 @@ static snd_pcm_ops_t snd_emu10k1_playback_ops = {
1227 .page = snd_pcm_sgbuf_ops_page, 1231 .page = snd_pcm_sgbuf_ops_page,
1228}; 1232};
1229 1233
1230static snd_pcm_ops_t snd_emu10k1_capture_ops = { 1234static struct snd_pcm_ops snd_emu10k1_capture_ops = {
1231 .open = snd_emu10k1_capture_open, 1235 .open = snd_emu10k1_capture_open,
1232 .close = snd_emu10k1_capture_close, 1236 .close = snd_emu10k1_capture_close,
1233 .ioctl = snd_pcm_lib_ioctl, 1237 .ioctl = snd_pcm_lib_ioctl,
@@ -1239,7 +1243,7 @@ static snd_pcm_ops_t snd_emu10k1_capture_ops = {
1239}; 1243};
1240 1244
1241/* EFX playback */ 1245/* EFX playback */
1242static snd_pcm_ops_t snd_emu10k1_efx_playback_ops = { 1246static struct snd_pcm_ops snd_emu10k1_efx_playback_ops = {
1243 .open = snd_emu10k1_efx_playback_open, 1247 .open = snd_emu10k1_efx_playback_open,
1244 .close = snd_emu10k1_efx_playback_close, 1248 .close = snd_emu10k1_efx_playback_close,
1245 .ioctl = snd_pcm_lib_ioctl, 1249 .ioctl = snd_pcm_lib_ioctl,
@@ -1251,10 +1255,10 @@ static snd_pcm_ops_t snd_emu10k1_efx_playback_ops = {
1251 .page = snd_pcm_sgbuf_ops_page, 1255 .page = snd_pcm_sgbuf_ops_page,
1252}; 1256};
1253 1257
1254int __devinit snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1258int __devinit snd_emu10k1_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm)
1255{ 1259{
1256 snd_pcm_t *pcm; 1260 struct snd_pcm *pcm;
1257 snd_pcm_substream_t *substream; 1261 struct snd_pcm_substream *substream;
1258 int err; 1262 int err;
1259 1263
1260 if (rpcm) 1264 if (rpcm)
@@ -1286,10 +1290,10 @@ int __devinit snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm)
1286 return 0; 1290 return 0;
1287} 1291}
1288 1292
1289int __devinit snd_emu10k1_pcm_multi(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1293int __devinit snd_emu10k1_pcm_multi(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm)
1290{ 1294{
1291 snd_pcm_t *pcm; 1295 struct snd_pcm *pcm;
1292 snd_pcm_substream_t *substream; 1296 struct snd_pcm_substream *substream;
1293 int err; 1297 int err;
1294 1298
1295 if (rpcm) 1299 if (rpcm)
@@ -1318,7 +1322,7 @@ int __devinit snd_emu10k1_pcm_multi(emu10k1_t * emu, int device, snd_pcm_t ** rp
1318} 1322}
1319 1323
1320 1324
1321static snd_pcm_ops_t snd_emu10k1_capture_mic_ops = { 1325static struct snd_pcm_ops snd_emu10k1_capture_mic_ops = {
1322 .open = snd_emu10k1_capture_mic_open, 1326 .open = snd_emu10k1_capture_mic_open,
1323 .close = snd_emu10k1_capture_mic_close, 1327 .close = snd_emu10k1_capture_mic_close,
1324 .ioctl = snd_pcm_lib_ioctl, 1328 .ioctl = snd_pcm_lib_ioctl,
@@ -1329,9 +1333,9 @@ static snd_pcm_ops_t snd_emu10k1_capture_mic_ops = {
1329 .pointer = snd_emu10k1_capture_pointer, 1333 .pointer = snd_emu10k1_capture_pointer,
1330}; 1334};
1331 1335
1332int __devinit snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1336int __devinit snd_emu10k1_pcm_mic(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm)
1333{ 1337{
1334 snd_pcm_t *pcm; 1338 struct snd_pcm *pcm;
1335 int err; 1339 int err;
1336 1340
1337 if (rpcm) 1341 if (rpcm)
@@ -1355,9 +1359,9 @@ int __devinit snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm
1355 return 0; 1359 return 0;
1356} 1360}
1357 1361
1358static int snd_emu10k1_pcm_efx_voices_mask_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 1362static int snd_emu10k1_pcm_efx_voices_mask_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
1359{ 1363{
1360 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 1364 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1361 int nefx = emu->audigy ? 64 : 32; 1365 int nefx = emu->audigy ? 64 : 32;
1362 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; 1366 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1363 uinfo->count = nefx; 1367 uinfo->count = nefx;
@@ -1366,9 +1370,9 @@ static int snd_emu10k1_pcm_efx_voices_mask_info(snd_kcontrol_t *kcontrol, snd_ct
1366 return 0; 1370 return 0;
1367} 1371}
1368 1372
1369static int snd_emu10k1_pcm_efx_voices_mask_get(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1373static int snd_emu10k1_pcm_efx_voices_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1370{ 1374{
1371 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 1375 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1372 int nefx = emu->audigy ? 64 : 32; 1376 int nefx = emu->audigy ? 64 : 32;
1373 int idx; 1377 int idx;
1374 1378
@@ -1379,9 +1383,9 @@ static int snd_emu10k1_pcm_efx_voices_mask_get(snd_kcontrol_t * kcontrol, snd_ct
1379 return 0; 1383 return 0;
1380} 1384}
1381 1385
1382static int snd_emu10k1_pcm_efx_voices_mask_put(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol) 1386static int snd_emu10k1_pcm_efx_voices_mask_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
1383{ 1387{
1384 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 1388 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
1385 unsigned int nval[2], bits; 1389 unsigned int nval[2], bits;
1386 int nefx = emu->audigy ? 64 : 32; 1390 int nefx = emu->audigy ? 64 : 32;
1387 int nefxb = emu->audigy ? 7 : 6; 1391 int nefxb = emu->audigy ? 7 : 6;
@@ -1410,7 +1414,7 @@ static int snd_emu10k1_pcm_efx_voices_mask_put(snd_kcontrol_t * kcontrol, snd_ct
1410 return change; 1414 return change;
1411} 1415}
1412 1416
1413static snd_kcontrol_new_t snd_emu10k1_pcm_efx_voices_mask = { 1417static struct snd_kcontrol_new snd_emu10k1_pcm_efx_voices_mask = {
1414 .iface = SNDRV_CTL_ELEM_IFACE_PCM, 1418 .iface = SNDRV_CTL_ELEM_IFACE_PCM,
1415 .name = "Captured FX8010 Outputs", 1419 .name = "Captured FX8010 Outputs",
1416 .info = snd_emu10k1_pcm_efx_voices_mask_info, 1420 .info = snd_emu10k1_pcm_efx_voices_mask_info,
@@ -1418,7 +1422,7 @@ static snd_kcontrol_new_t snd_emu10k1_pcm_efx_voices_mask = {
1418 .put = snd_emu10k1_pcm_efx_voices_mask_put 1422 .put = snd_emu10k1_pcm_efx_voices_mask_put
1419}; 1423};
1420 1424
1421static snd_pcm_ops_t snd_emu10k1_capture_efx_ops = { 1425static struct snd_pcm_ops snd_emu10k1_capture_efx_ops = {
1422 .open = snd_emu10k1_capture_efx_open, 1426 .open = snd_emu10k1_capture_efx_open,
1423 .close = snd_emu10k1_capture_efx_close, 1427 .close = snd_emu10k1_capture_efx_close,
1424 .ioctl = snd_pcm_lib_ioctl, 1428 .ioctl = snd_pcm_lib_ioctl,
@@ -1435,9 +1439,9 @@ static snd_pcm_ops_t snd_emu10k1_capture_efx_ops = {
1435#define INITIAL_TRAM_SHIFT 14 1439#define INITIAL_TRAM_SHIFT 14
1436#define INITIAL_TRAM_POS(size) ((((size) / 2) - INITIAL_TRAM_SHIFT) - 1) 1440#define INITIAL_TRAM_POS(size) ((((size) / 2) - INITIAL_TRAM_SHIFT) - 1)
1437 1441
1438static void snd_emu10k1_fx8010_playback_irq(emu10k1_t *emu, void *private_data) 1442static void snd_emu10k1_fx8010_playback_irq(struct snd_emu10k1 *emu, void *private_data)
1439{ 1443{
1440 snd_pcm_substream_t *substream = private_data; 1444 struct snd_pcm_substream *substream = private_data;
1441 snd_pcm_period_elapsed(substream); 1445 snd_pcm_period_elapsed(substream);
1442} 1446}
1443 1447
@@ -1461,11 +1465,11 @@ static void snd_emu10k1_fx8010_playback_tram_poke1(unsigned short *dst_left,
1461 } 1465 }
1462} 1466}
1463 1467
1464static void fx8010_pb_trans_copy(snd_pcm_substream_t *substream, 1468static void fx8010_pb_trans_copy(struct snd_pcm_substream *substream,
1465 snd_pcm_indirect_t *rec, size_t bytes) 1469 struct snd_pcm_indirect *rec, size_t bytes)
1466{ 1470{
1467 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1471 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1468 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1472 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1469 unsigned int tram_size = pcm->buffer_size; 1473 unsigned int tram_size = pcm->buffer_size;
1470 unsigned short *src = (unsigned short *)(substream->runtime->dma_area + rec->sw_data); 1474 unsigned short *src = (unsigned short *)(substream->runtime->dma_area + rec->sw_data);
1471 unsigned int frames = bytes >> 2, count; 1475 unsigned int frames = bytes >> 2, count;
@@ -1490,25 +1494,25 @@ static void fx8010_pb_trans_copy(snd_pcm_substream_t *substream,
1490 pcm->tram_shift = tram_shift; 1494 pcm->tram_shift = tram_shift;
1491} 1495}
1492 1496
1493static int snd_emu10k1_fx8010_playback_transfer(snd_pcm_substream_t *substream) 1497static int snd_emu10k1_fx8010_playback_transfer(struct snd_pcm_substream *substream)
1494{ 1498{
1495 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1499 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1496 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1500 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1497 1501
1498 snd_pcm_indirect_playback_transfer(substream, &pcm->pcm_rec, fx8010_pb_trans_copy); 1502 snd_pcm_indirect_playback_transfer(substream, &pcm->pcm_rec, fx8010_pb_trans_copy);
1499 return 0; 1503 return 0;
1500} 1504}
1501 1505
1502static int snd_emu10k1_fx8010_playback_hw_params(snd_pcm_substream_t * substream, 1506static int snd_emu10k1_fx8010_playback_hw_params(struct snd_pcm_substream *substream,
1503 snd_pcm_hw_params_t * hw_params) 1507 struct snd_pcm_hw_params *hw_params)
1504{ 1508{
1505 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); 1509 return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
1506} 1510}
1507 1511
1508static int snd_emu10k1_fx8010_playback_hw_free(snd_pcm_substream_t * substream) 1512static int snd_emu10k1_fx8010_playback_hw_free(struct snd_pcm_substream *substream)
1509{ 1513{
1510 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1514 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1511 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1515 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1512 unsigned int i; 1516 unsigned int i;
1513 1517
1514 for (i = 0; i < pcm->channels; i++) 1518 for (i = 0; i < pcm->channels; i++)
@@ -1517,11 +1521,11 @@ static int snd_emu10k1_fx8010_playback_hw_free(snd_pcm_substream_t * substream)
1517 return 0; 1521 return 0;
1518} 1522}
1519 1523
1520static int snd_emu10k1_fx8010_playback_prepare(snd_pcm_substream_t * substream) 1524static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substream)
1521{ 1525{
1522 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1526 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1523 snd_pcm_runtime_t *runtime = substream->runtime; 1527 struct snd_pcm_runtime *runtime = substream->runtime;
1524 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1528 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1525 unsigned int i; 1529 unsigned int i;
1526 1530
1527 // printk("prepare: etram_pages = 0x%p, dma_area = 0x%x, buffer_size = 0x%x (0x%x)\n", emu->fx8010.etram_pages, runtime->dma_area, runtime->buffer_size, runtime->buffer_size << 2); 1531 // printk("prepare: etram_pages = 0x%p, dma_area = 0x%x, buffer_size = 0x%x (0x%x)\n", emu->fx8010.etram_pages, runtime->dma_area, runtime->buffer_size, runtime->buffer_size << 2);
@@ -1541,10 +1545,10 @@ static int snd_emu10k1_fx8010_playback_prepare(snd_pcm_substream_t * substream)
1541 return 0; 1545 return 0;
1542} 1546}
1543 1547
1544static int snd_emu10k1_fx8010_playback_trigger(snd_pcm_substream_t * substream, int cmd) 1548static int snd_emu10k1_fx8010_playback_trigger(struct snd_pcm_substream *substream, int cmd)
1545{ 1549{
1546 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1550 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1547 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1551 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1548 int result = 0; 1552 int result = 0;
1549 1553
1550 spin_lock(&emu->reg_lock); 1554 spin_lock(&emu->reg_lock);
@@ -1586,10 +1590,10 @@ static int snd_emu10k1_fx8010_playback_trigger(snd_pcm_substream_t * substream,
1586 return result; 1590 return result;
1587} 1591}
1588 1592
1589static snd_pcm_uframes_t snd_emu10k1_fx8010_playback_pointer(snd_pcm_substream_t * substream) 1593static snd_pcm_uframes_t snd_emu10k1_fx8010_playback_pointer(struct snd_pcm_substream *substream)
1590{ 1594{
1591 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1595 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1592 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1596 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1593 size_t ptr; /* byte pointer */ 1597 size_t ptr; /* byte pointer */
1594 1598
1595 if (!snd_emu10k1_ptr_read(emu, emu->gpr_base + pcm->gpr_trigger, 0)) 1599 if (!snd_emu10k1_ptr_read(emu, emu->gpr_base + pcm->gpr_trigger, 0))
@@ -1598,7 +1602,7 @@ static snd_pcm_uframes_t snd_emu10k1_fx8010_playback_pointer(snd_pcm_substream_t
1598 return snd_pcm_indirect_playback_pointer(substream, &pcm->pcm_rec, ptr); 1602 return snd_pcm_indirect_playback_pointer(substream, &pcm->pcm_rec, ptr);
1599} 1603}
1600 1604
1601static snd_pcm_hardware_t snd_emu10k1_fx8010_playback = 1605static struct snd_pcm_hardware snd_emu10k1_fx8010_playback =
1602{ 1606{
1603 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED | 1607 .info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
1604 /* SNDRV_PCM_INFO_MMAP_VALID | */ SNDRV_PCM_INFO_PAUSE), 1608 /* SNDRV_PCM_INFO_MMAP_VALID | */ SNDRV_PCM_INFO_PAUSE),
@@ -1616,11 +1620,11 @@ static snd_pcm_hardware_t snd_emu10k1_fx8010_playback =
1616 .fifo_size = 0, 1620 .fifo_size = 0,
1617}; 1621};
1618 1622
1619static int snd_emu10k1_fx8010_playback_open(snd_pcm_substream_t * substream) 1623static int snd_emu10k1_fx8010_playback_open(struct snd_pcm_substream *substream)
1620{ 1624{
1621 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1625 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1622 snd_pcm_runtime_t *runtime = substream->runtime; 1626 struct snd_pcm_runtime *runtime = substream->runtime;
1623 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1627 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1624 1628
1625 runtime->hw = snd_emu10k1_fx8010_playback; 1629 runtime->hw = snd_emu10k1_fx8010_playback;
1626 runtime->hw.channels_min = runtime->hw.channels_max = pcm->channels; 1630 runtime->hw.channels_min = runtime->hw.channels_max = pcm->channels;
@@ -1635,10 +1639,10 @@ static int snd_emu10k1_fx8010_playback_open(snd_pcm_substream_t * substream)
1635 return 0; 1639 return 0;
1636} 1640}
1637 1641
1638static int snd_emu10k1_fx8010_playback_close(snd_pcm_substream_t * substream) 1642static int snd_emu10k1_fx8010_playback_close(struct snd_pcm_substream *substream)
1639{ 1643{
1640 emu10k1_t *emu = snd_pcm_substream_chip(substream); 1644 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
1641 snd_emu10k1_fx8010_pcm_t *pcm = &emu->fx8010.pcm[substream->number]; 1645 struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
1642 1646
1643 spin_lock_irq(&emu->reg_lock); 1647 spin_lock_irq(&emu->reg_lock);
1644 pcm->opened = 0; 1648 pcm->opened = 0;
@@ -1646,7 +1650,7 @@ static int snd_emu10k1_fx8010_playback_close(snd_pcm_substream_t * substream)
1646 return 0; 1650 return 0;
1647} 1651}
1648 1652
1649static snd_pcm_ops_t snd_emu10k1_fx8010_playback_ops = { 1653static struct snd_pcm_ops snd_emu10k1_fx8010_playback_ops = {
1650 .open = snd_emu10k1_fx8010_playback_open, 1654 .open = snd_emu10k1_fx8010_playback_open,
1651 .close = snd_emu10k1_fx8010_playback_close, 1655 .close = snd_emu10k1_fx8010_playback_close,
1652 .ioctl = snd_pcm_lib_ioctl, 1656 .ioctl = snd_pcm_lib_ioctl,
@@ -1658,10 +1662,10 @@ static snd_pcm_ops_t snd_emu10k1_fx8010_playback_ops = {
1658 .ack = snd_emu10k1_fx8010_playback_transfer, 1662 .ack = snd_emu10k1_fx8010_playback_transfer,
1659}; 1663};
1660 1664
1661int __devinit snd_emu10k1_pcm_efx(emu10k1_t * emu, int device, snd_pcm_t ** rpcm) 1665int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm)
1662{ 1666{
1663 snd_pcm_t *pcm; 1667 struct snd_pcm *pcm;
1664 snd_kcontrol_t *kctl; 1668 struct snd_kcontrol *kctl;
1665 int err; 1669 int err;
1666 1670
1667 if (rpcm) 1671 if (rpcm)
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 6cdee588d35d..b88137f91655 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -32,8 +32,8 @@
32#include <sound/emu10k1.h> 32#include <sound/emu10k1.h>
33#include "p16v.h" 33#include "p16v.h"
34 34
35static void snd_emu10k1_proc_spdif_status(emu10k1_t * emu, 35static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
36 snd_info_buffer_t * buffer, 36 struct snd_info_buffer *buffer,
37 char *title, 37 char *title,
38 int status_reg, 38 int status_reg,
39 int rate_reg) 39 int rate_reg)
@@ -75,8 +75,8 @@ static void snd_emu10k1_proc_spdif_status(emu10k1_t * emu,
75 75
76} 76}
77 77
78static void snd_emu10k1_proc_read(snd_info_entry_t *entry, 78static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
79 snd_info_buffer_t * buffer) 79 struct snd_info_buffer *buffer)
80{ 80{
81 /* FIXME - output names are in emufx.c too */ 81 /* FIXME - output names are in emufx.c too */
82 static char *creative_outs[32] = { 82 static char *creative_outs[32] = {
@@ -181,7 +181,7 @@ static void snd_emu10k1_proc_read(snd_info_entry_t *entry,
181 /* 63 */ "FXBUS2_31" 181 /* 63 */ "FXBUS2_31"
182 }; 182 };
183 183
184 emu10k1_t *emu = entry->private_data; 184 struct snd_emu10k1 *emu = entry->private_data;
185 unsigned int val, val1; 185 unsigned int val, val1;
186 int nefx = emu->audigy ? 64 : 32; 186 int nefx = emu->audigy ? 64 : 32;
187 char **outputs = emu->audigy ? audigy_outs : creative_outs; 187 char **outputs = emu->audigy ? audigy_outs : creative_outs;
@@ -232,10 +232,10 @@ static void snd_emu10k1_proc_read(snd_info_entry_t *entry,
232 snd_iprintf(buffer, " Output %02i [%s]\n", idx, outputs[idx]); 232 snd_iprintf(buffer, " Output %02i [%s]\n", idx, outputs[idx]);
233} 233}
234 234
235static void snd_emu10k1_proc_spdif_read(snd_info_entry_t *entry, 235static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
236 snd_info_buffer_t * buffer) 236 struct snd_info_buffer *buffer)
237{ 237{
238 emu10k1_t *emu = entry->private_data; 238 struct snd_emu10k1 *emu = entry->private_data;
239 snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS); 239 snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS);
240 snd_emu10k1_proc_spdif_status(emu, buffer, "Optical or Coax S/PDIF In", GPSCS, GPSRCS); 240 snd_emu10k1_proc_spdif_status(emu, buffer, "Optical or Coax S/PDIF In", GPSCS, GPSRCS);
241#if 0 241#if 0
@@ -246,11 +246,11 @@ static void snd_emu10k1_proc_spdif_read(snd_info_entry_t *entry,
246#endif 246#endif
247} 247}
248 248
249static void snd_emu10k1_proc_rates_read(snd_info_entry_t *entry, 249static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
250 snd_info_buffer_t * buffer) 250 struct snd_info_buffer *buffer)
251{ 251{
252 static int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 }; 252 static int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 };
253 emu10k1_t *emu = entry->private_data; 253 struct snd_emu10k1 *emu = entry->private_data;
254 unsigned int val, tmp, n; 254 unsigned int val, tmp, n;
255 val = snd_emu10k1_ptr20_read(emu, CAPTURE_RATE_STATUS, 0); 255 val = snd_emu10k1_ptr20_read(emu, CAPTURE_RATE_STATUS, 0);
256 tmp = (val >> 16) & 0x8; 256 tmp = (val >> 16) & 0x8;
@@ -261,11 +261,11 @@ static void snd_emu10k1_proc_rates_read(snd_info_entry_t *entry,
261 } 261 }
262} 262}
263 263
264static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry, 264static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
265 snd_info_buffer_t * buffer) 265 struct snd_info_buffer *buffer)
266{ 266{
267 u32 pc; 267 u32 pc;
268 emu10k1_t *emu = entry->private_data; 268 struct snd_emu10k1 *emu = entry->private_data;
269 269
270 snd_iprintf(buffer, "FX8010 Instruction List '%s'\n", emu->fx8010.name); 270 snd_iprintf(buffer, "FX8010 Instruction List '%s'\n", emu->fx8010.name);
271 snd_iprintf(buffer, " Code dump :\n"); 271 snd_iprintf(buffer, " Code dump :\n");
@@ -304,12 +304,13 @@ static void snd_emu10k1_proc_acode_read(snd_info_entry_t *entry,
304#define TOTAL_SIZE_CODE (0x200*8) 304#define TOTAL_SIZE_CODE (0x200*8)
305#define A_TOTAL_SIZE_CODE (0x400*8) 305#define A_TOTAL_SIZE_CODE (0x400*8)
306 306
307static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_data, 307static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
308 void *file_private_data,
308 struct file *file, char __user *buf, 309 struct file *file, char __user *buf,
309 unsigned long count, unsigned long pos) 310 unsigned long count, unsigned long pos)
310{ 311{
311 long size; 312 long size;
312 emu10k1_t *emu = entry->private_data; 313 struct snd_emu10k1 *emu = entry->private_data;
313 unsigned int offset; 314 unsigned int offset;
314 int tram_addr = 0; 315 int tram_addr = 0;
315 316
@@ -349,11 +350,11 @@ static long snd_emu10k1_fx8010_read(snd_info_entry_t *entry, void *file_private_
349 return 0; 350 return 0;
350} 351}
351 352
352static void snd_emu10k1_proc_voices_read(snd_info_entry_t *entry, 353static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry,
353 snd_info_buffer_t * buffer) 354 struct snd_info_buffer *buffer)
354{ 355{
355 emu10k1_t *emu = entry->private_data; 356 struct snd_emu10k1 *emu = entry->private_data;
356 emu10k1_voice_t *voice; 357 struct snd_emu10k1_voice *voice;
357 int idx; 358 int idx;
358 359
359 snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n"); 360 snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n");
@@ -370,10 +371,10 @@ static void snd_emu10k1_proc_voices_read(snd_info_entry_t *entry,
370} 371}
371 372
372#ifdef CONFIG_SND_DEBUG 373#ifdef CONFIG_SND_DEBUG
373static void snd_emu_proc_io_reg_read(snd_info_entry_t *entry, 374static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
374 snd_info_buffer_t * buffer) 375 struct snd_info_buffer *buffer)
375{ 376{
376 emu10k1_t *emu = entry->private_data; 377 struct snd_emu10k1 *emu = entry->private_data;
377 unsigned long value; 378 unsigned long value;
378 unsigned long flags; 379 unsigned long flags;
379 int i; 380 int i;
@@ -386,10 +387,10 @@ static void snd_emu_proc_io_reg_read(snd_info_entry_t *entry,
386 } 387 }
387} 388}
388 389
389static void snd_emu_proc_io_reg_write(snd_info_entry_t *entry, 390static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
390 snd_info_buffer_t * buffer) 391 struct snd_info_buffer *buffer)
391{ 392{
392 emu10k1_t *emu = entry->private_data; 393 struct snd_emu10k1 *emu = entry->private_data;
393 unsigned long flags; 394 unsigned long flags;
394 char line[64]; 395 char line[64];
395 u32 reg, val; 396 u32 reg, val;
@@ -404,7 +405,7 @@ static void snd_emu_proc_io_reg_write(snd_info_entry_t *entry,
404 } 405 }
405} 406}
406 407
407static unsigned int snd_ptr_read(emu10k1_t * emu, 408static unsigned int snd_ptr_read(struct snd_emu10k1 * emu,
408 unsigned int iobase, 409 unsigned int iobase,
409 unsigned int reg, 410 unsigned int reg,
410 unsigned int chn) 411 unsigned int chn)
@@ -421,7 +422,7 @@ static unsigned int snd_ptr_read(emu10k1_t * emu,
421 return val; 422 return val;
422} 423}
423 424
424static void snd_ptr_write(emu10k1_t *emu, 425static void snd_ptr_write(struct snd_emu10k1 *emu,
425 unsigned int iobase, 426 unsigned int iobase,
426 unsigned int reg, 427 unsigned int reg,
427 unsigned int chn, 428 unsigned int chn,
@@ -439,10 +440,10 @@ static void snd_ptr_write(emu10k1_t *emu,
439} 440}
440 441
441 442
442static void snd_emu_proc_ptr_reg_read(snd_info_entry_t *entry, 443static void snd_emu_proc_ptr_reg_read(struct snd_info_entry *entry,
443 snd_info_buffer_t * buffer, int iobase, int offset, int length, int voices) 444 struct snd_info_buffer *buffer, int iobase, int offset, int length, int voices)
444{ 445{
445 emu10k1_t *emu = entry->private_data; 446 struct snd_emu10k1 *emu = entry->private_data;
446 unsigned long value; 447 unsigned long value;
447 int i,j; 448 int i,j;
448 if (offset+length > 0xa0) { 449 if (offset+length > 0xa0) {
@@ -463,10 +464,10 @@ static void snd_emu_proc_ptr_reg_read(snd_info_entry_t *entry,
463 } 464 }
464} 465}
465 466
466static void snd_emu_proc_ptr_reg_write(snd_info_entry_t *entry, 467static void snd_emu_proc_ptr_reg_write(struct snd_info_entry *entry,
467 snd_info_buffer_t * buffer, int iobase) 468 struct snd_info_buffer *buffer, int iobase)
468{ 469{
469 emu10k1_t *emu = entry->private_data; 470 struct snd_emu10k1 *emu = entry->private_data;
470 char line[64]; 471 char line[64];
471 unsigned int reg, channel_id , val; 472 unsigned int reg, channel_id , val;
472 while (!snd_info_get_line(buffer, line, sizeof(line))) { 473 while (!snd_info_get_line(buffer, line, sizeof(line))) {
@@ -477,45 +478,45 @@ static void snd_emu_proc_ptr_reg_write(snd_info_entry_t *entry,
477 } 478 }
478} 479}
479 480
480static void snd_emu_proc_ptr_reg_write00(snd_info_entry_t *entry, 481static void snd_emu_proc_ptr_reg_write00(struct snd_info_entry *entry,
481 snd_info_buffer_t * buffer) 482 struct snd_info_buffer *buffer)
482{ 483{
483 snd_emu_proc_ptr_reg_write(entry, buffer, 0); 484 snd_emu_proc_ptr_reg_write(entry, buffer, 0);
484} 485}
485 486
486static void snd_emu_proc_ptr_reg_write20(snd_info_entry_t *entry, 487static void snd_emu_proc_ptr_reg_write20(struct snd_info_entry *entry,
487 snd_info_buffer_t * buffer) 488 struct snd_info_buffer *buffer)
488{ 489{
489 snd_emu_proc_ptr_reg_write(entry, buffer, 0x20); 490 snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
490} 491}
491 492
492 493
493static void snd_emu_proc_ptr_reg_read00a(snd_info_entry_t *entry, 494static void snd_emu_proc_ptr_reg_read00a(struct snd_info_entry *entry,
494 snd_info_buffer_t * buffer) 495 struct snd_info_buffer *buffer)
495{ 496{
496 snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40, 64); 497 snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0, 0x40, 64);
497} 498}
498 499
499static void snd_emu_proc_ptr_reg_read00b(snd_info_entry_t *entry, 500static void snd_emu_proc_ptr_reg_read00b(struct snd_info_entry *entry,
500 snd_info_buffer_t * buffer) 501 struct snd_info_buffer *buffer)
501{ 502{
502 snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40, 64); 503 snd_emu_proc_ptr_reg_read(entry, buffer, 0, 0x40, 0x40, 64);
503} 504}
504 505
505static void snd_emu_proc_ptr_reg_read20a(snd_info_entry_t *entry, 506static void snd_emu_proc_ptr_reg_read20a(struct snd_info_entry *entry,
506 snd_info_buffer_t * buffer) 507 struct snd_info_buffer *buffer)
507{ 508{
508 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40, 4); 509 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0, 0x40, 4);
509} 510}
510 511
511static void snd_emu_proc_ptr_reg_read20b(snd_info_entry_t *entry, 512static void snd_emu_proc_ptr_reg_read20b(struct snd_info_entry *entry,
512 snd_info_buffer_t * buffer) 513 struct snd_info_buffer *buffer)
513{ 514{
514 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40, 4); 515 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x40, 0x40, 4);
515} 516}
516 517
517static void snd_emu_proc_ptr_reg_read20c(snd_info_entry_t *entry, 518static void snd_emu_proc_ptr_reg_read20c(struct snd_info_entry *entry,
518 snd_info_buffer_t * buffer) 519 struct snd_info_buffer * buffer)
519{ 520{
520 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x80, 0x20, 4); 521 snd_emu_proc_ptr_reg_read(entry, buffer, 0x20, 0x80, 0x20, 4);
521} 522}
@@ -525,9 +526,9 @@ static struct snd_info_entry_ops snd_emu10k1_proc_ops_fx8010 = {
525 .read = snd_emu10k1_fx8010_read, 526 .read = snd_emu10k1_fx8010_read,
526}; 527};
527 528
528int __devinit snd_emu10k1_proc_init(emu10k1_t * emu) 529int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
529{ 530{
530 snd_info_entry_t *entry; 531 struct snd_info_entry *entry;
531#ifdef CONFIG_SND_DEBUG 532#ifdef CONFIG_SND_DEBUG
532 if (! snd_card_proc_new(emu->card, "io_regs", &entry)) { 533 if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {
533 snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_io_reg_read); 534 snd_info_set_text_ops(entry, emu, 1024, snd_emu_proc_io_reg_read);
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index b9d3ae0dcab7..5d116dd7403b 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -30,7 +30,7 @@
30#include <sound/core.h> 30#include <sound/core.h>
31#include <sound/emu10k1.h> 31#include <sound/emu10k1.h>
32 32
33unsigned int snd_emu10k1_ptr_read(emu10k1_t * emu, unsigned int reg, unsigned int chn) 33unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn)
34{ 34{
35 unsigned long flags; 35 unsigned long flags;
36 unsigned int regptr, val; 36 unsigned int regptr, val;
@@ -61,7 +61,7 @@ unsigned int snd_emu10k1_ptr_read(emu10k1_t * emu, unsigned int reg, unsigned in
61 } 61 }
62} 62}
63 63
64void snd_emu10k1_ptr_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data) 64void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data)
65{ 65{
66 unsigned int regptr; 66 unsigned int regptr;
67 unsigned long flags; 67 unsigned long flags;
@@ -91,7 +91,7 @@ void snd_emu10k1_ptr_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, u
91 } 91 }
92} 92}
93 93
94unsigned int snd_emu10k1_ptr20_read(emu10k1_t * emu, 94unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
95 unsigned int reg, 95 unsigned int reg,
96 unsigned int chn) 96 unsigned int chn)
97{ 97{
@@ -107,7 +107,7 @@ unsigned int snd_emu10k1_ptr20_read(emu10k1_t * emu,
107 return val; 107 return val;
108} 108}
109 109
110void snd_emu10k1_ptr20_write(emu10k1_t *emu, 110void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
111 unsigned int reg, 111 unsigned int reg,
112 unsigned int chn, 112 unsigned int chn,
113 unsigned int data) 113 unsigned int data)
@@ -123,7 +123,7 @@ void snd_emu10k1_ptr20_write(emu10k1_t *emu,
123 spin_unlock_irqrestore(&emu->emu_lock, flags); 123 spin_unlock_irqrestore(&emu->emu_lock, flags);
124} 124}
125 125
126void snd_emu10k1_intr_enable(emu10k1_t *emu, unsigned int intrenb) 126void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb)
127{ 127{
128 unsigned long flags; 128 unsigned long flags;
129 unsigned int enable; 129 unsigned int enable;
@@ -134,7 +134,7 @@ void snd_emu10k1_intr_enable(emu10k1_t *emu, unsigned int intrenb)
134 spin_unlock_irqrestore(&emu->emu_lock, flags); 134 spin_unlock_irqrestore(&emu->emu_lock, flags);
135} 135}
136 136
137void snd_emu10k1_intr_disable(emu10k1_t *emu, unsigned int intrenb) 137void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb)
138{ 138{
139 unsigned long flags; 139 unsigned long flags;
140 unsigned int enable; 140 unsigned int enable;
@@ -145,7 +145,7 @@ void snd_emu10k1_intr_disable(emu10k1_t *emu, unsigned int intrenb)
145 spin_unlock_irqrestore(&emu->emu_lock, flags); 145 spin_unlock_irqrestore(&emu->emu_lock, flags);
146} 146}
147 147
148void snd_emu10k1_voice_intr_enable(emu10k1_t *emu, unsigned int voicenum) 148void snd_emu10k1_voice_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum)
149{ 149{
150 unsigned long flags; 150 unsigned long flags;
151 unsigned int val; 151 unsigned int val;
@@ -165,7 +165,7 @@ void snd_emu10k1_voice_intr_enable(emu10k1_t *emu, unsigned int voicenum)
165 spin_unlock_irqrestore(&emu->emu_lock, flags); 165 spin_unlock_irqrestore(&emu->emu_lock, flags);
166} 166}
167 167
168void snd_emu10k1_voice_intr_disable(emu10k1_t *emu, unsigned int voicenum) 168void snd_emu10k1_voice_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum)
169{ 169{
170 unsigned long flags; 170 unsigned long flags;
171 unsigned int val; 171 unsigned int val;
@@ -185,7 +185,7 @@ void snd_emu10k1_voice_intr_disable(emu10k1_t *emu, unsigned int voicenum)
185 spin_unlock_irqrestore(&emu->emu_lock, flags); 185 spin_unlock_irqrestore(&emu->emu_lock, flags);
186} 186}
187 187
188void snd_emu10k1_voice_intr_ack(emu10k1_t *emu, unsigned int voicenum) 188void snd_emu10k1_voice_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum)
189{ 189{
190 unsigned long flags; 190 unsigned long flags;
191 191
@@ -202,7 +202,7 @@ void snd_emu10k1_voice_intr_ack(emu10k1_t *emu, unsigned int voicenum)
202 spin_unlock_irqrestore(&emu->emu_lock, flags); 202 spin_unlock_irqrestore(&emu->emu_lock, flags);
203} 203}
204 204
205void snd_emu10k1_voice_half_loop_intr_enable(emu10k1_t *emu, unsigned int voicenum) 205void snd_emu10k1_voice_half_loop_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum)
206{ 206{
207 unsigned long flags; 207 unsigned long flags;
208 unsigned int val; 208 unsigned int val;
@@ -222,7 +222,7 @@ void snd_emu10k1_voice_half_loop_intr_enable(emu10k1_t *emu, unsigned int voicen
222 spin_unlock_irqrestore(&emu->emu_lock, flags); 222 spin_unlock_irqrestore(&emu->emu_lock, flags);
223} 223}
224 224
225void snd_emu10k1_voice_half_loop_intr_disable(emu10k1_t *emu, unsigned int voicenum) 225void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum)
226{ 226{
227 unsigned long flags; 227 unsigned long flags;
228 unsigned int val; 228 unsigned int val;
@@ -242,7 +242,7 @@ void snd_emu10k1_voice_half_loop_intr_disable(emu10k1_t *emu, unsigned int voice
242 spin_unlock_irqrestore(&emu->emu_lock, flags); 242 spin_unlock_irqrestore(&emu->emu_lock, flags);
243} 243}
244 244
245void snd_emu10k1_voice_half_loop_intr_ack(emu10k1_t *emu, unsigned int voicenum) 245void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum)
246{ 246{
247 unsigned long flags; 247 unsigned long flags;
248 248
@@ -259,7 +259,7 @@ void snd_emu10k1_voice_half_loop_intr_ack(emu10k1_t *emu, unsigned int voicenum)
259 spin_unlock_irqrestore(&emu->emu_lock, flags); 259 spin_unlock_irqrestore(&emu->emu_lock, flags);
260} 260}
261 261
262void snd_emu10k1_voice_set_loop_stop(emu10k1_t *emu, unsigned int voicenum) 262void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum)
263{ 263{
264 unsigned long flags; 264 unsigned long flags;
265 unsigned int sol; 265 unsigned int sol;
@@ -279,7 +279,7 @@ void snd_emu10k1_voice_set_loop_stop(emu10k1_t *emu, unsigned int voicenum)
279 spin_unlock_irqrestore(&emu->emu_lock, flags); 279 spin_unlock_irqrestore(&emu->emu_lock, flags);
280} 280}
281 281
282void snd_emu10k1_voice_clear_loop_stop(emu10k1_t *emu, unsigned int voicenum) 282void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum)
283{ 283{
284 unsigned long flags; 284 unsigned long flags;
285 unsigned int sol; 285 unsigned int sol;
@@ -299,7 +299,7 @@ void snd_emu10k1_voice_clear_loop_stop(emu10k1_t *emu, unsigned int voicenum)
299 spin_unlock_irqrestore(&emu->emu_lock, flags); 299 spin_unlock_irqrestore(&emu->emu_lock, flags);
300} 300}
301 301
302void snd_emu10k1_wait(emu10k1_t *emu, unsigned int wait) 302void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait)
303{ 303{
304 volatile unsigned count; 304 volatile unsigned count;
305 unsigned int newtime = 0, curtime; 305 unsigned int newtime = 0, curtime;
@@ -318,9 +318,9 @@ void snd_emu10k1_wait(emu10k1_t *emu, unsigned int wait)
318 } 318 }
319} 319}
320 320
321unsigned short snd_emu10k1_ac97_read(ac97_t *ac97, unsigned short reg) 321unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
322{ 322{
323 emu10k1_t *emu = ac97->private_data; 323 struct snd_emu10k1 *emu = ac97->private_data;
324 unsigned long flags; 324 unsigned long flags;
325 unsigned short val; 325 unsigned short val;
326 326
@@ -331,9 +331,9 @@ unsigned short snd_emu10k1_ac97_read(ac97_t *ac97, unsigned short reg)
331 return val; 331 return val;
332} 332}
333 333
334void snd_emu10k1_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short data) 334void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data)
335{ 335{
336 emu10k1_t *emu = ac97->private_data; 336 struct snd_emu10k1 *emu = ac97->private_data;
337 unsigned long flags; 337 unsigned long flags;
338 338
339 spin_lock_irqsave(&emu->emu_lock, flags); 339 spin_lock_irqsave(&emu->emu_lock, flags);
diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
index 594ea063b140..a8b31286b6db 100644
--- a/sound/pci/emu10k1/irq.c
+++ b/sound/pci/emu10k1/irq.c
@@ -32,7 +32,7 @@
32 32
33irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs) 33irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
34{ 34{
35 emu10k1_t *emu = dev_id; 35 struct snd_emu10k1 *emu = dev_id;
36 unsigned int status, status2, orig_status, orig_status2; 36 unsigned int status, status2, orig_status, orig_status2;
37 int handled = 0; 37 int handled = 0;
38 38
@@ -56,7 +56,7 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
56 int voice; 56 int voice;
57 int voice_max = status & IPR_CHANNELNUMBERMASK; 57 int voice_max = status & IPR_CHANNELNUMBERMASK;
58 u32 val; 58 u32 val;
59 emu10k1_voice_t *pvoice = emu->voices; 59 struct snd_emu10k1_voice *pvoice = emu->voices;
60 60
61 val = snd_emu10k1_ptr_read(emu, CLIPL, 0); 61 val = snd_emu10k1_ptr_read(emu, CLIPL, 0);
62 for (voice = 0; voice <= voice_max; voice++) { 62 for (voice = 0; voice <= voice_max; voice++) {
@@ -150,8 +150,8 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs)
150 if (status & IPR_P16V) { 150 if (status & IPR_P16V) {
151 while ((status2 = inl(emu->port + IPR2)) != 0) { 151 while ((status2 = inl(emu->port + IPR2)) != 0) {
152 u32 mask = INTE2_PLAYBACK_CH_0_LOOP; /* Full Loop */ 152 u32 mask = INTE2_PLAYBACK_CH_0_LOOP; /* Full Loop */
153 emu10k1_voice_t *pvoice = &(emu->p16v_voices[0]); 153 struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]);
154 emu10k1_voice_t *cvoice = &(emu->p16v_capture_voice); 154 struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice);
155 155
156 //printk(KERN_INFO "status2=0x%x\n", status2); 156 //printk(KERN_INFO "status2=0x%x\n", status2);
157 orig_status2 = status2; 157 orig_status2 = status2;
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index d42e4aeaa73a..68c795c03109 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -48,7 +48,7 @@
48#define set_silent_ptb(emu,page) __set_ptb_entry(emu,page,emu->silent_page.addr) 48#define set_silent_ptb(emu,page) __set_ptb_entry(emu,page,emu->silent_page.addr)
49#else 49#else
50/* fill PTB entries -- we need to fill UNIT_PAGES entries */ 50/* fill PTB entries -- we need to fill UNIT_PAGES entries */
51static inline void set_ptb_entry(emu10k1_t *emu, int page, dma_addr_t addr) 51static inline void set_ptb_entry(struct snd_emu10k1 *emu, int page, dma_addr_t addr)
52{ 52{
53 int i; 53 int i;
54 page *= UNIT_PAGES; 54 page *= UNIT_PAGES;
@@ -57,7 +57,7 @@ static inline void set_ptb_entry(emu10k1_t *emu, int page, dma_addr_t addr)
57 addr += EMUPAGESIZE; 57 addr += EMUPAGESIZE;
58 } 58 }
59} 59}
60static inline void set_silent_ptb(emu10k1_t *emu, int page) 60static inline void set_silent_ptb(struct snd_emu10k1 *emu, int page)
61{ 61{
62 int i; 62 int i;
63 page *= UNIT_PAGES; 63 page *= UNIT_PAGES;
@@ -70,14 +70,14 @@ static inline void set_silent_ptb(emu10k1_t *emu, int page)
70 70
71/* 71/*
72 */ 72 */
73static int synth_alloc_pages(emu10k1_t *hw, emu10k1_memblk_t *blk); 73static int synth_alloc_pages(struct snd_emu10k1 *hw, struct snd_emu10k1_memblk *blk);
74static int synth_free_pages(emu10k1_t *hw, emu10k1_memblk_t *blk); 74static int synth_free_pages(struct snd_emu10k1 *hw, struct snd_emu10k1_memblk *blk);
75 75
76#define get_emu10k1_memblk(l,member) list_entry(l, emu10k1_memblk_t, member) 76#define get_emu10k1_memblk(l,member) list_entry(l, struct snd_emu10k1_memblk, member)
77 77
78 78
79/* initialize emu10k1 part */ 79/* initialize emu10k1 part */
80static void emu10k1_memblk_init(emu10k1_memblk_t *blk) 80static void emu10k1_memblk_init(struct snd_emu10k1_memblk *blk)
81{ 81{
82 blk->mapped_page = -1; 82 blk->mapped_page = -1;
83 INIT_LIST_HEAD(&blk->mapped_link); 83 INIT_LIST_HEAD(&blk->mapped_link);
@@ -96,7 +96,7 @@ static void emu10k1_memblk_init(emu10k1_memblk_t *blk)
96 * in nextp 96 * in nextp
97 * if not found, return a negative error code. 97 * if not found, return a negative error code.
98 */ 98 */
99static int search_empty_map_area(emu10k1_t *emu, int npages, struct list_head **nextp) 99static int search_empty_map_area(struct snd_emu10k1 *emu, int npages, struct list_head **nextp)
100{ 100{
101 int page = 0, found_page = -ENOMEM; 101 int page = 0, found_page = -ENOMEM;
102 int max_size = npages; 102 int max_size = npages;
@@ -105,7 +105,7 @@ static int search_empty_map_area(emu10k1_t *emu, int npages, struct list_head **
105 struct list_head *pos; 105 struct list_head *pos;
106 106
107 list_for_each (pos, &emu->mapped_link_head) { 107 list_for_each (pos, &emu->mapped_link_head) {
108 emu10k1_memblk_t *blk = get_emu10k1_memblk(pos, mapped_link); 108 struct snd_emu10k1_memblk *blk = get_emu10k1_memblk(pos, mapped_link);
109 snd_assert(blk->mapped_page >= 0, continue); 109 snd_assert(blk->mapped_page >= 0, continue);
110 size = blk->mapped_page - page; 110 size = blk->mapped_page - page;
111 if (size == npages) { 111 if (size == npages) {
@@ -134,7 +134,7 @@ static int search_empty_map_area(emu10k1_t *emu, int npages, struct list_head **
134 * 134 *
135 * call with memblk_lock held 135 * call with memblk_lock held
136 */ 136 */
137static int map_memblk(emu10k1_t *emu, emu10k1_memblk_t *blk) 137static int map_memblk(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk)
138{ 138{
139 int page, pg; 139 int page, pg;
140 struct list_head *next; 140 struct list_head *next;
@@ -161,11 +161,11 @@ static int map_memblk(emu10k1_t *emu, emu10k1_memblk_t *blk)
161 * 161 *
162 * call with memblk_lock held 162 * call with memblk_lock held
163 */ 163 */
164static int unmap_memblk(emu10k1_t *emu, emu10k1_memblk_t *blk) 164static int unmap_memblk(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk)
165{ 165{
166 int start_page, end_page, mpage, pg; 166 int start_page, end_page, mpage, pg;
167 struct list_head *p; 167 struct list_head *p;
168 emu10k1_memblk_t *q; 168 struct snd_emu10k1_memblk *q;
169 169
170 /* calculate the expected size of empty region */ 170 /* calculate the expected size of empty region */
171 if ((p = blk->mapped_link.prev) != &emu->mapped_link_head) { 171 if ((p = blk->mapped_link.prev) != &emu->mapped_link_head) {
@@ -197,11 +197,11 @@ static int unmap_memblk(emu10k1_t *emu, emu10k1_memblk_t *blk)
197 * 197 *
198 * unlike synth_alloc the memory block is aligned to the page start 198 * unlike synth_alloc the memory block is aligned to the page start
199 */ 199 */
200static emu10k1_memblk_t * 200static struct snd_emu10k1_memblk *
201search_empty(emu10k1_t *emu, int size) 201search_empty(struct snd_emu10k1 *emu, int size)
202{ 202{
203 struct list_head *p; 203 struct list_head *p;
204 emu10k1_memblk_t *blk; 204 struct snd_emu10k1_memblk *blk;
205 int page, psize; 205 int page, psize;
206 206
207 psize = get_aligned_page(size + PAGE_SIZE -1); 207 psize = get_aligned_page(size + PAGE_SIZE -1);
@@ -217,7 +217,7 @@ search_empty(emu10k1_t *emu, int size)
217 217
218__found_pages: 218__found_pages:
219 /* create a new memory block */ 219 /* create a new memory block */
220 blk = (emu10k1_memblk_t *)__snd_util_memblk_new(emu->memhdr, psize << PAGE_SHIFT, p->prev); 220 blk = (struct snd_emu10k1_memblk *)__snd_util_memblk_new(emu->memhdr, psize << PAGE_SHIFT, p->prev);
221 if (blk == NULL) 221 if (blk == NULL)
222 return NULL; 222 return NULL;
223 blk->mem.offset = aligned_page_offset(page); /* set aligned offset */ 223 blk->mem.offset = aligned_page_offset(page); /* set aligned offset */
@@ -229,7 +229,7 @@ __found_pages:
229/* 229/*
230 * check if the given pointer is valid for pages 230 * check if the given pointer is valid for pages
231 */ 231 */
232static int is_valid_page(emu10k1_t *emu, dma_addr_t addr) 232static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr)
233{ 233{
234 if (addr & ~emu->dma_mask) { 234 if (addr & ~emu->dma_mask) {
235 snd_printk(KERN_ERR "max memory size is 0x%lx (addr = 0x%lx)!!\n", emu->dma_mask, (unsigned long)addr); 235 snd_printk(KERN_ERR "max memory size is 0x%lx (addr = 0x%lx)!!\n", emu->dma_mask, (unsigned long)addr);
@@ -248,12 +248,12 @@ static int is_valid_page(emu10k1_t *emu, dma_addr_t addr)
248 * if no empty pages are found, tries to release unsed memory blocks 248 * if no empty pages are found, tries to release unsed memory blocks
249 * and retry the mapping. 249 * and retry the mapping.
250 */ 250 */
251int snd_emu10k1_memblk_map(emu10k1_t *emu, emu10k1_memblk_t *blk) 251int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk)
252{ 252{
253 int err; 253 int err;
254 int size; 254 int size;
255 struct list_head *p, *nextp; 255 struct list_head *p, *nextp;
256 emu10k1_memblk_t *deleted; 256 struct snd_emu10k1_memblk *deleted;
257 unsigned long flags; 257 unsigned long flags;
258 258
259 spin_lock_irqsave(&emu->memblk_lock, flags); 259 spin_lock_irqsave(&emu->memblk_lock, flags);
@@ -288,13 +288,13 @@ int snd_emu10k1_memblk_map(emu10k1_t *emu, emu10k1_memblk_t *blk)
288/* 288/*
289 * page allocation for DMA 289 * page allocation for DMA
290 */ 290 */
291snd_util_memblk_t * 291struct snd_util_memblk *
292snd_emu10k1_alloc_pages(emu10k1_t *emu, snd_pcm_substream_t *substream) 292snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream)
293{ 293{
294 snd_pcm_runtime_t *runtime = substream->runtime; 294 struct snd_pcm_runtime *runtime = substream->runtime;
295 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); 295 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream);
296 snd_util_memhdr_t *hdr; 296 struct snd_util_memhdr *hdr;
297 emu10k1_memblk_t *blk; 297 struct snd_emu10k1_memblk *blk;
298 int page, err, idx; 298 int page, err, idx;
299 299
300 snd_assert(emu, return NULL); 300 snd_assert(emu, return NULL);
@@ -336,19 +336,19 @@ snd_emu10k1_alloc_pages(emu10k1_t *emu, snd_pcm_substream_t *substream)
336 blk->map_locked = 1; /* do not unmap this block! */ 336 blk->map_locked = 1; /* do not unmap this block! */
337 err = snd_emu10k1_memblk_map(emu, blk); 337 err = snd_emu10k1_memblk_map(emu, blk);
338 if (err < 0) { 338 if (err < 0) {
339 __snd_util_mem_free(hdr, (snd_util_memblk_t *)blk); 339 __snd_util_mem_free(hdr, (struct snd_util_memblk *)blk);
340 up(&hdr->block_mutex); 340 up(&hdr->block_mutex);
341 return NULL; 341 return NULL;
342 } 342 }
343 up(&hdr->block_mutex); 343 up(&hdr->block_mutex);
344 return (snd_util_memblk_t *)blk; 344 return (struct snd_util_memblk *)blk;
345} 345}
346 346
347 347
348/* 348/*
349 * release DMA buffer from page table 349 * release DMA buffer from page table
350 */ 350 */
351int snd_emu10k1_free_pages(emu10k1_t *emu, snd_util_memblk_t *blk) 351int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, struct snd_util_memblk *blk)
352{ 352{
353 snd_assert(emu && blk, return -EINVAL); 353 snd_assert(emu && blk, return -EINVAL);
354 return snd_emu10k1_synth_free(emu, blk); 354 return snd_emu10k1_synth_free(emu, blk);
@@ -363,26 +363,26 @@ int snd_emu10k1_free_pages(emu10k1_t *emu, snd_util_memblk_t *blk)
363/* 363/*
364 * allocate a synth sample area 364 * allocate a synth sample area
365 */ 365 */
366snd_util_memblk_t * 366struct snd_util_memblk *
367snd_emu10k1_synth_alloc(emu10k1_t *hw, unsigned int size) 367snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size)
368{ 368{
369 emu10k1_memblk_t *blk; 369 struct snd_emu10k1_memblk *blk;
370 snd_util_memhdr_t *hdr = hw->memhdr; 370 struct snd_util_memhdr *hdr = hw->memhdr;
371 371
372 down(&hdr->block_mutex); 372 down(&hdr->block_mutex);
373 blk = (emu10k1_memblk_t *)__snd_util_mem_alloc(hdr, size); 373 blk = (struct snd_emu10k1_memblk *)__snd_util_mem_alloc(hdr, size);
374 if (blk == NULL) { 374 if (blk == NULL) {
375 up(&hdr->block_mutex); 375 up(&hdr->block_mutex);
376 return NULL; 376 return NULL;
377 } 377 }
378 if (synth_alloc_pages(hw, blk)) { 378 if (synth_alloc_pages(hw, blk)) {
379 __snd_util_mem_free(hdr, (snd_util_memblk_t *)blk); 379 __snd_util_mem_free(hdr, (struct snd_util_memblk *)blk);
380 up(&hdr->block_mutex); 380 up(&hdr->block_mutex);
381 return NULL; 381 return NULL;
382 } 382 }
383 snd_emu10k1_memblk_map(hw, blk); 383 snd_emu10k1_memblk_map(hw, blk);
384 up(&hdr->block_mutex); 384 up(&hdr->block_mutex);
385 return (snd_util_memblk_t *)blk; 385 return (struct snd_util_memblk *)blk;
386} 386}
387 387
388 388
@@ -390,10 +390,10 @@ snd_emu10k1_synth_alloc(emu10k1_t *hw, unsigned int size)
390 * free a synth sample area 390 * free a synth sample area
391 */ 391 */
392int 392int
393snd_emu10k1_synth_free(emu10k1_t *emu, snd_util_memblk_t *memblk) 393snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *memblk)
394{ 394{
395 snd_util_memhdr_t *hdr = emu->memhdr; 395 struct snd_util_memhdr *hdr = emu->memhdr;
396 emu10k1_memblk_t *blk = (emu10k1_memblk_t *)memblk; 396 struct snd_emu10k1_memblk *blk = (struct snd_emu10k1_memblk *)memblk;
397 unsigned long flags; 397 unsigned long flags;
398 398
399 down(&hdr->block_mutex); 399 down(&hdr->block_mutex);
@@ -409,10 +409,12 @@ snd_emu10k1_synth_free(emu10k1_t *emu, snd_util_memblk_t *memblk)
409 409
410 410
411/* check new allocation range */ 411/* check new allocation range */
412static void get_single_page_range(snd_util_memhdr_t *hdr, emu10k1_memblk_t *blk, int *first_page_ret, int *last_page_ret) 412static void get_single_page_range(struct snd_util_memhdr *hdr,
413 struct snd_emu10k1_memblk *blk,
414 int *first_page_ret, int *last_page_ret)
413{ 415{
414 struct list_head *p; 416 struct list_head *p;
415 emu10k1_memblk_t *q; 417 struct snd_emu10k1_memblk *q;
416 int first_page, last_page; 418 int first_page, last_page;
417 first_page = blk->first_page; 419 first_page = blk->first_page;
418 if ((p = blk->mem.list.prev) != &hdr->block) { 420 if ((p = blk->mem.list.prev) != &hdr->block) {
@@ -433,7 +435,7 @@ static void get_single_page_range(snd_util_memhdr_t *hdr, emu10k1_memblk_t *blk,
433/* 435/*
434 * allocate kernel pages 436 * allocate kernel pages
435 */ 437 */
436static int synth_alloc_pages(emu10k1_t *emu, emu10k1_memblk_t *blk) 438static int synth_alloc_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk)
437{ 439{
438 int page, first_page, last_page; 440 int page, first_page, last_page;
439 struct snd_dma_buffer dmab; 441 struct snd_dma_buffer dmab;
@@ -472,7 +474,7 @@ __fail:
472/* 474/*
473 * free pages 475 * free pages
474 */ 476 */
475static int synth_free_pages(emu10k1_t *emu, emu10k1_memblk_t *blk) 477static int synth_free_pages(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk)
476{ 478{
477 int page, first_page, last_page; 479 int page, first_page, last_page;
478 struct snd_dma_buffer dmab; 480 struct snd_dma_buffer dmab;
@@ -495,7 +497,7 @@ static int synth_free_pages(emu10k1_t *emu, emu10k1_memblk_t *blk)
495} 497}
496 498
497/* calculate buffer pointer from offset address */ 499/* calculate buffer pointer from offset address */
498static inline void *offset_ptr(emu10k1_t *emu, int page, int offset) 500static inline void *offset_ptr(struct snd_emu10k1 *emu, int page, int offset)
499{ 501{
500 char *ptr; 502 char *ptr;
501 snd_assert(page >= 0 && page < emu->max_cache_pages, return NULL); 503 snd_assert(page >= 0 && page < emu->max_cache_pages, return NULL);
@@ -511,11 +513,12 @@ static inline void *offset_ptr(emu10k1_t *emu, int page, int offset)
511/* 513/*
512 * bzero(blk + offset, size) 514 * bzero(blk + offset, size)
513 */ 515 */
514int snd_emu10k1_synth_bzero(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, int size) 516int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk,
517 int offset, int size)
515{ 518{
516 int page, nextofs, end_offset, temp, temp1; 519 int page, nextofs, end_offset, temp, temp1;
517 void *ptr; 520 void *ptr;
518 emu10k1_memblk_t *p = (emu10k1_memblk_t *)blk; 521 struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk;
519 522
520 offset += blk->offset & (PAGE_SIZE - 1); 523 offset += blk->offset & (PAGE_SIZE - 1);
521 end_offset = offset + size; 524 end_offset = offset + size;
@@ -538,11 +541,12 @@ int snd_emu10k1_synth_bzero(emu10k1_t *emu, snd_util_memblk_t *blk, int offset,
538/* 541/*
539 * copy_from_user(blk + offset, data, size) 542 * copy_from_user(blk + offset, data, size)
540 */ 543 */
541int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char __user *data, int size) 544int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_memblk *blk,
545 int offset, const char __user *data, int size)
542{ 546{
543 int page, nextofs, end_offset, temp, temp1; 547 int page, nextofs, end_offset, temp, temp1;
544 void *ptr; 548 void *ptr;
545 emu10k1_memblk_t *p = (emu10k1_memblk_t *)blk; 549 struct snd_emu10k1_memblk *p = (struct snd_emu10k1_memblk *)blk;
546 550
547 offset += blk->offset & (PAGE_SIZE - 1); 551 offset += blk->offset & (PAGE_SIZE - 1);
548 end_offset = offset + size; 552 end_offset = offset + size;
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index 3b456007ba2a..90470de8bb8e 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -121,7 +121,7 @@
121 */ 121 */
122 122
123 /* hardware definition */ 123 /* hardware definition */
124static snd_pcm_hardware_t snd_p16v_playback_hw = { 124static struct snd_pcm_hardware snd_p16v_playback_hw = {
125 .info = (SNDRV_PCM_INFO_MMAP | 125 .info = (SNDRV_PCM_INFO_MMAP |
126 SNDRV_PCM_INFO_INTERLEAVED | 126 SNDRV_PCM_INFO_INTERLEAVED |
127 SNDRV_PCM_INFO_BLOCK_TRANSFER | 127 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -140,7 +140,7 @@ static snd_pcm_hardware_t snd_p16v_playback_hw = {
140 .fifo_size = 0, 140 .fifo_size = 0,
141}; 141};
142 142
143static snd_pcm_hardware_t snd_p16v_capture_hw = { 143static struct snd_pcm_hardware snd_p16v_capture_hw = {
144 .info = (SNDRV_PCM_INFO_MMAP | 144 .info = (SNDRV_PCM_INFO_MMAP |
145 SNDRV_PCM_INFO_INTERLEAVED | 145 SNDRV_PCM_INFO_INTERLEAVED |
146 SNDRV_PCM_INFO_BLOCK_TRANSFER | 146 SNDRV_PCM_INFO_BLOCK_TRANSFER |
@@ -159,9 +159,9 @@ static snd_pcm_hardware_t snd_p16v_capture_hw = {
159 .fifo_size = 0, 159 .fifo_size = 0,
160}; 160};
161 161
162static void snd_p16v_pcm_free_substream(snd_pcm_runtime_t *runtime) 162static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime)
163{ 163{
164 emu10k1_pcm_t *epcm = runtime->private_data; 164 struct snd_emu10k1_pcm *epcm = runtime->private_data;
165 165
166 if (epcm) { 166 if (epcm) {
167 //snd_printk("epcm free: %p\n", epcm); 167 //snd_printk("epcm free: %p\n", epcm);
@@ -170,12 +170,12 @@ static void snd_p16v_pcm_free_substream(snd_pcm_runtime_t *runtime)
170} 170}
171 171
172/* open_playback callback */ 172/* open_playback callback */
173static int snd_p16v_pcm_open_playback_channel(snd_pcm_substream_t *substream, int channel_id) 173static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substream, int channel_id)
174{ 174{
175 emu10k1_t *emu = snd_pcm_substream_chip(substream); 175 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
176 emu10k1_voice_t *channel = &(emu->p16v_voices[channel_id]); 176 struct snd_emu10k1_voice *channel = &(emu->p16v_voices[channel_id]);
177 emu10k1_pcm_t *epcm; 177 struct snd_emu10k1_pcm *epcm;
178 snd_pcm_runtime_t *runtime = substream->runtime; 178 struct snd_pcm_runtime *runtime = substream->runtime;
179 int err; 179 int err;
180 180
181 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 181 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
@@ -206,12 +206,12 @@ static int snd_p16v_pcm_open_playback_channel(snd_pcm_substream_t *substream, in
206 return 0; 206 return 0;
207} 207}
208/* open_capture callback */ 208/* open_capture callback */
209static int snd_p16v_pcm_open_capture_channel(snd_pcm_substream_t *substream, int channel_id) 209static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream, int channel_id)
210{ 210{
211 emu10k1_t *emu = snd_pcm_substream_chip(substream); 211 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
212 emu10k1_voice_t *channel = &(emu->p16v_capture_voice); 212 struct snd_emu10k1_voice *channel = &(emu->p16v_capture_voice);
213 emu10k1_pcm_t *epcm; 213 struct snd_emu10k1_pcm *epcm;
214 snd_pcm_runtime_t *runtime = substream->runtime; 214 struct snd_pcm_runtime *runtime = substream->runtime;
215 int err; 215 int err;
216 216
217 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 217 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
@@ -244,41 +244,41 @@ static int snd_p16v_pcm_open_capture_channel(snd_pcm_substream_t *substream, int
244 244
245 245
246/* close callback */ 246/* close callback */
247static int snd_p16v_pcm_close_playback(snd_pcm_substream_t *substream) 247static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)
248{ 248{
249 emu10k1_t *emu = snd_pcm_substream_chip(substream); 249 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
250 //snd_pcm_runtime_t *runtime = substream->runtime; 250 //struct snd_pcm_runtime *runtime = substream->runtime;
251 //emu10k1_pcm_t *epcm = runtime->private_data; 251 //struct snd_emu10k1_pcm *epcm = runtime->private_data;
252 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use=0; 252 emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use=0;
253 /* FIXME: maybe zero others */ 253 /* FIXME: maybe zero others */
254 return 0; 254 return 0;
255} 255}
256 256
257/* close callback */ 257/* close callback */
258static int snd_p16v_pcm_close_capture(snd_pcm_substream_t *substream) 258static int snd_p16v_pcm_close_capture(struct snd_pcm_substream *substream)
259{ 259{
260 emu10k1_t *emu = snd_pcm_substream_chip(substream); 260 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
261 //snd_pcm_runtime_t *runtime = substream->runtime; 261 //struct snd_pcm_runtime *runtime = substream->runtime;
262 //emu10k1_pcm_t *epcm = runtime->private_data; 262 //struct snd_emu10k1_pcm *epcm = runtime->private_data;
263 emu->p16v_capture_voice.use=0; 263 emu->p16v_capture_voice.use=0;
264 /* FIXME: maybe zero others */ 264 /* FIXME: maybe zero others */
265 return 0; 265 return 0;
266} 266}
267 267
268static int snd_p16v_pcm_open_playback_front(snd_pcm_substream_t *substream) 268static int snd_p16v_pcm_open_playback_front(struct snd_pcm_substream *substream)
269{ 269{
270 return snd_p16v_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL); 270 return snd_p16v_pcm_open_playback_channel(substream, PCM_FRONT_CHANNEL);
271} 271}
272 272
273static int snd_p16v_pcm_open_capture(snd_pcm_substream_t *substream) 273static int snd_p16v_pcm_open_capture(struct snd_pcm_substream *substream)
274{ 274{
275 // Only using channel 0 for now, but the card has 2 channels. 275 // Only using channel 0 for now, but the card has 2 channels.
276 return snd_p16v_pcm_open_capture_channel(substream, 0); 276 return snd_p16v_pcm_open_capture_channel(substream, 0);
277} 277}
278 278
279/* hw_params callback */ 279/* hw_params callback */
280static int snd_p16v_pcm_hw_params_playback(snd_pcm_substream_t *substream, 280static int snd_p16v_pcm_hw_params_playback(struct snd_pcm_substream *substream,
281 snd_pcm_hw_params_t * hw_params) 281 struct snd_pcm_hw_params *hw_params)
282{ 282{
283 int result; 283 int result;
284 result = snd_pcm_lib_malloc_pages(substream, 284 result = snd_pcm_lib_malloc_pages(substream,
@@ -287,8 +287,8 @@ static int snd_p16v_pcm_hw_params_playback(snd_pcm_substream_t *substream,
287} 287}
288 288
289/* hw_params callback */ 289/* hw_params callback */
290static int snd_p16v_pcm_hw_params_capture(snd_pcm_substream_t *substream, 290static int snd_p16v_pcm_hw_params_capture(struct snd_pcm_substream *substream,
291 snd_pcm_hw_params_t * hw_params) 291 struct snd_pcm_hw_params *hw_params)
292{ 292{
293 int result; 293 int result;
294 result = snd_pcm_lib_malloc_pages(substream, 294 result = snd_pcm_lib_malloc_pages(substream,
@@ -298,7 +298,7 @@ static int snd_p16v_pcm_hw_params_capture(snd_pcm_substream_t *substream,
298 298
299 299
300/* hw_free callback */ 300/* hw_free callback */
301static int snd_p16v_pcm_hw_free_playback(snd_pcm_substream_t *substream) 301static int snd_p16v_pcm_hw_free_playback(struct snd_pcm_substream *substream)
302{ 302{
303 int result; 303 int result;
304 result = snd_pcm_lib_free_pages(substream); 304 result = snd_pcm_lib_free_pages(substream);
@@ -306,7 +306,7 @@ static int snd_p16v_pcm_hw_free_playback(snd_pcm_substream_t *substream)
306} 306}
307 307
308/* hw_free callback */ 308/* hw_free callback */
309static int snd_p16v_pcm_hw_free_capture(snd_pcm_substream_t *substream) 309static int snd_p16v_pcm_hw_free_capture(struct snd_pcm_substream *substream)
310{ 310{
311 int result; 311 int result;
312 result = snd_pcm_lib_free_pages(substream); 312 result = snd_pcm_lib_free_pages(substream);
@@ -315,10 +315,10 @@ static int snd_p16v_pcm_hw_free_capture(snd_pcm_substream_t *substream)
315 315
316 316
317/* prepare playback callback */ 317/* prepare playback callback */
318static int snd_p16v_pcm_prepare_playback(snd_pcm_substream_t *substream) 318static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
319{ 319{
320 emu10k1_t *emu = snd_pcm_substream_chip(substream); 320 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
321 snd_pcm_runtime_t *runtime = substream->runtime; 321 struct snd_pcm_runtime *runtime = substream->runtime;
322 int channel = substream->pcm->device - emu->p16v_device_offset; 322 int channel = substream->pcm->device - emu->p16v_device_offset;
323 u32 *table_base = (u32 *)(emu->p16v_buffer.area+(8*16*channel)); 323 u32 *table_base = (u32 *)(emu->p16v_buffer.area+(8*16*channel));
324 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size); 324 u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
@@ -364,10 +364,10 @@ static int snd_p16v_pcm_prepare_playback(snd_pcm_substream_t *substream)
364} 364}
365 365
366/* prepare capture callback */ 366/* prepare capture callback */
367static int snd_p16v_pcm_prepare_capture(snd_pcm_substream_t *substream) 367static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
368{ 368{
369 emu10k1_t *emu = snd_pcm_substream_chip(substream); 369 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
370 snd_pcm_runtime_t *runtime = substream->runtime; 370 struct snd_pcm_runtime *runtime = substream->runtime;
371 int channel = substream->pcm->device - emu->p16v_device_offset; 371 int channel = substream->pcm->device - emu->p16v_device_offset;
372 u32 tmp; 372 u32 tmp;
373 //printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); 373 //printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1));
@@ -398,7 +398,7 @@ static int snd_p16v_pcm_prepare_capture(snd_pcm_substream_t *substream)
398 return 0; 398 return 0;
399} 399}
400 400
401static void snd_p16v_intr_enable(emu10k1_t *emu, unsigned int intrenb) 401static void snd_p16v_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb)
402{ 402{
403 unsigned long flags; 403 unsigned long flags;
404 unsigned int enable; 404 unsigned int enable;
@@ -409,7 +409,7 @@ static void snd_p16v_intr_enable(emu10k1_t *emu, unsigned int intrenb)
409 spin_unlock_irqrestore(&emu->emu_lock, flags); 409 spin_unlock_irqrestore(&emu->emu_lock, flags);
410} 410}
411 411
412static void snd_p16v_intr_disable(emu10k1_t *emu, unsigned int intrenb) 412static void snd_p16v_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb)
413{ 413{
414 unsigned long flags; 414 unsigned long flags;
415 unsigned int disable; 415 unsigned int disable;
@@ -421,16 +421,16 @@ static void snd_p16v_intr_disable(emu10k1_t *emu, unsigned int intrenb)
421} 421}
422 422
423/* trigger_playback callback */ 423/* trigger_playback callback */
424static int snd_p16v_pcm_trigger_playback(snd_pcm_substream_t *substream, 424static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
425 int cmd) 425 int cmd)
426{ 426{
427 emu10k1_t *emu = snd_pcm_substream_chip(substream); 427 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
428 snd_pcm_runtime_t *runtime; 428 struct snd_pcm_runtime *runtime;
429 emu10k1_pcm_t *epcm; 429 struct snd_emu10k1_pcm *epcm;
430 int channel; 430 int channel;
431 int result = 0; 431 int result = 0;
432 struct list_head *pos; 432 struct list_head *pos;
433 snd_pcm_substream_t *s; 433 struct snd_pcm_substream *s;
434 u32 basic = 0; 434 u32 basic = 0;
435 u32 inte = 0; 435 u32 inte = 0;
436 int running=0; 436 int running=0;
@@ -474,12 +474,12 @@ static int snd_p16v_pcm_trigger_playback(snd_pcm_substream_t *substream,
474} 474}
475 475
476/* trigger_capture callback */ 476/* trigger_capture callback */
477static int snd_p16v_pcm_trigger_capture(snd_pcm_substream_t *substream, 477static int snd_p16v_pcm_trigger_capture(struct snd_pcm_substream *substream,
478 int cmd) 478 int cmd)
479{ 479{
480 emu10k1_t *emu = snd_pcm_substream_chip(substream); 480 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
481 snd_pcm_runtime_t *runtime = substream->runtime; 481 struct snd_pcm_runtime *runtime = substream->runtime;
482 emu10k1_pcm_t *epcm = runtime->private_data; 482 struct snd_emu10k1_pcm *epcm = runtime->private_data;
483 int channel = 0; 483 int channel = 0;
484 int result = 0; 484 int result = 0;
485 u32 inte = INTE2_CAPTURE_CH_0_LOOP | INTE2_CAPTURE_CH_0_HALF_LOOP; 485 u32 inte = INTE2_CAPTURE_CH_0_LOOP | INTE2_CAPTURE_CH_0_HALF_LOOP;
@@ -505,11 +505,11 @@ static int snd_p16v_pcm_trigger_capture(snd_pcm_substream_t *substream,
505 505
506/* pointer_playback callback */ 506/* pointer_playback callback */
507static snd_pcm_uframes_t 507static snd_pcm_uframes_t
508snd_p16v_pcm_pointer_playback(snd_pcm_substream_t *substream) 508snd_p16v_pcm_pointer_playback(struct snd_pcm_substream *substream)
509{ 509{
510 emu10k1_t *emu = snd_pcm_substream_chip(substream); 510 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
511 snd_pcm_runtime_t *runtime = substream->runtime; 511 struct snd_pcm_runtime *runtime = substream->runtime;
512 emu10k1_pcm_t *epcm = runtime->private_data; 512 struct snd_emu10k1_pcm *epcm = runtime->private_data;
513 snd_pcm_uframes_t ptr, ptr1, ptr2,ptr3,ptr4 = 0; 513 snd_pcm_uframes_t ptr, ptr1, ptr2,ptr3,ptr4 = 0;
514 int channel = substream->pcm->device - emu->p16v_device_offset; 514 int channel = substream->pcm->device - emu->p16v_device_offset;
515 if (!epcm->running) 515 if (!epcm->running)
@@ -530,11 +530,11 @@ snd_p16v_pcm_pointer_playback(snd_pcm_substream_t *substream)
530 530
531/* pointer_capture callback */ 531/* pointer_capture callback */
532static snd_pcm_uframes_t 532static snd_pcm_uframes_t
533snd_p16v_pcm_pointer_capture(snd_pcm_substream_t *substream) 533snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream)
534{ 534{
535 emu10k1_t *emu = snd_pcm_substream_chip(substream); 535 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
536 snd_pcm_runtime_t *runtime = substream->runtime; 536 struct snd_pcm_runtime *runtime = substream->runtime;
537 emu10k1_pcm_t *epcm = runtime->private_data; 537 struct snd_emu10k1_pcm *epcm = runtime->private_data;
538 snd_pcm_uframes_t ptr, ptr1, ptr2 = 0; 538 snd_pcm_uframes_t ptr, ptr1, ptr2 = 0;
539 int channel = 0; 539 int channel = 0;
540 540
@@ -554,7 +554,7 @@ snd_p16v_pcm_pointer_capture(snd_pcm_substream_t *substream)
554} 554}
555 555
556/* operators */ 556/* operators */
557static snd_pcm_ops_t snd_p16v_playback_front_ops = { 557static struct snd_pcm_ops snd_p16v_playback_front_ops = {
558 .open = snd_p16v_pcm_open_playback_front, 558 .open = snd_p16v_pcm_open_playback_front,
559 .close = snd_p16v_pcm_close_playback, 559 .close = snd_p16v_pcm_close_playback,
560 .ioctl = snd_pcm_lib_ioctl, 560 .ioctl = snd_pcm_lib_ioctl,
@@ -565,7 +565,7 @@ static snd_pcm_ops_t snd_p16v_playback_front_ops = {
565 .pointer = snd_p16v_pcm_pointer_playback, 565 .pointer = snd_p16v_pcm_pointer_playback,
566}; 566};
567 567
568static snd_pcm_ops_t snd_p16v_capture_ops = { 568static struct snd_pcm_ops snd_p16v_capture_ops = {
569 .open = snd_p16v_pcm_open_capture, 569 .open = snd_p16v_pcm_open_capture,
570 .close = snd_p16v_pcm_close_capture, 570 .close = snd_p16v_pcm_close_capture,
571 .ioctl = snd_pcm_lib_ioctl, 571 .ioctl = snd_pcm_lib_ioctl,
@@ -577,7 +577,7 @@ static snd_pcm_ops_t snd_p16v_capture_ops = {
577}; 577};
578 578
579 579
580int snd_p16v_free(emu10k1_t *chip) 580int snd_p16v_free(struct snd_emu10k1 *chip)
581{ 581{
582 // release the data 582 // release the data
583 if (chip->p16v_buffer.area) { 583 if (chip->p16v_buffer.area) {
@@ -587,10 +587,10 @@ int snd_p16v_free(emu10k1_t *chip)
587 return 0; 587 return 0;
588} 588}
589 589
590int snd_p16v_pcm(emu10k1_t *emu, int device, snd_pcm_t **rpcm) 590int snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm **rpcm)
591{ 591{
592 snd_pcm_t *pcm; 592 struct snd_pcm *pcm;
593 snd_pcm_substream_t *substream; 593 struct snd_pcm_substream *substream;
594 int err; 594 int err;
595 int capture=1; 595 int capture=1;
596 596
@@ -641,7 +641,7 @@ int snd_p16v_pcm(emu10k1_t *emu, int device, snd_pcm_t **rpcm)
641 return 0; 641 return 0;
642} 642}
643 643
644static int snd_p16v_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 644static int snd_p16v_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
645{ 645{
646 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 646 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
647 uinfo->count = 2; 647 uinfo->count = 2;
@@ -650,10 +650,10 @@ static int snd_p16v_volume_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *
650 return 0; 650 return 0;
651} 651}
652 652
653static int snd_p16v_volume_get(snd_kcontrol_t * kcontrol, 653static int snd_p16v_volume_get(struct snd_kcontrol *kcontrol,
654 snd_ctl_elem_value_t * ucontrol, int reg, int high_low) 654 struct snd_ctl_elem_value *ucontrol, int reg, int high_low)
655{ 655{
656 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 656 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
657 u32 value; 657 u32 value;
658 658
659 value = snd_emu10k1_ptr20_read(emu, reg, high_low); 659 value = snd_emu10k1_ptr20_read(emu, reg, high_low);
@@ -667,71 +667,71 @@ static int snd_p16v_volume_get(snd_kcontrol_t * kcontrol,
667 return 0; 667 return 0;
668} 668}
669 669
670static int snd_p16v_volume_get_spdif_front(snd_kcontrol_t * kcontrol, 670static int snd_p16v_volume_get_spdif_front(struct snd_kcontrol *kcontrol,
671 snd_ctl_elem_value_t * ucontrol) 671 struct snd_ctl_elem_value *ucontrol)
672{ 672{
673 int high_low = 0; 673 int high_low = 0;
674 int reg = PLAYBACK_VOLUME_MIXER7; 674 int reg = PLAYBACK_VOLUME_MIXER7;
675 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 675 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
676} 676}
677 677
678static int snd_p16v_volume_get_spdif_center_lfe(snd_kcontrol_t * kcontrol, 678static int snd_p16v_volume_get_spdif_center_lfe(struct snd_kcontrol *kcontrol,
679 snd_ctl_elem_value_t * ucontrol) 679 struct snd_ctl_elem_value *ucontrol)
680{ 680{
681 int high_low = 1; 681 int high_low = 1;
682 int reg = PLAYBACK_VOLUME_MIXER7; 682 int reg = PLAYBACK_VOLUME_MIXER7;
683 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 683 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
684} 684}
685static int snd_p16v_volume_get_spdif_unknown(snd_kcontrol_t * kcontrol, 685static int snd_p16v_volume_get_spdif_unknown(struct snd_kcontrol *kcontrol,
686 snd_ctl_elem_value_t * ucontrol) 686 struct snd_ctl_elem_value *ucontrol)
687{ 687{
688 int high_low = 0; 688 int high_low = 0;
689 int reg = PLAYBACK_VOLUME_MIXER8; 689 int reg = PLAYBACK_VOLUME_MIXER8;
690 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 690 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
691} 691}
692static int snd_p16v_volume_get_spdif_rear(snd_kcontrol_t * kcontrol, 692static int snd_p16v_volume_get_spdif_rear(struct snd_kcontrol *kcontrol,
693 snd_ctl_elem_value_t * ucontrol) 693 struct snd_ctl_elem_value *ucontrol)
694{ 694{
695 int high_low = 1; 695 int high_low = 1;
696 int reg = PLAYBACK_VOLUME_MIXER8; 696 int reg = PLAYBACK_VOLUME_MIXER8;
697 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 697 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
698} 698}
699 699
700static int snd_p16v_volume_get_analog_front(snd_kcontrol_t * kcontrol, 700static int snd_p16v_volume_get_analog_front(struct snd_kcontrol *kcontrol,
701 snd_ctl_elem_value_t * ucontrol) 701 struct snd_ctl_elem_value *ucontrol)
702{ 702{
703 int high_low = 0; 703 int high_low = 0;
704 int reg = PLAYBACK_VOLUME_MIXER9; 704 int reg = PLAYBACK_VOLUME_MIXER9;
705 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 705 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
706} 706}
707 707
708static int snd_p16v_volume_get_analog_center_lfe(snd_kcontrol_t * kcontrol, 708static int snd_p16v_volume_get_analog_center_lfe(struct snd_kcontrol *kcontrol,
709 snd_ctl_elem_value_t * ucontrol) 709 struct snd_ctl_elem_value *ucontrol)
710{ 710{
711 int high_low = 1; 711 int high_low = 1;
712 int reg = PLAYBACK_VOLUME_MIXER9; 712 int reg = PLAYBACK_VOLUME_MIXER9;
713 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 713 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
714} 714}
715static int snd_p16v_volume_get_analog_rear(snd_kcontrol_t * kcontrol, 715static int snd_p16v_volume_get_analog_rear(struct snd_kcontrol *kcontrol,
716 snd_ctl_elem_value_t * ucontrol) 716 struct snd_ctl_elem_value *ucontrol)
717{ 717{
718 int high_low = 1; 718 int high_low = 1;
719 int reg = PLAYBACK_VOLUME_MIXER10; 719 int reg = PLAYBACK_VOLUME_MIXER10;
720 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 720 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
721} 721}
722 722
723static int snd_p16v_volume_get_analog_unknown(snd_kcontrol_t * kcontrol, 723static int snd_p16v_volume_get_analog_unknown(struct snd_kcontrol *kcontrol,
724 snd_ctl_elem_value_t * ucontrol) 724 struct snd_ctl_elem_value *ucontrol)
725{ 725{
726 int high_low = 0; 726 int high_low = 0;
727 int reg = PLAYBACK_VOLUME_MIXER10; 727 int reg = PLAYBACK_VOLUME_MIXER10;
728 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low); 728 return snd_p16v_volume_get(kcontrol, ucontrol, reg, high_low);
729} 729}
730 730
731static int snd_p16v_volume_put(snd_kcontrol_t * kcontrol, 731static int snd_p16v_volume_put(struct snd_kcontrol *kcontrol,
732 snd_ctl_elem_value_t * ucontrol, int reg, int high_low) 732 struct snd_ctl_elem_value *ucontrol, int reg, int high_low)
733{ 733{
734 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 734 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
735 u32 value; 735 u32 value;
736 value = snd_emu10k1_ptr20_read(emu, reg, 0); 736 value = snd_emu10k1_ptr20_read(emu, reg, 0);
737 //value = value & 0xffff; 737 //value = value & 0xffff;
@@ -746,71 +746,71 @@ static int snd_p16v_volume_put(snd_kcontrol_t * kcontrol,
746 return 1; 746 return 1;
747} 747}
748 748
749static int snd_p16v_volume_put_spdif_front(snd_kcontrol_t * kcontrol, 749static int snd_p16v_volume_put_spdif_front(struct snd_kcontrol *kcontrol,
750 snd_ctl_elem_value_t * ucontrol) 750 struct snd_ctl_elem_value *ucontrol)
751{ 751{
752 int high_low = 0; 752 int high_low = 0;
753 int reg = PLAYBACK_VOLUME_MIXER7; 753 int reg = PLAYBACK_VOLUME_MIXER7;
754 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 754 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
755} 755}
756 756
757static int snd_p16v_volume_put_spdif_center_lfe(snd_kcontrol_t * kcontrol, 757static int snd_p16v_volume_put_spdif_center_lfe(struct snd_kcontrol *kcontrol,
758 snd_ctl_elem_value_t * ucontrol) 758 struct snd_ctl_elem_value *ucontrol)
759{ 759{
760 int high_low = 1; 760 int high_low = 1;
761 int reg = PLAYBACK_VOLUME_MIXER7; 761 int reg = PLAYBACK_VOLUME_MIXER7;
762 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 762 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
763} 763}
764 764
765static int snd_p16v_volume_put_spdif_unknown(snd_kcontrol_t * kcontrol, 765static int snd_p16v_volume_put_spdif_unknown(struct snd_kcontrol *kcontrol,
766 snd_ctl_elem_value_t * ucontrol) 766 struct snd_ctl_elem_value *ucontrol)
767{ 767{
768 int high_low = 0; 768 int high_low = 0;
769 int reg = PLAYBACK_VOLUME_MIXER8; 769 int reg = PLAYBACK_VOLUME_MIXER8;
770 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 770 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
771} 771}
772 772
773static int snd_p16v_volume_put_spdif_rear(snd_kcontrol_t * kcontrol, 773static int snd_p16v_volume_put_spdif_rear(struct snd_kcontrol *kcontrol,
774 snd_ctl_elem_value_t * ucontrol) 774 struct snd_ctl_elem_value *ucontrol)
775{ 775{
776 int high_low = 1; 776 int high_low = 1;
777 int reg = PLAYBACK_VOLUME_MIXER8; 777 int reg = PLAYBACK_VOLUME_MIXER8;
778 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 778 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
779} 779}
780 780
781static int snd_p16v_volume_put_analog_front(snd_kcontrol_t * kcontrol, 781static int snd_p16v_volume_put_analog_front(struct snd_kcontrol *kcontrol,
782 snd_ctl_elem_value_t * ucontrol) 782 struct snd_ctl_elem_value *ucontrol)
783{ 783{
784 int high_low = 0; 784 int high_low = 0;
785 int reg = PLAYBACK_VOLUME_MIXER9; 785 int reg = PLAYBACK_VOLUME_MIXER9;
786 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 786 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
787} 787}
788 788
789static int snd_p16v_volume_put_analog_center_lfe(snd_kcontrol_t * kcontrol, 789static int snd_p16v_volume_put_analog_center_lfe(struct snd_kcontrol *kcontrol,
790 snd_ctl_elem_value_t * ucontrol) 790 struct snd_ctl_elem_value *ucontrol)
791{ 791{
792 int high_low = 1; 792 int high_low = 1;
793 int reg = PLAYBACK_VOLUME_MIXER9; 793 int reg = PLAYBACK_VOLUME_MIXER9;
794 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 794 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
795} 795}
796 796
797static int snd_p16v_volume_put_analog_rear(snd_kcontrol_t * kcontrol, 797static int snd_p16v_volume_put_analog_rear(struct snd_kcontrol *kcontrol,
798 snd_ctl_elem_value_t * ucontrol) 798 struct snd_ctl_elem_value *ucontrol)
799{ 799{
800 int high_low = 1; 800 int high_low = 1;
801 int reg = PLAYBACK_VOLUME_MIXER10; 801 int reg = PLAYBACK_VOLUME_MIXER10;
802 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 802 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
803} 803}
804 804
805static int snd_p16v_volume_put_analog_unknown(snd_kcontrol_t * kcontrol, 805static int snd_p16v_volume_put_analog_unknown(struct snd_kcontrol *kcontrol,
806 snd_ctl_elem_value_t * ucontrol) 806 struct snd_ctl_elem_value *ucontrol)
807{ 807{
808 int high_low = 0; 808 int high_low = 0;
809 int reg = PLAYBACK_VOLUME_MIXER10; 809 int reg = PLAYBACK_VOLUME_MIXER10;
810 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low); 810 return snd_p16v_volume_put(kcontrol, ucontrol, reg, high_low);
811} 811}
812 812
813static snd_kcontrol_new_t snd_p16v_volume_control_analog_front = 813static struct snd_kcontrol_new snd_p16v_volume_control_analog_front =
814{ 814{
815 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 815 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
816 .name = "HD Analog Front Playback Volume", 816 .name = "HD Analog Front Playback Volume",
@@ -819,7 +819,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_analog_front =
819 .put = snd_p16v_volume_put_analog_front 819 .put = snd_p16v_volume_put_analog_front
820}; 820};
821 821
822static snd_kcontrol_new_t snd_p16v_volume_control_analog_center_lfe = 822static struct snd_kcontrol_new snd_p16v_volume_control_analog_center_lfe =
823{ 823{
824 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 824 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
825 .name = "HD Analog Center/LFE Playback Volume", 825 .name = "HD Analog Center/LFE Playback Volume",
@@ -828,7 +828,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_analog_center_lfe =
828 .put = snd_p16v_volume_put_analog_center_lfe 828 .put = snd_p16v_volume_put_analog_center_lfe
829}; 829};
830 830
831static snd_kcontrol_new_t snd_p16v_volume_control_analog_unknown = 831static struct snd_kcontrol_new snd_p16v_volume_control_analog_unknown =
832{ 832{
833 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 833 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
834 .name = "HD Analog Unknown Playback Volume", 834 .name = "HD Analog Unknown Playback Volume",
@@ -837,7 +837,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_analog_unknown =
837 .put = snd_p16v_volume_put_analog_unknown 837 .put = snd_p16v_volume_put_analog_unknown
838}; 838};
839 839
840static snd_kcontrol_new_t snd_p16v_volume_control_analog_rear = 840static struct snd_kcontrol_new snd_p16v_volume_control_analog_rear =
841{ 841{
842 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 842 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
843 .name = "HD Analog Rear Playback Volume", 843 .name = "HD Analog Rear Playback Volume",
@@ -846,7 +846,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_analog_rear =
846 .put = snd_p16v_volume_put_analog_rear 846 .put = snd_p16v_volume_put_analog_rear
847}; 847};
848 848
849static snd_kcontrol_new_t snd_p16v_volume_control_spdif_front = 849static struct snd_kcontrol_new snd_p16v_volume_control_spdif_front =
850{ 850{
851 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 851 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
852 .name = "HD SPDIF Front Playback Volume", 852 .name = "HD SPDIF Front Playback Volume",
@@ -855,7 +855,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_spdif_front =
855 .put = snd_p16v_volume_put_spdif_front 855 .put = snd_p16v_volume_put_spdif_front
856}; 856};
857 857
858static snd_kcontrol_new_t snd_p16v_volume_control_spdif_center_lfe = 858static struct snd_kcontrol_new snd_p16v_volume_control_spdif_center_lfe =
859{ 859{
860 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 860 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
861 .name = "HD SPDIF Center/LFE Playback Volume", 861 .name = "HD SPDIF Center/LFE Playback Volume",
@@ -864,7 +864,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_spdif_center_lfe =
864 .put = snd_p16v_volume_put_spdif_center_lfe 864 .put = snd_p16v_volume_put_spdif_center_lfe
865}; 865};
866 866
867static snd_kcontrol_new_t snd_p16v_volume_control_spdif_unknown = 867static struct snd_kcontrol_new snd_p16v_volume_control_spdif_unknown =
868{ 868{
869 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 869 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
870 .name = "HD SPDIF Unknown Playback Volume", 870 .name = "HD SPDIF Unknown Playback Volume",
@@ -873,7 +873,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_spdif_unknown =
873 .put = snd_p16v_volume_put_spdif_unknown 873 .put = snd_p16v_volume_put_spdif_unknown
874}; 874};
875 875
876static snd_kcontrol_new_t snd_p16v_volume_control_spdif_rear = 876static struct snd_kcontrol_new snd_p16v_volume_control_spdif_rear =
877{ 877{
878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 878 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
879 .name = "HD SPDIF Rear Playback Volume", 879 .name = "HD SPDIF Rear Playback Volume",
@@ -882,7 +882,7 @@ static snd_kcontrol_new_t snd_p16v_volume_control_spdif_rear =
882 .put = snd_p16v_volume_put_spdif_rear 882 .put = snd_p16v_volume_put_spdif_rear
883}; 883};
884 884
885static int snd_p16v_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 885static int snd_p16v_capture_source_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
886{ 886{
887 static char *texts[8] = { "SPDIF", "I2S", "SRC48", "SRCMulti_SPDIF", "SRCMulti_I2S", "CDIF", "FX", "AC97" }; 887 static char *texts[8] = { "SPDIF", "I2S", "SRC48", "SRCMulti_SPDIF", "SRCMulti_I2S", "CDIF", "FX", "AC97" };
888 888
@@ -895,19 +895,19 @@ static int snd_p16v_capture_source_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_i
895 return 0; 895 return 0;
896} 896}
897 897
898static int snd_p16v_capture_source_get(snd_kcontrol_t * kcontrol, 898static int snd_p16v_capture_source_get(struct snd_kcontrol *kcontrol,
899 snd_ctl_elem_value_t * ucontrol) 899 struct snd_ctl_elem_value *ucontrol)
900{ 900{
901 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 901 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
902 902
903 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source; 903 ucontrol->value.enumerated.item[0] = emu->p16v_capture_source;
904 return 0; 904 return 0;
905} 905}
906 906
907static int snd_p16v_capture_source_put(snd_kcontrol_t * kcontrol, 907static int snd_p16v_capture_source_put(struct snd_kcontrol *kcontrol,
908 snd_ctl_elem_value_t * ucontrol) 908 struct snd_ctl_elem_value *ucontrol)
909{ 909{
910 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 910 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
911 unsigned int val; 911 unsigned int val;
912 int change = 0; 912 int change = 0;
913 u32 mask; 913 u32 mask;
@@ -924,7 +924,7 @@ static int snd_p16v_capture_source_put(snd_kcontrol_t * kcontrol,
924 return change; 924 return change;
925} 925}
926 926
927static snd_kcontrol_new_t snd_p16v_capture_source __devinitdata = 927static struct snd_kcontrol_new snd_p16v_capture_source __devinitdata =
928{ 928{
929 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 929 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
930 .name = "HD source Capture", 930 .name = "HD source Capture",
@@ -933,7 +933,7 @@ static snd_kcontrol_new_t snd_p16v_capture_source __devinitdata =
933 .put = snd_p16v_capture_source_put 933 .put = snd_p16v_capture_source_put
934}; 934};
935 935
936static int snd_p16v_capture_channel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo) 936static int snd_p16v_capture_channel_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
937{ 937{
938 static char *texts[4] = { "0", "1", "2", "3", }; 938 static char *texts[4] = { "0", "1", "2", "3", };
939 939
@@ -946,19 +946,19 @@ static int snd_p16v_capture_channel_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_
946 return 0; 946 return 0;
947} 947}
948 948
949static int snd_p16v_capture_channel_get(snd_kcontrol_t * kcontrol, 949static int snd_p16v_capture_channel_get(struct snd_kcontrol *kcontrol,
950 snd_ctl_elem_value_t * ucontrol) 950 struct snd_ctl_elem_value *ucontrol)
951{ 951{
952 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 952 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
953 953
954 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel; 954 ucontrol->value.enumerated.item[0] = emu->p16v_capture_channel;
955 return 0; 955 return 0;
956} 956}
957 957
958static int snd_p16v_capture_channel_put(snd_kcontrol_t * kcontrol, 958static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
959 snd_ctl_elem_value_t * ucontrol) 959 struct snd_ctl_elem_value *ucontrol)
960{ 960{
961 emu10k1_t *emu = snd_kcontrol_chip(kcontrol); 961 struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
962 unsigned int val; 962 unsigned int val;
963 int change = 0; 963 int change = 0;
964 u32 tmp; 964 u32 tmp;
@@ -973,7 +973,7 @@ static int snd_p16v_capture_channel_put(snd_kcontrol_t * kcontrol,
973 return change; 973 return change;
974} 974}
975 975
976static snd_kcontrol_new_t snd_p16v_capture_channel __devinitdata = 976static struct snd_kcontrol_new snd_p16v_capture_channel __devinitdata =
977{ 977{
978 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 978 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
979 .name = "HD channel Capture", 979 .name = "HD channel Capture",
@@ -982,11 +982,11 @@ static snd_kcontrol_new_t snd_p16v_capture_channel __devinitdata =
982 .put = snd_p16v_capture_channel_put 982 .put = snd_p16v_capture_channel_put
983}; 983};
984 984
985int snd_p16v_mixer(emu10k1_t *emu) 985int snd_p16v_mixer(struct snd_emu10k1 *emu)
986{ 986{
987 int err; 987 int err;
988 snd_kcontrol_t *kctl; 988 struct snd_kcontrol *kctl;
989 snd_card_t *card = emu->card; 989 struct snd_card *card = emu->card;
990 if ((kctl = snd_ctl_new1(&snd_p16v_volume_control_analog_front, emu)) == NULL) 990 if ((kctl = snd_ctl_new1(&snd_p16v_volume_control_analog_front, emu)) == NULL)
991 return -ENOMEM; 991 return -ENOMEM;
992 if ((err = snd_ctl_add(card, kctl))) 992 if ((err = snd_ctl_add(card, kctl)))
diff --git a/sound/pci/emu10k1/timer.c b/sound/pci/emu10k1/timer.c
index d2e364607c1d..6295b2dca785 100644
--- a/sound/pci/emu10k1/timer.c
+++ b/sound/pci/emu10k1/timer.c
@@ -30,9 +30,9 @@
30#include <sound/core.h> 30#include <sound/core.h>
31#include <sound/emu10k1.h> 31#include <sound/emu10k1.h>
32 32
33static int snd_emu10k1_timer_start(snd_timer_t *timer) 33static int snd_emu10k1_timer_start(struct snd_timer *timer)
34{ 34{
35 emu10k1_t *emu; 35 struct snd_emu10k1 *emu;
36 unsigned long flags; 36 unsigned long flags;
37 unsigned int delay; 37 unsigned int delay;
38 38
@@ -47,9 +47,9 @@ static int snd_emu10k1_timer_start(snd_timer_t *timer)
47 return 0; 47 return 0;
48} 48}
49 49
50static int snd_emu10k1_timer_stop(snd_timer_t *timer) 50static int snd_emu10k1_timer_stop(struct snd_timer *timer)
51{ 51{
52 emu10k1_t *emu; 52 struct snd_emu10k1 *emu;
53 unsigned long flags; 53 unsigned long flags;
54 54
55 emu = snd_timer_chip(timer); 55 emu = snd_timer_chip(timer);
@@ -59,7 +59,7 @@ static int snd_emu10k1_timer_stop(snd_timer_t *timer)
59 return 0; 59 return 0;
60} 60}
61 61
62static int snd_emu10k1_timer_precise_resolution(snd_timer_t *timer, 62static int snd_emu10k1_timer_precise_resolution(struct snd_timer *timer,
63 unsigned long *num, unsigned long *den) 63 unsigned long *num, unsigned long *den)
64{ 64{
65 *num = 1; 65 *num = 1;
@@ -67,7 +67,7 @@ static int snd_emu10k1_timer_precise_resolution(snd_timer_t *timer,
67 return 0; 67 return 0;
68} 68}
69 69
70static struct _snd_timer_hardware snd_emu10k1_timer_hw = { 70static struct snd_timer_hardware snd_emu10k1_timer_hw = {
71 .flags = SNDRV_TIMER_HW_AUTO, 71 .flags = SNDRV_TIMER_HW_AUTO,
72 .resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */ 72 .resolution = 20833, /* 1 sample @ 48KHZ = 20.833...us */
73 .ticks = 1024, 73 .ticks = 1024,
@@ -76,10 +76,10 @@ static struct _snd_timer_hardware snd_emu10k1_timer_hw = {
76 .precise_resolution = snd_emu10k1_timer_precise_resolution, 76 .precise_resolution = snd_emu10k1_timer_precise_resolution,
77}; 77};
78 78
79int __devinit snd_emu10k1_timer(emu10k1_t *emu, int device) 79int __devinit snd_emu10k1_timer(struct snd_emu10k1 *emu, int device)
80{ 80{
81 snd_timer_t *timer = NULL; 81 struct snd_timer *timer = NULL;
82 snd_timer_id_t tid; 82 struct snd_timer_id tid;
83 int err; 83 int err;
84 84
85 tid.dev_class = SNDRV_TIMER_CLASS_CARD; 85 tid.dev_class = SNDRV_TIMER_CLASS_CARD;
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index d251d3440eec..56ffb7dc3ee2 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -45,9 +45,10 @@
45 * --rlrevell 45 * --rlrevell
46 */ 46 */
47 47
48static int voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int number, emu10k1_voice_t **rvoice) 48static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
49 struct snd_emu10k1_voice **rvoice)
49{ 50{
50 emu10k1_voice_t *voice; 51 struct snd_emu10k1_voice *voice;
51 int i, j, k, first_voice, last_voice, skip; 52 int i, j, k, first_voice, last_voice, skip;
52 53
53 *rvoice = NULL; 54 *rvoice = NULL;
@@ -105,7 +106,8 @@ static int voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int number, em
105 return 0; 106 return 0;
106} 107}
107 108
108int snd_emu10k1_voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int number, emu10k1_voice_t **rvoice) 109int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int number,
110 struct snd_emu10k1_voice **rvoice)
109{ 111{
110 unsigned long flags; 112 unsigned long flags;
111 int result; 113 int result;
@@ -123,7 +125,7 @@ int snd_emu10k1_voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int numbe
123 if (emu->get_synth_voice) { 125 if (emu->get_synth_voice) {
124 result = emu->get_synth_voice(emu); 126 result = emu->get_synth_voice(emu);
125 if (result >= 0) { 127 if (result >= 0) {
126 emu10k1_voice_t *pvoice = &emu->voices[result]; 128 struct snd_emu10k1_voice *pvoice = &emu->voices[result];
127 pvoice->interrupt = NULL; 129 pvoice->interrupt = NULL;
128 pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = pvoice->efx = 0; 130 pvoice->use = pvoice->pcm = pvoice->synth = pvoice->midi = pvoice->efx = 0;
129 pvoice->epcm = NULL; 131 pvoice->epcm = NULL;
@@ -137,7 +139,8 @@ int snd_emu10k1_voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int numbe
137 return result; 139 return result;
138} 140}
139 141
140int snd_emu10k1_voice_free(emu10k1_t *emu, emu10k1_voice_t *pvoice) 142int snd_emu10k1_voice_free(struct snd_emu10k1 *emu,
143 struct snd_emu10k1_voice *pvoice)
141{ 144{
142 unsigned long flags; 145 unsigned long flags;
143 146