aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-01-04 19:38:36 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-04 19:38:36 -0500
commit4da5cc2cec8caec1d357053e85a7a32f243f93a1 (patch)
tree3f8b603af4af88f86be7ec1d4e3639a7fc9dd1a6 /include
parent25c862cc9ea9b312c25a9f577f91b973131f1261 (diff)
parentc6f43290ae687c11cdcd150d8bfeb57ec29cfa5b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa
Diffstat (limited to 'include')
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/pnp.h9
-rw-r--r--include/sound/ac97_codec.h169
-rw-r--r--include/sound/ad1816a.h22
-rw-r--r--include/sound/ad1848.h33
-rw-r--r--include/sound/ainstr_fm.h28
-rw-r--r--include/sound/ainstr_gf1.h46
-rw-r--r--include/sound/ainstr_iw.h115
-rw-r--r--include/sound/ainstr_simple.h35
-rw-r--r--include/sound/ak4114.h30
-rw-r--r--include/sound/ak4117.h24
-rw-r--r--include/sound/ak4531_codec.h17
-rw-r--r--include/sound/ak4xxx-adda.h22
-rw-r--r--include/sound/asequencer.h378
-rw-r--r--include/sound/asound.h566
-rw-r--r--include/sound/asound_fm.h24
-rw-r--r--include/sound/control.h94
-rw-r--r--include/sound/core.h223
-rw-r--r--include/sound/cs4231.h113
-rw-r--r--include/sound/cs46xx.h89
-rw-r--r--include/sound/cs46xx_dsp_scb_types.h145
-rw-r--r--include/sound/cs46xx_dsp_spos.h119
-rw-r--r--include/sound/cs46xx_dsp_task_types.h35
-rw-r--r--include/sound/cs8403.h8
-rw-r--r--include/sound/cs8427.h17
-rw-r--r--include/sound/driver.h7
-rw-r--r--include/sound/emu10k1.h371
-rw-r--r--include/sound/emu10k1_synth.h6
-rw-r--r--include/sound/emu8000.h39
-rw-r--r--include/sound/emux_synth.h105
-rw-r--r--include/sound/es1688.h22
-rw-r--r--include/sound/gus.h379
-rw-r--r--include/sound/hdsp.h51
-rw-r--r--include/sound/hdspm.h45
-rw-r--r--include/sound/hwdep.h43
-rw-r--r--include/sound/i2c.h78
-rw-r--r--include/sound/info.h107
-rw-r--r--include/sound/initval.h14
-rw-r--r--include/sound/minors.h29
-rw-r--r--include/sound/mixer_oss.h54
-rw-r--r--include/sound/mpu401.h26
-rw-r--r--include/sound/opl3.h57
-rw-r--r--include/sound/opl4.h6
-rw-r--r--include/sound/pcm-indirect.h28
-rw-r--r--include/sound/pcm.h476
-rw-r--r--include/sound/pcm_oss.h41
-rw-r--r--include/sound/pcm_params.h86
-rw-r--r--include/sound/rawmidi.h125
-rw-r--r--include/sound/sb.h74
-rw-r--r--include/sound/sb16_csp.h52
-rw-r--r--include/sound/seq_device.h18
-rw-r--r--include/sound/seq_instr.h64
-rw-r--r--include/sound/seq_kernel.h125
-rw-r--r--include/sound/seq_midi_emul.h44
-rw-r--r--include/sound/seq_midi_event.h22
-rw-r--r--include/sound/seq_oss.h30
-rw-r--r--include/sound/seq_virmidi.h22
-rw-r--r--include/sound/sfnt_info.h36
-rw-r--r--include/sound/snd_wavefront.h20
-rw-r--r--include/sound/soundfont.h75
-rw-r--r--include/sound/tea575x-tuner.h12
-rw-r--r--include/sound/tea6330t.h17
-rw-r--r--include/sound/timer.h94
-rw-r--r--include/sound/trident.h153
-rw-r--r--include/sound/typedefs.h173
-rw-r--r--include/sound/uda1341.h109
-rw-r--r--include/sound/util_mem.h32
-rw-r--r--include/sound/version.h4
-rw-r--r--include/sound/vx_core.h131
-rw-r--r--include/sound/ymfpci.h112
70 files changed, 2936 insertions, 3043 deletions
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index a17e171384ef..4f01710485cd 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -377,6 +377,10 @@
377#define PCI_DEVICE_ID_NS_87560_USB 0x0012 377#define PCI_DEVICE_ID_NS_87560_USB 0x0012
378#define PCI_DEVICE_ID_NS_83815 0x0020 378#define PCI_DEVICE_ID_NS_83815 0x0020
379#define PCI_DEVICE_ID_NS_83820 0x0022 379#define PCI_DEVICE_ID_NS_83820 0x0022
380#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
381#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
382#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
383#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030
380#define PCI_DEVICE_ID_NS_SATURN 0x0035 384#define PCI_DEVICE_ID_NS_SATURN 0x0035
381#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 385#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
382#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 386#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 584d57cb393a..93b0959eb40f 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -162,6 +162,7 @@ struct pnp_card_link {
162 struct pnp_card * card; 162 struct pnp_card * card;
163 struct pnp_card_driver * driver; 163 struct pnp_card_driver * driver;
164 void * driver_data; 164 void * driver_data;
165 pm_message_t pm_state;
165}; 166};
166 167
167static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) 168static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard)
@@ -294,6 +295,8 @@ struct pnp_driver {
294 unsigned int flags; 295 unsigned int flags;
295 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); 296 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
296 void (*remove) (struct pnp_dev *dev); 297 void (*remove) (struct pnp_dev *dev);
298 int (*suspend) (struct pnp_dev *dev, pm_message_t state);
299 int (*resume) (struct pnp_dev *dev);
297 struct device_driver driver; 300 struct device_driver driver;
298}; 301};
299 302
@@ -306,6 +309,8 @@ struct pnp_card_driver {
306 unsigned int flags; 309 unsigned int flags;
307 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id); 310 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id);
308 void (*remove) (struct pnp_card_link *card); 311 void (*remove) (struct pnp_card_link *card);
312 int (*suspend) (struct pnp_card_link *card, pm_message_t state);
313 int (*resume) (struct pnp_card_link *card);
309 struct pnp_driver link; 314 struct pnp_driver link;
310}; 315};
311 316
@@ -380,6 +385,8 @@ void pnp_init_resource_table(struct pnp_resource_table *table);
380int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); 385int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode);
381int pnp_auto_config_dev(struct pnp_dev *dev); 386int pnp_auto_config_dev(struct pnp_dev *dev);
382int pnp_validate_config(struct pnp_dev *dev); 387int pnp_validate_config(struct pnp_dev *dev);
388int pnp_start_dev(struct pnp_dev *dev);
389int pnp_stop_dev(struct pnp_dev *dev);
383int pnp_activate_dev(struct pnp_dev *dev); 390int pnp_activate_dev(struct pnp_dev *dev);
384int pnp_disable_dev(struct pnp_dev *dev); 391int pnp_disable_dev(struct pnp_dev *dev);
385void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); 392void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size);
@@ -423,6 +430,8 @@ static inline void pnp_init_resource_table(struct pnp_resource_table *table) { }
423static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; } 430static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
424static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } 431static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
425static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; } 432static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; }
433static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
434static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
426static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 435static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
427static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 436static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
428static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } 437static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { }
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 7f0ca79d6c98..b0b3ea7b365e 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -391,65 +391,35 @@
391 * 391 *
392 */ 392 */
393 393
394typedef struct _snd_ac97_bus ac97_bus_t; 394struct snd_ac97;
395typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
396typedef struct _snd_ac97_template ac97_template_t;
397typedef struct _snd_ac97 ac97_t;
398
399enum ac97_pcm_cfg {
400 AC97_PCM_CFG_FRONT = 2,
401 AC97_PCM_CFG_REAR = 10, /* alias surround */
402 AC97_PCM_CFG_LFE = 11, /* center + lfe */
403 AC97_PCM_CFG_40 = 4, /* front + rear */
404 AC97_PCM_CFG_51 = 6, /* front + rear + center/lfe */
405 AC97_PCM_CFG_SPDIF = 20
406};
407
408/* PCM allocation */
409struct ac97_pcm {
410 ac97_bus_t *bus;
411 unsigned int stream: 1, /* stream type: 1 = capture */
412 exclusive: 1, /* exclusive mode, don't override with other pcms */
413 copy_flag: 1, /* lowlevel driver must fill all entries */
414 spdif: 1; /* spdif pcm */
415 unsigned short aslots; /* active slots */
416 unsigned int rates; /* available rates */
417 struct {
418 unsigned short slots; /* driver input: requested AC97 slot numbers */
419 unsigned short rslots[4]; /* allocated slots per codecs */
420 unsigned char rate_table[4];
421 ac97_t *codec[4]; /* allocated codecs */
422 } r[2]; /* 0 = standard rates, 1 = double rates */
423 unsigned long private_value; /* used by the hardware driver */
424};
425 395
426struct snd_ac97_build_ops { 396struct snd_ac97_build_ops {
427 int (*build_3d) (ac97_t *ac97); 397 int (*build_3d) (struct snd_ac97 *ac97);
428 int (*build_specific) (ac97_t *ac97); 398 int (*build_specific) (struct snd_ac97 *ac97);
429 int (*build_spdif) (ac97_t *ac97); 399 int (*build_spdif) (struct snd_ac97 *ac97);
430 int (*build_post_spdif) (ac97_t *ac97); 400 int (*build_post_spdif) (struct snd_ac97 *ac97);
431#ifdef CONFIG_PM 401#ifdef CONFIG_PM
432 void (*suspend) (ac97_t *ac97); 402 void (*suspend) (struct snd_ac97 *ac97);
433 void (*resume) (ac97_t *ac97); 403 void (*resume) (struct snd_ac97 *ac97);
434#endif 404#endif
435 void (*update_jacks) (ac97_t *ac97); /* for jack-sharing */ 405 void (*update_jacks) (struct snd_ac97 *ac97); /* for jack-sharing */
436}; 406};
437 407
438struct _snd_ac97_bus_ops { 408struct snd_ac97_bus_ops {
439 void (*reset) (ac97_t *ac97); 409 void (*reset) (struct snd_ac97 *ac97);
440 void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val); 410 void (*write) (struct snd_ac97 *ac97, unsigned short reg, unsigned short val);
441 unsigned short (*read) (ac97_t *ac97, unsigned short reg); 411 unsigned short (*read) (struct snd_ac97 *ac97, unsigned short reg);
442 void (*wait) (ac97_t *ac97); 412 void (*wait) (struct snd_ac97 *ac97);
443 void (*init) (ac97_t *ac97); 413 void (*init) (struct snd_ac97 *ac97);
444}; 414};
445 415
446struct _snd_ac97_bus { 416struct snd_ac97_bus {
447 /* -- lowlevel (hardware) driver specific -- */ 417 /* -- lowlevel (hardware) driver specific -- */
448 ac97_bus_ops_t *ops; 418 struct snd_ac97_bus_ops *ops;
449 void *private_data; 419 void *private_data;
450 void (*private_free) (ac97_bus_t *bus); 420 void (*private_free) (struct snd_ac97_bus *bus);
451 /* --- */ 421 /* --- */
452 snd_card_t *card; 422 struct snd_card *card;
453 unsigned short num; /* bus number */ 423 unsigned short num; /* bus number */
454 unsigned short no_vra: 1, /* bridge doesn't support VRA */ 424 unsigned short no_vra: 1, /* bridge doesn't support VRA */
455 dra: 1, /* bridge supports double rate */ 425 dra: 1, /* bridge supports double rate */
@@ -459,13 +429,13 @@ struct _snd_ac97_bus {
459 unsigned short used_slots[2][4]; /* actually used PCM slots */ 429 unsigned short used_slots[2][4]; /* actually used PCM slots */
460 unsigned short pcms_count; /* count of PCMs */ 430 unsigned short pcms_count; /* count of PCMs */
461 struct ac97_pcm *pcms; 431 struct ac97_pcm *pcms;
462 ac97_t *codec[4]; 432 struct snd_ac97 *codec[4];
463 snd_info_entry_t *proc; 433 struct snd_info_entry *proc;
464}; 434};
465 435
466struct _snd_ac97_template { 436struct snd_ac97_template {
467 void *private_data; 437 void *private_data;
468 void (*private_free) (ac97_t *ac97); 438 void (*private_free) (struct snd_ac97 *ac97);
469 struct pci_dev *pci; /* assigned PCI device - used for quirks */ 439 struct pci_dev *pci; /* assigned PCI device - used for quirks */
470 unsigned short num; /* number of codec: 0 = primary, 1 = secondary */ 440 unsigned short num; /* number of codec: 0 = primary, 1 = secondary */
471 unsigned short addr; /* physical address of codec [0-3] */ 441 unsigned short addr; /* physical address of codec [0-3] */
@@ -474,16 +444,16 @@ struct _snd_ac97_template {
474 DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */ 444 DECLARE_BITMAP(reg_accessed, 0x80); /* bit flags */
475}; 445};
476 446
477struct _snd_ac97 { 447struct snd_ac97 {
478 /* -- lowlevel (hardware) driver specific -- */ 448 /* -- lowlevel (hardware) driver specific -- */
479 struct snd_ac97_build_ops * build_ops; 449 struct snd_ac97_build_ops * build_ops;
480 void *private_data; 450 void *private_data;
481 void (*private_free) (ac97_t *ac97); 451 void (*private_free) (struct snd_ac97 *ac97);
482 /* --- */ 452 /* --- */
483 ac97_bus_t *bus; 453 struct snd_ac97_bus *bus;
484 struct pci_dev *pci; /* assigned PCI device - used for quirks */ 454 struct pci_dev *pci; /* assigned PCI device - used for quirks */
485 snd_info_entry_t *proc; 455 struct snd_info_entry *proc;
486 snd_info_entry_t *proc_regs; 456 struct snd_info_entry *proc_regs;
487 unsigned short subsystem_vendor; 457 unsigned short subsystem_vendor;
488 unsigned short subsystem_device; 458 unsigned short subsystem_device;
489 struct semaphore reg_mutex; 459 struct semaphore reg_mutex;
@@ -517,43 +487,47 @@ struct _snd_ac97 {
517 struct device dev; 487 struct device dev;
518}; 488};
519 489
520#define to_ac97_t(d) container_of(d, struct _snd_ac97, dev) 490#define to_ac97_t(d) container_of(d, struct snd_ac97, dev)
521 491
522/* conditions */ 492/* conditions */
523static inline int ac97_is_audio(ac97_t * ac97) 493static inline int ac97_is_audio(struct snd_ac97 * ac97)
524{ 494{
525 return (ac97->scaps & AC97_SCAP_AUDIO); 495 return (ac97->scaps & AC97_SCAP_AUDIO);
526} 496}
527static inline int ac97_is_modem(ac97_t * ac97) 497static inline int ac97_is_modem(struct snd_ac97 * ac97)
528{ 498{
529 return (ac97->scaps & AC97_SCAP_MODEM); 499 return (ac97->scaps & AC97_SCAP_MODEM);
530} 500}
531static inline int ac97_is_rev22(ac97_t * ac97) 501static inline int ac97_is_rev22(struct snd_ac97 * ac97)
532{ 502{
533 return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22; 503 return (ac97->ext_id & AC97_EI_REV_MASK) >= AC97_EI_REV_22;
534} 504}
535static inline int ac97_can_amap(ac97_t * ac97) 505static inline int ac97_can_amap(struct snd_ac97 * ac97)
536{ 506{
537 return (ac97->ext_id & AC97_EI_AMAP) != 0; 507 return (ac97->ext_id & AC97_EI_AMAP) != 0;
538} 508}
539static inline int ac97_can_spdif(ac97_t * ac97) 509static inline int ac97_can_spdif(struct snd_ac97 * ac97)
540{ 510{
541 return (ac97->ext_id & AC97_EI_SPDIF) != 0; 511 return (ac97->ext_id & AC97_EI_SPDIF) != 0;
542} 512}
543 513
544/* functions */ 514/* functions */
545int snd_ac97_bus(snd_card_t *card, int num, ac97_bus_ops_t *ops, void *private_data, ac97_bus_t **rbus); /* create new AC97 bus */ 515/* create new AC97 bus */
546int snd_ac97_mixer(ac97_bus_t *bus, ac97_template_t *template, ac97_t **rac97); /* create mixer controls */ 516int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
547const char *snd_ac97_get_short_name(ac97_t *ac97); 517 void *private_data, struct snd_ac97_bus **rbus);
548 518/* create mixer controls */
549void snd_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short value); 519int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
550unsigned short snd_ac97_read(ac97_t *ac97, unsigned short reg); 520 struct snd_ac97 **rac97);
551void snd_ac97_write_cache(ac97_t *ac97, unsigned short reg, unsigned short value); 521const char *snd_ac97_get_short_name(struct snd_ac97 *ac97);
552int snd_ac97_update(ac97_t *ac97, unsigned short reg, unsigned short value); 522
553int snd_ac97_update_bits(ac97_t *ac97, unsigned short reg, unsigned short mask, unsigned short value); 523void snd_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
524unsigned short snd_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
525void snd_ac97_write_cache(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
526int snd_ac97_update(struct snd_ac97 *ac97, unsigned short reg, unsigned short value);
527int snd_ac97_update_bits(struct snd_ac97 *ac97, unsigned short reg, unsigned short mask, unsigned short value);
554#ifdef CONFIG_PM 528#ifdef CONFIG_PM
555void snd_ac97_suspend(ac97_t *ac97); 529void snd_ac97_suspend(struct snd_ac97 *ac97);
556void snd_ac97_resume(ac97_t *ac97); 530void snd_ac97_resume(struct snd_ac97 *ac97);
557#endif 531#endif
558 532
559/* quirk types */ 533/* quirk types */
@@ -567,6 +541,7 @@ enum {
567 AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */ 541 AC97_TUNE_ALC_JACK, /* for Realtek, enable JACK detection */
568 AC97_TUNE_INV_EAPD, /* inverted EAPD implementation */ 542 AC97_TUNE_INV_EAPD, /* inverted EAPD implementation */
569 AC97_TUNE_MUTE_LED, /* EAPD bit works as mute LED */ 543 AC97_TUNE_MUTE_LED, /* EAPD bit works as mute LED */
544 AC97_TUNE_HP_MUTE_LED, /* EAPD bit works as mute LED, use headphone control as master */
570}; 545};
571 546
572struct ac97_quirk { 547struct ac97_quirk {
@@ -578,24 +553,46 @@ struct ac97_quirk {
578 int type; /* quirk type above */ 553 int type; /* quirk type above */
579}; 554};
580 555
581int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override); 556int snd_ac97_tune_hardware(struct snd_ac97 *ac97, struct ac97_quirk *quirk, const char *override);
582int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate); 557int snd_ac97_set_rate(struct snd_ac97 *ac97, int reg, unsigned int rate);
558
559/*
560 * PCM allocation
561 */
562
563enum ac97_pcm_cfg {
564 AC97_PCM_CFG_FRONT = 2,
565 AC97_PCM_CFG_REAR = 10, /* alias surround */
566 AC97_PCM_CFG_LFE = 11, /* center + lfe */
567 AC97_PCM_CFG_40 = 4, /* front + rear */
568 AC97_PCM_CFG_51 = 6, /* front + rear + center/lfe */
569 AC97_PCM_CFG_SPDIF = 20
570};
571
572struct ac97_pcm {
573 struct snd_ac97_bus *bus;
574 unsigned int stream: 1, /* stream type: 1 = capture */
575 exclusive: 1, /* exclusive mode, don't override with other pcms */
576 copy_flag: 1, /* lowlevel driver must fill all entries */
577 spdif: 1; /* spdif pcm */
578 unsigned short aslots; /* active slots */
579 unsigned int rates; /* available rates */
580 struct {
581 unsigned short slots; /* driver input: requested AC97 slot numbers */
582 unsigned short rslots[4]; /* allocated slots per codecs */
583 unsigned char rate_table[4];
584 struct snd_ac97 *codec[4]; /* allocated codecs */
585 } r[2]; /* 0 = standard rates, 1 = double rates */
586 unsigned long private_value; /* used by the hardware driver */
587};
583 588
584int snd_ac97_pcm_assign(ac97_bus_t *ac97, 589int snd_ac97_pcm_assign(struct snd_ac97_bus *ac97,
585 unsigned short pcms_count, 590 unsigned short pcms_count,
586 const struct ac97_pcm *pcms); 591 const struct ac97_pcm *pcms);
587int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, 592int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
588 enum ac97_pcm_cfg cfg, unsigned short slots); 593 enum ac97_pcm_cfg cfg, unsigned short slots);
589int snd_ac97_pcm_close(struct ac97_pcm *pcm); 594int snd_ac97_pcm_close(struct ac97_pcm *pcm);
590int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime); 595int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime);
591
592struct ac97_enum {
593 unsigned char reg;
594 unsigned char shift_l;
595 unsigned char shift_r;
596 unsigned short mask;
597 const char **texts;
598};
599 596
600/* ad hoc AC97 device driver access */ 597/* ad hoc AC97 device driver access */
601extern struct bus_type ac97_bus_type; 598extern struct bus_type ac97_bus_type;
diff --git a/include/sound/ad1816a.h b/include/sound/ad1816a.h
index ca2e0e4fa937..b3aa62ee3c8d 100644
--- a/include/sound/ad1816a.h
+++ b/include/sound/ad1816a.h
@@ -123,9 +123,7 @@
123#define AD1816A_CAPTURE_NOT_EQUAL 0x1000 123#define AD1816A_CAPTURE_NOT_EQUAL 0x1000
124#define AD1816A_WSS_ENABLE 0x8000 124#define AD1816A_WSS_ENABLE 0x8000
125 125
126typedef struct _snd_ad1816a ad1816a_t; 126struct snd_ad1816a {
127
128struct _snd_ad1816a {
129 unsigned long port; 127 unsigned long port;
130 struct resource *res_port; 128 struct resource *res_port;
131 int irq; 129 int irq;
@@ -140,15 +138,15 @@ struct _snd_ad1816a {
140 unsigned short mode; 138 unsigned short mode;
141 unsigned int clock_freq; 139 unsigned int clock_freq;
142 140
143 snd_card_t *card; 141 struct snd_card *card;
144 snd_pcm_t *pcm; 142 struct snd_pcm *pcm;
145 143
146 snd_pcm_substream_t *playback_substream; 144 struct snd_pcm_substream *playback_substream;
147 snd_pcm_substream_t *capture_substream; 145 struct snd_pcm_substream *capture_substream;
148 unsigned int p_dma_size; 146 unsigned int p_dma_size;
149 unsigned int c_dma_size; 147 unsigned int c_dma_size;
150 148
151 snd_timer_t *timer; 149 struct snd_timer *timer;
152}; 150};
153 151
154 152
@@ -165,11 +163,11 @@ struct _snd_ad1816a {
165 AD1816A_MODE_TIMER) 163 AD1816A_MODE_TIMER)
166 164
167 165
168extern int snd_ad1816a_create(snd_card_t *card, unsigned long port, 166extern int snd_ad1816a_create(struct snd_card *card, unsigned long port,
169 int irq, int dma1, int dma2, 167 int irq, int dma1, int dma2,
170 ad1816a_t **chip); 168 struct snd_ad1816a **chip);
171 169
172extern int snd_ad1816a_pcm(ad1816a_t *chip, int device, snd_pcm_t **rpcm); 170extern int snd_ad1816a_pcm(struct snd_ad1816a *chip, int device, struct snd_pcm **rpcm);
173extern int snd_ad1816a_mixer(ad1816a_t *chip); 171extern int snd_ad1816a_mixer(struct snd_ad1816a *chip);
174 172
175#endif /* __SOUND_AD1816A_H */ 173#endif /* __SOUND_AD1816A_H */
diff --git a/include/sound/ad1848.h b/include/sound/ad1848.h
index 7e33b11037f2..1a2759f3a292 100644
--- a/include/sound/ad1848.h
+++ b/include/sound/ad1848.h
@@ -127,7 +127,7 @@
127#define AD1848_THINKPAD_CTL_PORT2 0x15e9 127#define AD1848_THINKPAD_CTL_PORT2 0x15e9
128#define AD1848_THINKPAD_CS4248_ENABLE_BIT 0x02 128#define AD1848_THINKPAD_CS4248_ENABLE_BIT 0x02
129 129
130struct _snd_ad1848 { 130struct snd_ad1848 {
131 unsigned long port; /* i/o port */ 131 unsigned long port; /* i/o port */
132 struct resource *res_port; 132 struct resource *res_port;
133 int irq; /* IRQ line */ 133 int irq; /* IRQ line */
@@ -137,10 +137,10 @@ struct _snd_ad1848 {
137 unsigned short hardware; /* see to AD1848_HW_XXXX */ 137 unsigned short hardware; /* see to AD1848_HW_XXXX */
138 unsigned short single_dma:1; /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */ 138 unsigned short single_dma:1; /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */
139 139
140 snd_pcm_t *pcm; 140 struct snd_pcm *pcm;
141 snd_pcm_substream_t *playback_substream; 141 struct snd_pcm_substream *playback_substream;
142 snd_pcm_substream_t *capture_substream; 142 struct snd_pcm_substream *capture_substream;
143 snd_card_t *card; 143 struct snd_card *card;
144 144
145 unsigned char image[32]; /* SGalaxy needs an access to extended registers */ 145 unsigned char image[32]; /* SGalaxy needs an access to extended registers */
146 int mce_bit; 146 int mce_bit;
@@ -148,25 +148,28 @@ struct _snd_ad1848 {
148 int dma_size; 148 int dma_size;
149 int thinkpad_flag; /* Thinkpad CS4248 needs some extra help */ 149 int thinkpad_flag; /* Thinkpad CS4248 needs some extra help */
150 150
151#ifdef CONFIG_PM
152 void (*suspend)(struct snd_ad1848 *chip);
153 void (*resume)(struct snd_ad1848 *chip);
154#endif
155
151 spinlock_t reg_lock; 156 spinlock_t reg_lock;
152 struct semaphore open_mutex; 157 struct semaphore open_mutex;
153}; 158};
154 159
155typedef struct _snd_ad1848 ad1848_t;
156
157/* exported functions */ 160/* exported functions */
158 161
159void snd_ad1848_out(ad1848_t *chip, unsigned char reg, unsigned char value); 162void snd_ad1848_out(struct snd_ad1848 *chip, unsigned char reg, unsigned char value);
160 163
161int snd_ad1848_create(snd_card_t * card, 164int snd_ad1848_create(struct snd_card *card,
162 unsigned long port, 165 unsigned long port,
163 int irq, int dma, 166 int irq, int dma,
164 unsigned short hardware, 167 unsigned short hardware,
165 ad1848_t ** chip); 168 struct snd_ad1848 ** chip);
166 169
167int snd_ad1848_pcm(ad1848_t * chip, int device, snd_pcm_t **rpcm); 170int snd_ad1848_pcm(struct snd_ad1848 * chip, int device, struct snd_pcm **rpcm);
168const snd_pcm_ops_t *snd_ad1848_get_pcm_ops(int direction); 171const struct snd_pcm_ops *snd_ad1848_get_pcm_ops(int direction);
169int snd_ad1848_mixer(ad1848_t * chip); 172int snd_ad1848_mixer(struct snd_ad1848 * chip);
170 173
171/* exported mixer stuffs */ 174/* exported mixer stuffs */
172enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE }; 175enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE };
@@ -176,7 +179,7 @@ enum { AD1848_MIX_SINGLE, AD1848_MIX_DOUBLE, AD1848_MIX_CAPTURE };
176#define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \ 179#define AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) \
177 ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22)) 180 ((left_reg) | ((right_reg) << 8) | ((shift_left) << 16) | ((shift_right) << 19) | ((mask) << 24) | ((invert) << 22))
178 181
179int snd_ad1848_add_ctl(ad1848_t *chip, const char *name, int index, int type, unsigned long value); 182int snd_ad1848_add_ctl(struct snd_ad1848 *chip, const char *name, int index, int type, unsigned long value);
180 183
181/* for ease of use */ 184/* for ease of use */
182struct ad1848_mix_elem { 185struct ad1848_mix_elem {
@@ -198,7 +201,7 @@ struct ad1848_mix_elem {
198 .type = AD1848_MIX_DOUBLE, \ 201 .type = AD1848_MIX_DOUBLE, \
199 .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) } 202 .private_value = AD1848_MIXVAL_DOUBLE(left_reg, right_reg, shift_left, shift_right, mask, invert) }
200 203
201static inline int snd_ad1848_add_ctl_elem(ad1848_t *chip, const struct ad1848_mix_elem *c) 204static inline int snd_ad1848_add_ctl_elem(struct snd_ad1848 *chip, const struct ad1848_mix_elem *c)
202{ 205{
203 return snd_ad1848_add_ctl(chip, c->name, c->index, c->type, c->private_value); 206 return snd_ad1848_add_ctl(chip, c->name, c->index, c->type, c->private_value);
204} 207}
diff --git a/include/sound/ainstr_fm.h b/include/sound/ainstr_fm.h
index 0ec02953815a..c4afb1f121fe 100644
--- a/include/sound/ainstr_fm.h
+++ b/include/sound/ainstr_fm.h
@@ -39,13 +39,13 @@
39 * FM operator 39 * FM operator
40 */ 40 */
41 41
42typedef struct fm_operator { 42struct fm_operator {
43 unsigned char am_vib; 43 unsigned char am_vib;
44 unsigned char ksl_level; 44 unsigned char ksl_level;
45 unsigned char attack_decay; 45 unsigned char attack_decay;
46 unsigned char sustain_release; 46 unsigned char sustain_release;
47 unsigned char wave_select; 47 unsigned char wave_select;
48} fm_operator_t; 48};
49 49
50/* 50/*
51 * Instrument 51 * Instrument
@@ -54,11 +54,11 @@ typedef struct fm_operator {
54#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */ 54#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */
55#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */ 55#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */
56 56
57typedef struct { 57struct fm_instrument {
58 unsigned int share_id[4]; /* share id - zero = no sharing */ 58 unsigned int share_id[4]; /* share id - zero = no sharing */
59 unsigned char type; /* instrument type */ 59 unsigned char type; /* instrument type */
60 60
61 fm_operator_t op[4]; 61 struct fm_operator op[4];
62 unsigned char feedback_connection[2]; 62 unsigned char feedback_connection[2];
63 63
64 unsigned char echo_delay; 64 unsigned char echo_delay;
@@ -68,7 +68,7 @@ typedef struct {
68 unsigned char fix_dur; 68 unsigned char fix_dur;
69 unsigned char modes; 69 unsigned char modes;
70 unsigned char fix_key; 70 unsigned char fix_key;
71} fm_instrument_t; 71};
72 72
73/* 73/*
74 * 74 *
@@ -88,25 +88,25 @@ typedef struct {
88 * FM operator 88 * FM operator
89 */ 89 */
90 90
91typedef struct fm_xoperator { 91struct fm_xoperator {
92 __u8 am_vib; 92 __u8 am_vib;
93 __u8 ksl_level; 93 __u8 ksl_level;
94 __u8 attack_decay; 94 __u8 attack_decay;
95 __u8 sustain_release; 95 __u8 sustain_release;
96 __u8 wave_select; 96 __u8 wave_select;
97} fm_xoperator_t; 97};
98 98
99/* 99/*
100 * Instrument 100 * Instrument
101 */ 101 */
102 102
103typedef struct fm_xinstrument { 103struct fm_xinstrument {
104 __u32 stype; /* structure type */ 104 __u32 stype; /* structure type */
105 105
106 __u32 share_id[4]; /* share id - zero = no sharing */ 106 __u32 share_id[4]; /* share id - zero = no sharing */
107 __u8 type; /* instrument type */ 107 __u8 type; /* instrument type */
108 108
109 fm_xoperator_t op[4]; /* fm operators */ 109 struct fm_xoperator op[4]; /* fm operators */
110 __u8 feedback_connection[2]; 110 __u8 feedback_connection[2];
111 111
112 __u8 echo_delay; 112 __u8 echo_delay;
@@ -116,15 +116,19 @@ typedef struct fm_xinstrument {
116 __u8 fix_dur; 116 __u8 fix_dur;
117 __u8 modes; 117 __u8 modes;
118 __u8 fix_key; 118 __u8 fix_key;
119} fm_xinstrument_t; 119};
120 120
121#ifdef __KERNEL__ 121#ifdef __KERNEL__
122 122
123#include "seq_instr.h" 123#include "seq_instr.h"
124 124
125int snd_seq_fm_init(snd_seq_kinstr_ops_t * ops, 125int snd_seq_fm_init(struct snd_seq_kinstr_ops * ops,
126 snd_seq_kinstr_ops_t * next); 126 struct snd_seq_kinstr_ops * next);
127 127
128#endif 128#endif
129 129
130/* typedefs for compatibility to user-space */
131typedef struct fm_xoperator fm_xoperator_t;
132typedef struct fm_xinstrument fm_xinstrument_t;
133
130#endif /* __SOUND_AINSTR_FM_H */ 134#endif /* __SOUND_AINSTR_FM_H */
diff --git a/include/sound/ainstr_gf1.h b/include/sound/ainstr_gf1.h
index ae2ddda63971..47726fe0f46d 100644
--- a/include/sound/ainstr_gf1.h
+++ b/include/sound/ainstr_gf1.h
@@ -52,7 +52,7 @@
52 * Wavetable definitions 52 * Wavetable definitions
53 */ 53 */
54 54
55typedef struct gf1_wave { 55struct gf1_wave {
56 unsigned int share_id[4]; /* share id - zero = no sharing */ 56 unsigned int share_id[4]; /* share id - zero = no sharing */
57 unsigned int format; /* wave format */ 57 unsigned int format; /* wave format */
58 58
@@ -88,7 +88,7 @@ typedef struct gf1_wave {
88 unsigned short scale_factor; /* 0-2048 or 0-2 */ 88 unsigned short scale_factor; /* 0-2048 or 0-2 */
89 89
90 struct gf1_wave *next; 90 struct gf1_wave *next;
91} gf1_wave_t; 91};
92 92
93/* 93/*
94 * Instrument 94 * Instrument
@@ -103,7 +103,7 @@ typedef struct gf1_wave {
103#define IWFFFF_EFFECT_CHORUS 2 103#define IWFFFF_EFFECT_CHORUS 2
104#define IWFFFF_EFFECT_ECHO 3 104#define IWFFFF_EFFECT_ECHO 3
105 105
106typedef struct { 106struct gf1_instrument {
107 unsigned short exclusion; 107 unsigned short exclusion;
108 unsigned short exclusion_group; /* 0 - none, 1-65535 */ 108 unsigned short exclusion_group; /* 0 - none, 1-65535 */
109 109
@@ -112,8 +112,8 @@ typedef struct {
112 unsigned char effect2; /* effect 2 */ 112 unsigned char effect2; /* effect 2 */
113 unsigned char effect2_depth; /* 0-127 */ 113 unsigned char effect2_depth; /* 0-127 */
114 114
115 gf1_wave_t *wave; /* first waveform */ 115 struct gf1_wave *wave; /* first waveform */
116} gf1_instrument_t; 116};
117 117
118/* 118/*
119 * 119 *
@@ -135,7 +135,7 @@ typedef struct {
135 * Wavetable definitions 135 * Wavetable definitions
136 */ 136 */
137 137
138typedef struct gf1_xwave { 138struct gf1_xwave {
139 __u32 stype; /* structure type */ 139 __u32 stype; /* structure type */
140 140
141 __u32 share_id[4]; /* share id - zero = no sharing */ 141 __u32 share_id[4]; /* share id - zero = no sharing */
@@ -165,13 +165,13 @@ typedef struct gf1_xwave {
165 __u8 vibrato_depth; 165 __u8 vibrato_depth;
166 __u16 scale_frequency; 166 __u16 scale_frequency;
167 __u16 scale_factor; /* 0-2048 or 0-2 */ 167 __u16 scale_factor; /* 0-2048 or 0-2 */
168} gf1_xwave_t; 168};
169 169
170/* 170/*
171 * Instrument 171 * Instrument
172 */ 172 */
173 173
174typedef struct gf1_xinstrument { 174struct gf1_xinstrument {
175 __u32 stype; 175 __u32 stype;
176 176
177 __u16 exclusion; 177 __u16 exclusion;
@@ -181,7 +181,7 @@ typedef struct gf1_xinstrument {
181 __u8 effect1_depth; /* 0-127 */ 181 __u8 effect1_depth; /* 0-127 */
182 __u8 effect2; /* effect 2 */ 182 __u8 effect2; /* effect 2 */
183 __u8 effect2_depth; /* 0-127 */ 183 __u8 effect2_depth; /* 0-127 */
184} gf1_xinstrument_t; 184};
185 185
186/* 186/*
187 * Instrument info 187 * Instrument info
@@ -191,35 +191,39 @@ typedef struct gf1_xinstrument {
191#define GF1_INFO_TREMOLO (1<<1) 191#define GF1_INFO_TREMOLO (1<<1)
192#define GF1_INFO_VIBRATO (1<<2) 192#define GF1_INFO_VIBRATO (1<<2)
193 193
194typedef struct gf1_info { 194struct gf1_info {
195 unsigned char flags; /* supported wave flags */ 195 unsigned char flags; /* supported wave flags */
196 unsigned char pad[3]; 196 unsigned char pad[3];
197 unsigned int features; /* supported features */ 197 unsigned int features; /* supported features */
198 unsigned int max8_len; /* maximum 8-bit wave length */ 198 unsigned int max8_len; /* maximum 8-bit wave length */
199 unsigned int max16_len; /* maximum 16-bit wave length */ 199 unsigned int max16_len; /* maximum 16-bit wave length */
200} gf1_info_t; 200};
201 201
202#ifdef __KERNEL__ 202#ifdef __KERNEL__
203 203
204#include "seq_instr.h" 204#include "seq_instr.h"
205 205
206typedef struct { 206struct snd_gf1_ops {
207 void *private_data; 207 void *private_data;
208 int (*info)(void *private_data, gf1_info_t *info); 208 int (*info)(void *private_data, struct gf1_info *info);
209 int (*put_sample)(void *private_data, gf1_wave_t *wave, 209 int (*put_sample)(void *private_data, struct gf1_wave *wave,
210 char __user *data, long len, int atomic); 210 char __user *data, long len, int atomic);
211 int (*get_sample)(void *private_data, gf1_wave_t *wave, 211 int (*get_sample)(void *private_data, struct gf1_wave *wave,
212 char __user *data, long len, int atomic); 212 char __user *data, long len, int atomic);
213 int (*remove_sample)(void *private_data, gf1_wave_t *wave, 213 int (*remove_sample)(void *private_data, struct gf1_wave *wave,
214 int atomic); 214 int atomic);
215 void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); 215 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
216 snd_seq_kinstr_ops_t kops; 216 struct snd_seq_kinstr_ops kops;
217} snd_gf1_ops_t; 217};
218 218
219int snd_seq_gf1_init(snd_gf1_ops_t *ops, 219int snd_seq_gf1_init(struct snd_gf1_ops *ops,
220 void *private_data, 220 void *private_data,
221 snd_seq_kinstr_ops_t *next); 221 struct snd_seq_kinstr_ops *next);
222 222
223#endif 223#endif
224 224
225/* typedefs for compatibility to user-space */
226typedef struct gf1_xwave gf1_xwave_t;
227typedef struct gf1_xinstrument gf1_xinstrument_t;
228
225#endif /* __SOUND_AINSTR_GF1_H */ 229#endif /* __SOUND_AINSTR_GF1_H */
diff --git a/include/sound/ainstr_iw.h b/include/sound/ainstr_iw.h
index 8adf744926ff..251feaf1b388 100644
--- a/include/sound/ainstr_iw.h
+++ b/include/sound/ainstr_iw.h
@@ -54,7 +54,7 @@
54 * Wavetable definitions 54 * Wavetable definitions
55 */ 55 */
56 56
57typedef struct iwffff_wave { 57struct iwffff_wave {
58 unsigned int share_id[4]; /* share id - zero = no sharing */ 58 unsigned int share_id[4]; /* share id - zero = no sharing */
59 unsigned int format; /* wave format */ 59 unsigned int format; /* wave format */
60 60
@@ -76,7 +76,7 @@ typedef struct iwffff_wave {
76 unsigned char pad; 76 unsigned char pad;
77 77
78 struct iwffff_wave *next; 78 struct iwffff_wave *next;
79} iwffff_wave_t; 79};
80 80
81/* 81/*
82 * Layer 82 * Layer
@@ -85,13 +85,13 @@ typedef struct iwffff_wave {
85#define IWFFFF_LFO_SHAPE_TRIANGLE 0 85#define IWFFFF_LFO_SHAPE_TRIANGLE 0
86#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1 86#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1
87 87
88typedef struct iwffff_lfo { 88struct iwffff_lfo {
89 unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */ 89 unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */
90 signed short depth; /* volume +- (0-255) 0.48675dB/step */ 90 signed short depth; /* volume +- (0-255) 0.48675dB/step */
91 signed short sweep; /* 0 - 950 deciseconds */ 91 signed short sweep; /* 0 - 950 deciseconds */
92 unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */ 92 unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */
93 unsigned char delay; /* 0 - 255 deciseconds */ 93 unsigned char delay; /* 0 - 255 deciseconds */
94} iwffff_lfo_t; 94};
95 95
96#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */ 96#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */
97 97
@@ -102,12 +102,12 @@ typedef struct iwffff_lfo {
102#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */ 102#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */
103#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */ 103#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */
104 104
105typedef struct iwffff_env_point { 105struct iwffff_env_point {
106 unsigned short offset; 106 unsigned short offset;
107 unsigned short rate; 107 unsigned short rate;
108} iwffff_env_point_t; 108};
109 109
110typedef struct iwffff_env_record { 110struct iwffff_env_record {
111 unsigned short nattack; 111 unsigned short nattack;
112 unsigned short nrelease; 112 unsigned short nrelease;
113 unsigned short sustain_offset; 113 unsigned short sustain_offset;
@@ -118,15 +118,15 @@ typedef struct iwffff_env_record {
118 struct iwffff_env_record *next; 118 struct iwffff_env_record *next;
119 /* points are stored here */ 119 /* points are stored here */
120 /* count of points = nattack + nrelease */ 120 /* count of points = nattack + nrelease */
121} iwffff_env_record_t; 121};
122 122
123typedef struct iwffff_env { 123struct iwffff_env {
124 unsigned char flags; 124 unsigned char flags;
125 unsigned char mode; 125 unsigned char mode;
126 unsigned char index; 126 unsigned char index;
127 unsigned char pad; 127 unsigned char pad;
128 struct iwffff_env_record *record; 128 struct iwffff_env_record *record;
129} iwffff_env_t; 129};
130 130
131#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */ 131#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */
132 132
@@ -138,7 +138,7 @@ typedef struct iwffff_env {
138#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */ 138#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */
139#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */ 139#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */
140 140
141typedef struct iwffff_layer { 141struct iwffff_layer {
142 unsigned char flags; 142 unsigned char flags;
143 unsigned char velocity_mode; 143 unsigned char velocity_mode;
144 unsigned char layer_event; 144 unsigned char layer_event;
@@ -147,17 +147,17 @@ typedef struct iwffff_layer {
147 unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */ 147 unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */
148 unsigned char pan_freq_scale; /* position based on frequency (0-127) */ 148 unsigned char pan_freq_scale; /* position based on frequency (0-127) */
149 unsigned char attenuation; /* 0-127 (no corresponding midi controller) */ 149 unsigned char attenuation; /* 0-127 (no corresponding midi controller) */
150 iwffff_lfo_t tremolo; /* tremolo effect */ 150 struct iwffff_lfo tremolo; /* tremolo effect */
151 iwffff_lfo_t vibrato; /* vibrato effect */ 151 struct iwffff_lfo vibrato; /* vibrato effect */
152 unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ 152 unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
153 unsigned char freq_center; /* center for keyboard frequency scaling */ 153 unsigned char freq_center; /* center for keyboard frequency scaling */
154 unsigned char pad; 154 unsigned char pad;
155 iwffff_env_t penv; /* pitch envelope */ 155 struct iwffff_env penv; /* pitch envelope */
156 iwffff_env_t venv; /* volume envelope */ 156 struct iwffff_env venv; /* volume envelope */
157 157
158 iwffff_wave_t *wave; 158 struct iwffff_wave *wave;
159 struct iwffff_layer *next; 159 struct iwffff_layer *next;
160} iwffff_layer_t; 160};
161 161
162/* 162/*
163 * Instrument 163 * Instrument
@@ -177,7 +177,7 @@ typedef struct iwffff_layer {
177#define IWFFFF_EFFECT_CHORUS 2 177#define IWFFFF_EFFECT_CHORUS 2
178#define IWFFFF_EFFECT_ECHO 3 178#define IWFFFF_EFFECT_ECHO 3
179 179
180typedef struct { 180struct iwffff_instrument {
181 unsigned short exclusion; 181 unsigned short exclusion;
182 unsigned short layer_type; 182 unsigned short layer_type;
183 unsigned short exclusion_group; /* 0 - none, 1-65535 */ 183 unsigned short exclusion_group; /* 0 - none, 1-65535 */
@@ -187,8 +187,8 @@ typedef struct {
187 unsigned char effect2; /* effect 2 */ 187 unsigned char effect2; /* effect 2 */
188 unsigned char effect2_depth; /* 0-127 */ 188 unsigned char effect2_depth; /* 0-127 */
189 189
190 iwffff_layer_t *layer; /* first layer */ 190 struct iwffff_layer *layer; /* first layer */
191} iwffff_instrument_t; 191};
192 192
193/* 193/*
194 * 194 *
@@ -216,7 +216,7 @@ typedef struct {
216 * Wavetable definitions 216 * Wavetable definitions
217 */ 217 */
218 218
219typedef struct iwffff_xwave { 219struct iwffff_xwave {
220 __u32 stype; /* structure type */ 220 __u32 stype; /* structure type */
221 221
222 __u32 share_id[4]; /* share id - zero = no sharing */ 222 __u32 share_id[4]; /* share id - zero = no sharing */
@@ -234,26 +234,26 @@ typedef struct iwffff_xwave {
234 __u8 low_note; /* lower frequency range for this waveform */ 234 __u8 low_note; /* lower frequency range for this waveform */
235 __u8 high_note; /* higher frequency range for this waveform */ 235 __u8 high_note; /* higher frequency range for this waveform */
236 __u8 pad; 236 __u8 pad;
237} iwffff_xwave_t; 237};
238 238
239/* 239/*
240 * Layer 240 * Layer
241 */ 241 */
242 242
243typedef struct iwffff_xlfo { 243struct iwffff_xlfo {
244 __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */ 244 __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */
245 __s16 depth; /* volume +- (0-255) 0.48675dB/step */ 245 __s16 depth; /* volume +- (0-255) 0.48675dB/step */
246 __s16 sweep; /* 0 - 950 deciseconds */ 246 __s16 sweep; /* 0 - 950 deciseconds */
247 __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */ 247 __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */
248 __u8 delay; /* 0 - 255 deciseconds */ 248 __u8 delay; /* 0 - 255 deciseconds */
249} iwffff_xlfo_t; 249};
250 250
251typedef struct iwffff_xenv_point { 251struct iwffff_xenv_point {
252 __u16 offset; 252 __u16 offset;
253 __u16 rate; 253 __u16 rate;
254} iwffff_xenv_point_t; 254};
255 255
256typedef struct iwffff_xenv_record { 256struct iwffff_xenv_record {
257 __u32 stype; 257 __u32 stype;
258 __u16 nattack; 258 __u16 nattack;
259 __u16 nrelease; 259 __u16 nrelease;
@@ -264,16 +264,16 @@ typedef struct iwffff_xenv_record {
264 __u8 pad; 264 __u8 pad;
265 /* points are stored here.. */ 265 /* points are stored here.. */
266 /* count of points = nattack + nrelease */ 266 /* count of points = nattack + nrelease */
267} iwffff_xenv_record_t; 267};
268 268
269typedef struct iwffff_xenv { 269struct iwffff_xenv {
270 __u8 flags; 270 __u8 flags;
271 __u8 mode; 271 __u8 mode;
272 __u8 index; 272 __u8 index;
273 __u8 pad; 273 __u8 pad;
274} iwffff_xenv_t; 274};
275 275
276typedef struct iwffff_xlayer { 276struct iwffff_xlayer {
277 __u32 stype; 277 __u32 stype;
278 __u8 flags; 278 __u8 flags;
279 __u8 velocity_mode; 279 __u8 velocity_mode;
@@ -283,20 +283,20 @@ typedef struct iwffff_xlayer {
283 __u8 pan; /* pan offset from CC1 (0 left - 127 right) */ 283 __u8 pan; /* pan offset from CC1 (0 left - 127 right) */
284 __u8 pan_freq_scale; /* position based on frequency (0-127) */ 284 __u8 pan_freq_scale; /* position based on frequency (0-127) */
285 __u8 attenuation; /* 0-127 (no corresponding midi controller) */ 285 __u8 attenuation; /* 0-127 (no corresponding midi controller) */
286 iwffff_xlfo_t tremolo; /* tremolo effect */ 286 struct iwffff_xlfo tremolo; /* tremolo effect */
287 iwffff_xlfo_t vibrato; /* vibrato effect */ 287 struct iwffff_xlfo vibrato; /* vibrato effect */
288 __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ 288 __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */
289 __u8 freq_center; /* center for keyboard frequency scaling */ 289 __u8 freq_center; /* center for keyboard frequency scaling */
290 __u8 pad; 290 __u8 pad;
291 iwffff_xenv_t penv; /* pitch envelope */ 291 struct iwffff_xenv penv; /* pitch envelope */
292 iwffff_xenv_t venv; /* volume envelope */ 292 struct iwffff_xenv venv; /* volume envelope */
293} iwffff_xlayer_t; 293};
294 294
295/* 295/*
296 * Instrument 296 * Instrument
297 */ 297 */
298 298
299typedef struct iwffff_xinstrument { 299struct iwffff_xinstrument {
300 __u32 stype; 300 __u32 stype;
301 301
302 __u16 exclusion; 302 __u16 exclusion;
@@ -307,7 +307,7 @@ typedef struct iwffff_xinstrument {
307 __u8 effect1_depth; /* 0-127 */ 307 __u8 effect1_depth; /* 0-127 */
308 __u8 effect2; /* effect 2 */ 308 __u8 effect2; /* effect 2 */
309 __u8 effect2_depth; /* 0-127 */ 309 __u8 effect2_depth; /* 0-127 */
310} iwffff_xinstrument_t; 310};
311 311
312/* 312/*
313 * ROM support 313 * ROM support
@@ -316,7 +316,7 @@ typedef struct iwffff_xinstrument {
316 316
317#define IWFFFF_ROM_HDR_SIZE 512 317#define IWFFFF_ROM_HDR_SIZE 512
318 318
319typedef struct { 319struct iwffff_rom_header {
320 __u8 iwave[8]; 320 __u8 iwave[8];
321 __u8 revision; 321 __u8 revision;
322 __u8 series_number; 322 __u8 series_number;
@@ -328,7 +328,7 @@ typedef struct {
328 __u8 copyright[128]; 328 __u8 copyright[128];
329 __u8 vendor_name[64]; 329 __u8 vendor_name[64];
330 __u8 description[128]; 330 __u8 description[128];
331} iwffff_rom_header_t; 331};
332 332
333/* 333/*
334 * Instrument info 334 * Instrument info
@@ -339,35 +339,46 @@ typedef struct {
339#define IWFFFF_INFO_LFO_TREMOLO (1<<2) 339#define IWFFFF_INFO_LFO_TREMOLO (1<<2)
340#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3) 340#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3)
341 341
342typedef struct iwffff_info { 342struct iwffff_info {
343 unsigned int format; /* supported format bits */ 343 unsigned int format; /* supported format bits */
344 unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */ 344 unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */
345 unsigned int lfos; /* LFO effects */ 345 unsigned int lfos; /* LFO effects */
346 unsigned int max8_len; /* maximum 8-bit wave length */ 346 unsigned int max8_len; /* maximum 8-bit wave length */
347 unsigned int max16_len; /* maximum 16-bit wave length */ 347 unsigned int max16_len; /* maximum 16-bit wave length */
348} iwffff_info_t; 348};
349 349
350#ifdef __KERNEL__ 350#ifdef __KERNEL__
351 351
352#include "seq_instr.h" 352#include "seq_instr.h"
353 353
354typedef struct { 354struct snd_iwffff_ops {
355 void *private_data; 355 void *private_data;
356 int (*info)(void *private_data, iwffff_info_t *info); 356 int (*info)(void *private_data, struct iwffff_info *info);
357 int (*put_sample)(void *private_data, iwffff_wave_t *wave, 357 int (*put_sample)(void *private_data, struct iwffff_wave *wave,
358 char __user *data, long len, int atomic); 358 char __user *data, long len, int atomic);
359 int (*get_sample)(void *private_data, iwffff_wave_t *wave, 359 int (*get_sample)(void *private_data, struct iwffff_wave *wave,
360 char __user *data, long len, int atomic); 360 char __user *data, long len, int atomic);
361 int (*remove_sample)(void *private_data, iwffff_wave_t *wave, 361 int (*remove_sample)(void *private_data, struct iwffff_wave *wave,
362 int atomic); 362 int atomic);
363 void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); 363 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
364 snd_seq_kinstr_ops_t kops; 364 struct snd_seq_kinstr_ops kops;
365} snd_iwffff_ops_t; 365};
366 366
367int snd_seq_iwffff_init(snd_iwffff_ops_t *ops, 367int snd_seq_iwffff_init(struct snd_iwffff_ops *ops,
368 void *private_data, 368 void *private_data,
369 snd_seq_kinstr_ops_t *next); 369 struct snd_seq_kinstr_ops *next);
370 370
371#endif 371#endif
372 372
373/* typedefs for compatibility to user-space */
374typedef struct iwffff_xwave iwffff_xwave_t;
375typedef struct iwffff_xlfo iwffff_xlfo_t;
376typedef struct iwffff_xenv_point iwffff_xenv_point_t;
377typedef struct iwffff_xenv_record iwffff_xenv_record_t;
378typedef struct iwffff_xenv iwffff_xenv_t;
379typedef struct iwffff_xlayer iwffff_xlayer_t;
380typedef struct iwffff_xinstrument iwffff_xinstrument_t;
381typedef struct iwffff_rom_header iwffff_rom_header_t;
382typedef struct iwffff_info iwffff_info_t;
383
373#endif /* __SOUND_AINSTR_IW_H */ 384#endif /* __SOUND_AINSTR_IW_H */
diff --git a/include/sound/ainstr_simple.h b/include/sound/ainstr_simple.h
index 40824b4ab23d..5eead12e58ae 100644
--- a/include/sound/ainstr_simple.h
+++ b/include/sound/ainstr_simple.h
@@ -61,18 +61,18 @@
61 * instrument info 61 * instrument info
62 */ 62 */
63 63
64typedef struct simple_instrument_info { 64struct simple_instrument_info {
65 unsigned int format; /* supported format bits */ 65 unsigned int format; /* supported format bits */
66 unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */ 66 unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */
67 unsigned int max8_len; /* maximum 8-bit wave length */ 67 unsigned int max8_len; /* maximum 8-bit wave length */
68 unsigned int max16_len; /* maximum 16-bit wave length */ 68 unsigned int max16_len; /* maximum 16-bit wave length */
69} simple_instrument_info_t; 69};
70 70
71/* 71/*
72 * Instrument 72 * Instrument
73 */ 73 */
74 74
75typedef struct { 75struct simple_instrument {
76 unsigned int share_id[4]; /* share id - zero = no sharing */ 76 unsigned int share_id[4]; /* share id - zero = no sharing */
77 unsigned int format; /* wave format */ 77 unsigned int format; /* wave format */
78 78
@@ -92,7 +92,7 @@ typedef struct {
92 unsigned char effect1_depth; /* 0-127 */ 92 unsigned char effect1_depth; /* 0-127 */
93 unsigned char effect2; /* effect 2 */ 93 unsigned char effect2; /* effect 2 */
94 unsigned char effect2_depth; /* 0-127 */ 94 unsigned char effect2_depth; /* 0-127 */
95} simple_instrument_t; 95};
96 96
97/* 97/*
98 * 98 *
@@ -112,7 +112,7 @@ typedef struct {
112 * Instrument 112 * Instrument
113 */ 113 */
114 114
115typedef struct simple_xinstrument { 115struct simple_xinstrument {
116 __u32 stype; 116 __u32 stype;
117 117
118 __u32 share_id[4]; /* share id - zero = no sharing */ 118 __u32 share_id[4]; /* share id - zero = no sharing */
@@ -128,29 +128,32 @@ typedef struct simple_xinstrument {
128 __u8 effect1_depth; /* 0-127 */ 128 __u8 effect1_depth; /* 0-127 */
129 __u8 effect2; /* effect 2 */ 129 __u8 effect2; /* effect 2 */
130 __u8 effect2_depth; /* 0-127 */ 130 __u8 effect2_depth; /* 0-127 */
131} simple_xinstrument_t; 131};
132 132
133#ifdef __KERNEL__ 133#ifdef __KERNEL__
134 134
135#include "seq_instr.h" 135#include "seq_instr.h"
136 136
137typedef struct { 137struct snd_simple_ops {
138 void *private_data; 138 void *private_data;
139 int (*info)(void *private_data, simple_instrument_info_t *info); 139 int (*info)(void *private_data, struct simple_instrument_info *info);
140 int (*put_sample)(void *private_data, simple_instrument_t *instr, 140 int (*put_sample)(void *private_data, struct simple_instrument *instr,
141 char __user *data, long len, int atomic); 141 char __user *data, long len, int atomic);
142 int (*get_sample)(void *private_data, simple_instrument_t *instr, 142 int (*get_sample)(void *private_data, struct simple_instrument *instr,
143 char __user *data, long len, int atomic); 143 char __user *data, long len, int atomic);
144 int (*remove_sample)(void *private_data, simple_instrument_t *instr, 144 int (*remove_sample)(void *private_data, struct simple_instrument *instr,
145 int atomic); 145 int atomic);
146 void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); 146 void (*notify)(void *private_data, struct snd_seq_kinstr *instr, int what);
147 snd_seq_kinstr_ops_t kops; 147 struct snd_seq_kinstr_ops kops;
148} snd_simple_ops_t; 148};
149 149
150int snd_seq_simple_init(snd_simple_ops_t *ops, 150int snd_seq_simple_init(struct snd_simple_ops *ops,
151 void *private_data, 151 void *private_data,
152 snd_seq_kinstr_ops_t *next); 152 struct snd_seq_kinstr_ops *next);
153 153
154#endif 154#endif
155 155
156/* typedefs for compatibility to user-space */
157typedef struct simple_xinstrument simple_xinstrument_t;
158
156#endif /* __SOUND_AINSTR_SIMPLE_H */ 159#endif /* __SOUND_AINSTR_SIMPLE_H */
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h
index f3f2c3e5ae51..11702aa0bea9 100644
--- a/include/sound/ak4114.h
+++ b/include/sound/ak4114.h
@@ -163,10 +163,8 @@
163typedef void (ak4114_write_t)(void *private_data, unsigned char addr, unsigned char data); 163typedef void (ak4114_write_t)(void *private_data, unsigned char addr, unsigned char data);
164typedef unsigned char (ak4114_read_t)(void *private_data, unsigned char addr); 164typedef unsigned char (ak4114_read_t)(void *private_data, unsigned char addr);
165 165
166typedef struct ak4114 ak4114_t;
167
168struct ak4114 { 166struct ak4114 {
169 snd_card_t * card; 167 struct snd_card *card;
170 ak4114_write_t * write; 168 ak4114_write_t * write;
171 ak4114_read_t * read; 169 ak4114_read_t * read;
172 void * private_data; 170 void * private_data;
@@ -174,9 +172,9 @@ struct ak4114 {
174 spinlock_t lock; 172 spinlock_t lock;
175 unsigned char regmap[7]; 173 unsigned char regmap[7];
176 unsigned char txcsb[5]; 174 unsigned char txcsb[5];
177 snd_kcontrol_t *kctls[AK4114_CONTROLS]; 175 struct snd_kcontrol *kctls[AK4114_CONTROLS];
178 snd_pcm_substream_t *playback_substream; 176 struct snd_pcm_substream *playback_substream;
179 snd_pcm_substream_t *capture_substream; 177 struct snd_pcm_substream *capture_substream;
180 unsigned long parity_errors; 178 unsigned long parity_errors;
181 unsigned long v_bit_errors; 179 unsigned long v_bit_errors;
182 unsigned long qcrc_errors; 180 unsigned long qcrc_errors;
@@ -186,20 +184,20 @@ struct ak4114 {
186 struct workqueue_struct *workqueue; 184 struct workqueue_struct *workqueue;
187 struct work_struct work; 185 struct work_struct work;
188 void *change_callback_private; 186 void *change_callback_private;
189 void (*change_callback)(ak4114_t *ak4114, unsigned char c0, unsigned char c1); 187 void (*change_callback)(struct ak4114 *ak4114, unsigned char c0, unsigned char c1);
190}; 188};
191 189
192int snd_ak4114_create(snd_card_t *card, 190int snd_ak4114_create(struct snd_card *card,
193 ak4114_read_t *read, ak4114_write_t *write, 191 ak4114_read_t *read, ak4114_write_t *write,
194 unsigned char pgm[7], unsigned char txcsb[5], 192 unsigned char pgm[7], unsigned char txcsb[5],
195 void *private_data, ak4114_t **r_ak4114); 193 void *private_data, struct ak4114 **r_ak4114);
196void snd_ak4114_reg_write(ak4114_t *ak4114, unsigned char reg, unsigned char mask, unsigned char val); 194void snd_ak4114_reg_write(struct ak4114 *ak4114, unsigned char reg, unsigned char mask, unsigned char val);
197void snd_ak4114_reinit(ak4114_t *ak4114); 195void snd_ak4114_reinit(struct ak4114 *ak4114);
198int snd_ak4114_build(ak4114_t *ak4114, 196int snd_ak4114_build(struct ak4114 *ak4114,
199 snd_pcm_substream_t *playback_substream, 197 struct snd_pcm_substream *playback_substream,
200 snd_pcm_substream_t *capture_substream); 198 struct snd_pcm_substream *capture_substream);
201int snd_ak4114_external_rate(ak4114_t *ak4114); 199int snd_ak4114_external_rate(struct ak4114 *ak4114);
202int snd_ak4114_check_rate_and_errors(ak4114_t *ak4114, unsigned int flags); 200int snd_ak4114_check_rate_and_errors(struct ak4114 *ak4114, unsigned int flags);
203 201
204#endif /* __SOUND_AK4114_H */ 202#endif /* __SOUND_AK4114_H */
205 203
diff --git a/include/sound/ak4117.h b/include/sound/ak4117.h
index 9e1dab17c33e..2b96c32f06fd 100644
--- a/include/sound/ak4117.h
+++ b/include/sound/ak4117.h
@@ -155,18 +155,16 @@
155typedef void (ak4117_write_t)(void *private_data, unsigned char addr, unsigned char data); 155typedef void (ak4117_write_t)(void *private_data, unsigned char addr, unsigned char data);
156typedef unsigned char (ak4117_read_t)(void *private_data, unsigned char addr); 156typedef unsigned char (ak4117_read_t)(void *private_data, unsigned char addr);
157 157
158typedef struct ak4117 ak4117_t;
159
160struct ak4117 { 158struct ak4117 {
161 snd_card_t * card; 159 struct snd_card *card;
162 ak4117_write_t * write; 160 ak4117_write_t * write;
163 ak4117_read_t * read; 161 ak4117_read_t * read;
164 void * private_data; 162 void * private_data;
165 unsigned int init: 1; 163 unsigned int init: 1;
166 spinlock_t lock; 164 spinlock_t lock;
167 unsigned char regmap[5]; 165 unsigned char regmap[5];
168 snd_kcontrol_t *kctls[AK4117_CONTROLS]; 166 struct snd_kcontrol *kctls[AK4117_CONTROLS];
169 snd_pcm_substream_t *substream; 167 struct snd_pcm_substream *substream;
170 unsigned long parity_errors; 168 unsigned long parity_errors;
171 unsigned long v_bit_errors; 169 unsigned long v_bit_errors;
172 unsigned long qcrc_errors; 170 unsigned long qcrc_errors;
@@ -176,16 +174,16 @@ struct ak4117 {
176 unsigned char rcs2; 174 unsigned char rcs2;
177 struct timer_list timer; /* statistic timer */ 175 struct timer_list timer; /* statistic timer */
178 void *change_callback_private; 176 void *change_callback_private;
179 void (*change_callback)(ak4117_t *ak4117, unsigned char c0, unsigned char c1); 177 void (*change_callback)(struct ak4117 *ak4117, unsigned char c0, unsigned char c1);
180}; 178};
181 179
182int snd_ak4117_create(snd_card_t *card, ak4117_read_t *read, ak4117_write_t *write, 180int snd_ak4117_create(struct snd_card *card, ak4117_read_t *read, ak4117_write_t *write,
183 unsigned char pgm[5], void *private_data, ak4117_t **r_ak4117); 181 unsigned char pgm[5], void *private_data, struct ak4117 **r_ak4117);
184void snd_ak4117_reg_write(ak4117_t *ak4117, unsigned char reg, unsigned char mask, unsigned char val); 182void snd_ak4117_reg_write(struct ak4117 *ak4117, unsigned char reg, unsigned char mask, unsigned char val);
185void snd_ak4117_reinit(ak4117_t *ak4117); 183void snd_ak4117_reinit(struct ak4117 *ak4117);
186int snd_ak4117_build(ak4117_t *ak4117, snd_pcm_substream_t *capture_substream); 184int snd_ak4117_build(struct ak4117 *ak4117, struct snd_pcm_substream *capture_substream);
187int snd_ak4117_external_rate(ak4117_t *ak4117); 185int snd_ak4117_external_rate(struct ak4117 *ak4117);
188int snd_ak4117_check_rate_and_errors(ak4117_t *ak4117, unsigned int flags); 186int snd_ak4117_check_rate_and_errors(struct ak4117 *ak4117, unsigned int flags);
189 187
190#endif /* __SOUND_AK4117_H */ 188#endif /* __SOUND_AK4117_H */
191 189
diff --git a/include/sound/ak4531_codec.h b/include/sound/ak4531_codec.h
index 8b18992376d5..edf04070ce7c 100644
--- a/include/sound/ak4531_codec.h
+++ b/include/sound/ak4531_codec.h
@@ -64,17 +64,22 @@
64#define AK4531_AD_IN 0x18 /* AD input select */ 64#define AK4531_AD_IN 0x18 /* AD input select */
65#define AK4531_MIC_GAIN 0x19 /* MIC amplified gain */ 65#define AK4531_MIC_GAIN 0x19 /* MIC amplified gain */
66 66
67typedef struct _snd_ak4531 ak4531_t; 67struct snd_ak4531 {
68 68 void (*write) (struct snd_ak4531 *ak4531, unsigned short reg,
69struct _snd_ak4531 { 69 unsigned short val);
70 void (*write) (ak4531_t *ak4531, unsigned short reg, unsigned short val);
71 void *private_data; 70 void *private_data;
72 void (*private_free) (ak4531_t *ak4531); 71 void (*private_free) (struct snd_ak4531 *ak4531);
73 /* --- */ 72 /* --- */
74 unsigned char regs[0x20]; 73 unsigned char regs[0x20];
75 struct semaphore reg_mutex; 74 struct semaphore reg_mutex;
76}; 75};
77 76
78int snd_ak4531_mixer(snd_card_t * card, ak4531_t * _ak4531, ak4531_t ** rak4531); 77int snd_ak4531_mixer(struct snd_card *card, struct snd_ak4531 *_ak4531,
78 struct snd_ak4531 **rak4531);
79
80#ifdef CONFIG_PM
81void snd_ak4531_suspend(struct snd_ak4531 *ak4531);
82void snd_ak4531_resume(struct snd_ak4531 *ak4531);
83#endif
79 84
80#endif /* __SOUND_AK4531_CODEC_H */ 85#endif /* __SOUND_AK4531_CODEC_H */
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h
index e94ac0282318..3bf5911fe827 100644
--- a/include/sound/ak4xxx-adda.h
+++ b/include/sound/ak4xxx-adda.h
@@ -27,20 +27,20 @@
27#define AK4XXX_MAX_CHIPS 4 27#define AK4XXX_MAX_CHIPS 4
28#endif 28#endif
29 29
30typedef struct snd_akm4xxx akm4xxx_t; 30struct snd_akm4xxx;
31 31
32struct snd_ak4xxx_ops { 32struct snd_ak4xxx_ops {
33 void (*lock)(akm4xxx_t *ak, int chip); 33 void (*lock)(struct snd_akm4xxx *ak, int chip);
34 void (*unlock)(akm4xxx_t *ak, int chip); 34 void (*unlock)(struct snd_akm4xxx *ak, int chip);
35 void (*write)(akm4xxx_t *ak, int chip, unsigned char reg, unsigned char val); 35 void (*write)(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val);
36 // unsigned char (*read)(akm4xxx_t *ak, int chip, unsigned char reg); 36 // unsigned char (*read)(struct snd_akm4xxx *ak, int chip, unsigned char reg);
37 void (*set_rate_val)(akm4xxx_t *ak, unsigned int rate); 37 void (*set_rate_val)(struct snd_akm4xxx *ak, unsigned int rate);
38}; 38};
39 39
40#define AK4XXX_IMAGE_SIZE (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */ 40#define AK4XXX_IMAGE_SIZE (AK4XXX_MAX_CHIPS * 16) /* 64 bytes */
41 41
42struct snd_akm4xxx { 42struct snd_akm4xxx {
43 snd_card_t *card; 43 struct snd_card *card;
44 unsigned int num_adcs; /* AK4524 or AK4528 ADCs */ 44 unsigned int num_adcs; /* AK4524 or AK4528 ADCs */
45 unsigned int num_dacs; /* AK4524 or AK4528 DACs */ 45 unsigned int num_dacs; /* AK4524 or AK4528 DACs */
46 unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */ 46 unsigned char images[AK4XXX_IMAGE_SIZE]; /* saved register image */
@@ -56,10 +56,10 @@ struct snd_akm4xxx {
56 struct snd_ak4xxx_ops ops; 56 struct snd_ak4xxx_ops ops;
57}; 57};
58 58
59void snd_akm4xxx_write(akm4xxx_t *ak, int chip, unsigned char reg, unsigned char val); 59void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, unsigned char val);
60void snd_akm4xxx_reset(akm4xxx_t *ak, int state); 60void snd_akm4xxx_reset(struct snd_akm4xxx *ak, int state);
61void snd_akm4xxx_init(akm4xxx_t *ak); 61void snd_akm4xxx_init(struct snd_akm4xxx *ak);
62int snd_akm4xxx_build_controls(akm4xxx_t *ak); 62int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak);
63 63
64#define snd_akm4xxx_get(ak,chip,reg) (ak)->images[(chip) * 16 + (reg)] 64#define snd_akm4xxx_get(ak,chip,reg) (ak)->images[(chip) * 16 + (reg)]
65#define snd_akm4xxx_set(ak,chip,reg,val) ((ak)->images[(chip) * 16 + (reg)] = (val)) 65#define snd_akm4xxx_set(ak,chip,reg,val) ((ak)->images[(chip) * 16 + (reg)] = (val))
diff --git a/include/sound/asequencer.h b/include/sound/asequencer.h
index 728efd504262..6691e4aa4ea7 100644
--- a/include/sound/asequencer.h
+++ b/include/sound/asequencer.h
@@ -22,11 +22,10 @@
22#ifndef __SOUND_ASEQUENCER_H 22#ifndef __SOUND_ASEQUENCER_H
23#define __SOUND_ASEQUENCER_H 23#define __SOUND_ASEQUENCER_H
24 24
25#ifndef __KERNEL__ 25#ifdef __KERNEL__
26#include <linux/ioctl.h> 26#include <linux/ioctl.h>
27#endif
28
29#include <sound/asound.h> 27#include <sound/asound.h>
28#endif
30 29
31/** version of the sequencer */ 30/** version of the sequencer */
32#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1) 31#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
@@ -36,13 +35,13 @@
36 */ 35 */
37 36
38/** system messages 37/** system messages
39 * event data type = #sndrv_seq_result_t 38 * event data type = #snd_seq_result
40 */ 39 */
41#define SNDRV_SEQ_EVENT_SYSTEM 0 40#define SNDRV_SEQ_EVENT_SYSTEM 0
42#define SNDRV_SEQ_EVENT_RESULT 1 41#define SNDRV_SEQ_EVENT_RESULT 1
43 42
44/** note messages (channel specific) 43/** note messages (channel specific)
45 * event data type = #sndrv_seq_ev_note 44 * event data type = #snd_seq_ev_note
46 */ 45 */
47#define SNDRV_SEQ_EVENT_NOTE 5 46#define SNDRV_SEQ_EVENT_NOTE 5
48#define SNDRV_SEQ_EVENT_NOTEON 6 47#define SNDRV_SEQ_EVENT_NOTEON 6
@@ -50,7 +49,7 @@
50#define SNDRV_SEQ_EVENT_KEYPRESS 8 49#define SNDRV_SEQ_EVENT_KEYPRESS 8
51 50
52/** control messages (channel specific) 51/** control messages (channel specific)
53 * event data type = #sndrv_seq_ev_ctrl 52 * event data type = #snd_seq_ev_ctrl
54 */ 53 */
55#define SNDRV_SEQ_EVENT_CONTROLLER 10 54#define SNDRV_SEQ_EVENT_CONTROLLER 10
56#define SNDRV_SEQ_EVENT_PGMCHANGE 11 55#define SNDRV_SEQ_EVENT_PGMCHANGE 11
@@ -61,7 +60,7 @@
61#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */ 60#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
62 61
63/** synchronisation messages 62/** synchronisation messages
64 * event data type = #sndrv_seq_ev_ctrl 63 * event data type = #snd_seq_ev_ctrl
65 */ 64 */
66#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */ 65#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
67#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */ 66#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
@@ -70,7 +69,7 @@
70#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */ 69#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
71 70
72/** timer messages 71/** timer messages
73 * event data type = sndrv_seq_ev_queue_control_t 72 * event data type = snd_seq_ev_queue_control
74 */ 73 */
75#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */ 74#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
76#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */ 75#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
@@ -96,7 +95,7 @@
96#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */ 95#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
97 96
98/** system status messages (broadcast for subscribers) 97/** system status messages (broadcast for subscribers)
99 * event data type = sndrv_seq_addr_t 98 * event data type = snd_seq_addr
100 */ 99 */
101#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */ 100#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
102#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */ 101#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
@@ -106,13 +105,13 @@
106#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */ 105#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
107 106
108/** port connection changes 107/** port connection changes
109 * event data type = sndrv_seq_connect_t 108 * event data type = snd_seq_connect
110 */ 109 */
111#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ 110#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
112#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ 111#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
113 112
114/** synthesizer events 113/** synthesizer events
115 * event data type = sndrv_seq_eve_sample_control_t 114 * event data type = snd_seq_eve_sample_control
116 */ 115 */
117#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */ 116#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */
118#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */ 117#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */
@@ -163,7 +162,7 @@
163/* 119-129: reserved */ 162/* 119-129: reserved */
164 163
165/* 130-139: variable length events 164/* 130-139: variable length events
166 * event data type = sndrv_seq_ev_ext 165 * event data type = snd_seq_ev_ext
167 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set) 166 * (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
168 */ 167 */
169#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */ 168#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
@@ -187,18 +186,18 @@
187#define SNDRV_SEQ_EVENT_NONE 255 186#define SNDRV_SEQ_EVENT_NONE 255
188 187
189 188
190typedef unsigned char sndrv_seq_event_type_t; 189typedef unsigned char snd_seq_event_type_t;
191 190
192/** event address */ 191/** event address */
193struct sndrv_seq_addr { 192struct snd_seq_addr {
194 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */ 193 unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
195 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */ 194 unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
196}; 195};
197 196
198/** port connection */ 197/** port connection */
199struct sndrv_seq_connect { 198struct snd_seq_connect {
200 struct sndrv_seq_addr sender; 199 struct snd_seq_addr sender;
201 struct sndrv_seq_addr dest; 200 struct snd_seq_addr dest;
202}; 201};
203 202
204 203
@@ -227,7 +226,7 @@ struct sndrv_seq_connect {
227 226
228 227
229 /* note event */ 228 /* note event */
230struct sndrv_seq_ev_note { 229struct snd_seq_ev_note {
231 unsigned char channel; 230 unsigned char channel;
232 unsigned char note; 231 unsigned char note;
233 unsigned char velocity; 232 unsigned char velocity;
@@ -236,7 +235,7 @@ struct sndrv_seq_ev_note {
236}; 235};
237 236
238 /* controller event */ 237 /* controller event */
239struct sndrv_seq_ev_ctrl { 238struct snd_seq_ev_ctrl {
240 unsigned char channel; 239 unsigned char channel;
241 unsigned char unused1, unused2, unused3; /* pad */ 240 unsigned char unused1, unused2, unused3; /* pad */
242 unsigned int param; 241 unsigned int param;
@@ -244,59 +243,59 @@ struct sndrv_seq_ev_ctrl {
244}; 243};
245 244
246 /* generic set of bytes (12x8 bit) */ 245 /* generic set of bytes (12x8 bit) */
247struct sndrv_seq_ev_raw8 { 246struct snd_seq_ev_raw8 {
248 unsigned char d[12]; /* 8 bit value */ 247 unsigned char d[12]; /* 8 bit value */
249}; 248};
250 249
251 /* generic set of integers (3x32 bit) */ 250 /* generic set of integers (3x32 bit) */
252struct sndrv_seq_ev_raw32 { 251struct snd_seq_ev_raw32 {
253 unsigned int d[3]; /* 32 bit value */ 252 unsigned int d[3]; /* 32 bit value */
254}; 253};
255 254
256 /* external stored data */ 255 /* external stored data */
257struct sndrv_seq_ev_ext { 256struct snd_seq_ev_ext {
258 unsigned int len; /* length of data */ 257 unsigned int len; /* length of data */
259 void *ptr; /* pointer to data (note: maybe 64-bit) */ 258 void *ptr; /* pointer to data (note: maybe 64-bit) */
260} __attribute__((packed)); 259} __attribute__((packed));
261 260
262/* Instrument cluster type */ 261/* Instrument cluster type */
263typedef unsigned int sndrv_seq_instr_cluster_t; 262typedef unsigned int snd_seq_instr_cluster_t;
264 263
265/* Instrument type */ 264/* Instrument type */
266struct sndrv_seq_instr { 265struct snd_seq_instr {
267 sndrv_seq_instr_cluster_t cluster; 266 snd_seq_instr_cluster_t cluster;
268 unsigned int std; /* the upper byte means a private instrument (owner - client #) */ 267 unsigned int std; /* the upper byte means a private instrument (owner - client #) */
269 unsigned short bank; 268 unsigned short bank;
270 unsigned short prg; 269 unsigned short prg;
271}; 270};
272 271
273 /* sample number */ 272 /* sample number */
274struct sndrv_seq_ev_sample { 273struct snd_seq_ev_sample {
275 unsigned int std; 274 unsigned int std;
276 unsigned short bank; 275 unsigned short bank;
277 unsigned short prg; 276 unsigned short prg;
278}; 277};
279 278
280 /* sample cluster */ 279 /* sample cluster */
281struct sndrv_seq_ev_cluster { 280struct snd_seq_ev_cluster {
282 sndrv_seq_instr_cluster_t cluster; 281 snd_seq_instr_cluster_t cluster;
283}; 282};
284 283
285 /* sample position */ 284 /* sample position */
286typedef unsigned int sndrv_seq_position_t; /* playback position (in samples) * 16 */ 285typedef unsigned int snd_seq_position_t; /* playback position (in samples) * 16 */
287 286
288 /* sample stop mode */ 287 /* sample stop mode */
289enum sndrv_seq_stop_mode { 288enum {
290 SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */ 289 SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */
291 SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */ 290 SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */
292 SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */ 291 SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */
293}; 292};
294 293
295 /* sample frequency */ 294 /* sample frequency */
296typedef int sndrv_seq_frequency_t; /* playback frequency in HZ * 16 */ 295typedef int snd_seq_frequency_t; /* playback frequency in HZ * 16 */
297 296
298 /* sample volume control; if any value is set to -1 == do not change */ 297 /* sample volume control; if any value is set to -1 == do not change */
299struct sndrv_seq_ev_volume { 298struct snd_seq_ev_volume {
300 signed short volume; /* range: 0-16383 */ 299 signed short volume; /* range: 0-16383 */
301 signed short lr; /* left-right balance; range: 0-16383 */ 300 signed short lr; /* left-right balance; range: 0-16383 */
302 signed short fr; /* front-rear balance; range: 0-16383 */ 301 signed short fr; /* front-rear balance; range: 0-16383 */
@@ -304,22 +303,22 @@ struct sndrv_seq_ev_volume {
304}; 303};
305 304
306 /* simple loop redefinition */ 305 /* simple loop redefinition */
307struct sndrv_seq_ev_loop { 306struct snd_seq_ev_loop {
308 unsigned int start; /* loop start (in samples) * 16 */ 307 unsigned int start; /* loop start (in samples) * 16 */
309 unsigned int end; /* loop end (in samples) * 16 */ 308 unsigned int end; /* loop end (in samples) * 16 */
310}; 309};
311 310
312struct sndrv_seq_ev_sample_control { 311struct snd_seq_ev_sample_control {
313 unsigned char channel; 312 unsigned char channel;
314 unsigned char unused1, unused2, unused3; /* pad */ 313 unsigned char unused1, unused2, unused3; /* pad */
315 union { 314 union {
316 struct sndrv_seq_ev_sample sample; 315 struct snd_seq_ev_sample sample;
317 struct sndrv_seq_ev_cluster cluster; 316 struct snd_seq_ev_cluster cluster;
318 sndrv_seq_position_t position; 317 snd_seq_position_t position;
319 enum sndrv_seq_stop_mode stop_mode; 318 int stop_mode;
320 sndrv_seq_frequency_t frequency; 319 snd_seq_frequency_t frequency;
321 struct sndrv_seq_ev_volume volume; 320 struct snd_seq_ev_volume volume;
322 struct sndrv_seq_ev_loop loop; 321 struct snd_seq_ev_loop loop;
323 unsigned char raw8[8]; 322 unsigned char raw8[8];
324 } param; 323 } param;
325}; 324};
@@ -327,82 +326,82 @@ struct sndrv_seq_ev_sample_control {
327 326
328 327
329/* INSTR_BEGIN event */ 328/* INSTR_BEGIN event */
330struct sndrv_seq_ev_instr_begin { 329struct snd_seq_ev_instr_begin {
331 int timeout; /* zero = forever, otherwise timeout in ms */ 330 int timeout; /* zero = forever, otherwise timeout in ms */
332}; 331};
333 332
334struct sndrv_seq_result { 333struct snd_seq_result {
335 int event; /* processed event type */ 334 int event; /* processed event type */
336 int result; 335 int result;
337}; 336};
338 337
339 338
340struct sndrv_seq_real_time { 339struct snd_seq_real_time {
341 unsigned int tv_sec; /* seconds */ 340 unsigned int tv_sec; /* seconds */
342 unsigned int tv_nsec; /* nanoseconds */ 341 unsigned int tv_nsec; /* nanoseconds */
343}; 342};
344 343
345typedef unsigned int sndrv_seq_tick_time_t; /* midi ticks */ 344typedef unsigned int snd_seq_tick_time_t; /* midi ticks */
346 345
347union sndrv_seq_timestamp { 346union snd_seq_timestamp {
348 sndrv_seq_tick_time_t tick; 347 snd_seq_tick_time_t tick;
349 struct sndrv_seq_real_time time; 348 struct snd_seq_real_time time;
350}; 349};
351 350
352struct sndrv_seq_queue_skew { 351struct snd_seq_queue_skew {
353 unsigned int value; 352 unsigned int value;
354 unsigned int base; 353 unsigned int base;
355}; 354};
356 355
357 /* queue timer control */ 356 /* queue timer control */
358struct sndrv_seq_ev_queue_control { 357struct snd_seq_ev_queue_control {
359 unsigned char queue; /* affected queue */ 358 unsigned char queue; /* affected queue */
360 unsigned char pad[3]; /* reserved */ 359 unsigned char pad[3]; /* reserved */
361 union { 360 union {
362 signed int value; /* affected value (e.g. tempo) */ 361 signed int value; /* affected value (e.g. tempo) */
363 union sndrv_seq_timestamp time; /* time */ 362 union snd_seq_timestamp time; /* time */
364 unsigned int position; /* sync position */ 363 unsigned int position; /* sync position */
365 struct sndrv_seq_queue_skew skew; 364 struct snd_seq_queue_skew skew;
366 unsigned int d32[2]; 365 unsigned int d32[2];
367 unsigned char d8[8]; 366 unsigned char d8[8];
368 } param; 367 } param;
369}; 368};
370 369
371 /* quoted event - inside the kernel only */ 370 /* quoted event - inside the kernel only */
372struct sndrv_seq_ev_quote { 371struct snd_seq_ev_quote {
373 struct sndrv_seq_addr origin; /* original sender */ 372 struct snd_seq_addr origin; /* original sender */
374 unsigned short value; /* optional data */ 373 unsigned short value; /* optional data */
375 struct sndrv_seq_event *event; /* quoted event */ 374 struct snd_seq_event *event; /* quoted event */
376} __attribute__((packed)); 375} __attribute__((packed));
377 376
378 377
379 /* sequencer event */ 378 /* sequencer event */
380struct sndrv_seq_event { 379struct snd_seq_event {
381 sndrv_seq_event_type_t type; /* event type */ 380 snd_seq_event_type_t type; /* event type */
382 unsigned char flags; /* event flags */ 381 unsigned char flags; /* event flags */
383 char tag; 382 char tag;
384 383
385 unsigned char queue; /* schedule queue */ 384 unsigned char queue; /* schedule queue */
386 union sndrv_seq_timestamp time; /* schedule time */ 385 union snd_seq_timestamp time; /* schedule time */
387 386
388 387
389 struct sndrv_seq_addr source; /* source address */ 388 struct snd_seq_addr source; /* source address */
390 struct sndrv_seq_addr dest; /* destination address */ 389 struct snd_seq_addr dest; /* destination address */
391 390
392 union { /* event data... */ 391 union { /* event data... */
393 struct sndrv_seq_ev_note note; 392 struct snd_seq_ev_note note;
394 struct sndrv_seq_ev_ctrl control; 393 struct snd_seq_ev_ctrl control;
395 struct sndrv_seq_ev_raw8 raw8; 394 struct snd_seq_ev_raw8 raw8;
396 struct sndrv_seq_ev_raw32 raw32; 395 struct snd_seq_ev_raw32 raw32;
397 struct sndrv_seq_ev_ext ext; 396 struct snd_seq_ev_ext ext;
398 struct sndrv_seq_ev_queue_control queue; 397 struct snd_seq_ev_queue_control queue;
399 union sndrv_seq_timestamp time; 398 union snd_seq_timestamp time;
400 struct sndrv_seq_addr addr; 399 struct snd_seq_addr addr;
401 struct sndrv_seq_connect connect; 400 struct snd_seq_connect connect;
402 struct sndrv_seq_result result; 401 struct snd_seq_result result;
403 struct sndrv_seq_ev_instr_begin instr_begin; 402 struct snd_seq_ev_instr_begin instr_begin;
404 struct sndrv_seq_ev_sample_control sample; 403 struct snd_seq_ev_sample_control sample;
405 struct sndrv_seq_ev_quote quote; 404 struct snd_seq_ev_quote quote;
406 } data; 405 } data;
407}; 406};
408 407
@@ -410,72 +409,77 @@ struct sndrv_seq_event {
410/* 409/*
411 * bounce event - stored as variable size data 410 * bounce event - stored as variable size data
412 */ 411 */
413struct sndrv_seq_event_bounce { 412struct snd_seq_event_bounce {
414 int err; 413 int err;
415 struct sndrv_seq_event event; 414 struct snd_seq_event event;
416 /* external data follows here. */ 415 /* external data follows here. */
417}; 416};
418 417
419#define sndrv_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(sndrv_seq_event_bounce_t))) 418#ifdef __KERNEL__
419
420/* helper macro */
421#define snd_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(struct snd_seq_event_bounce)))
420 422
421/* 423/*
422 * type check macros 424 * type check macros
423 */ 425 */
424/* result events: 0-4 */ 426/* result events: 0-4 */
425#define sndrv_seq_ev_is_result_type(ev) ((ev)->type < 5) 427#define snd_seq_ev_is_result_type(ev) ((ev)->type < 5)
426/* channel specific events: 5-19 */ 428/* channel specific events: 5-19 */
427#define sndrv_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20) 429#define snd_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)
428/* note events: 5-9 */ 430/* note events: 5-9 */
429#define sndrv_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10) 431#define snd_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)
430/* control events: 10-19 */ 432/* control events: 10-19 */
431#define sndrv_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20) 433#define snd_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)
432/* queue control events: 30-39 */ 434/* queue control events: 30-39 */
433#define sndrv_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40) 435#define snd_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)
434/* system status messages */ 436/* system status messages */
435#define sndrv_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69) 437#define snd_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)
436/* sample messages */ 438/* sample messages */
437#define sndrv_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79) 439#define snd_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)
438/* user-defined messages */ 440/* user-defined messages */
439#define sndrv_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99) 441#define snd_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
440/* fixed length events: 0-99 */ 442/* fixed length events: 0-99 */
441#define sndrv_seq_ev_is_fixed_type(ev) ((ev)->type < 100) 443#define snd_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
442/* instrument layer events: 100-129 */ 444/* instrument layer events: 100-129 */
443#define sndrv_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130) 445#define snd_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)
444/* variable length events: 130-139 */ 446/* variable length events: 130-139 */
445#define sndrv_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140) 447#define snd_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
446/* reserved for kernel */ 448/* reserved for kernel */
447#define sndrv_seq_ev_is_reserved(ev) ((ev)->type >= 150) 449#define snd_seq_ev_is_reserved(ev) ((ev)->type >= 150)
448 450
449/* direct dispatched events */ 451/* direct dispatched events */
450#define sndrv_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT) 452#define snd_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)
451 453
452/* 454/*
453 * macros to check event flags 455 * macros to check event flags
454 */ 456 */
455/* prior events */ 457/* prior events */
456#define sndrv_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH) 458#define snd_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)
457 459
458/* event length type */ 460/* event length type */
459#define sndrv_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) 461#define snd_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)
460#define sndrv_seq_ev_is_fixed(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED) 462#define snd_seq_ev_is_fixed(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)
461#define sndrv_seq_ev_is_variable(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE) 463#define snd_seq_ev_is_variable(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
462#define sndrv_seq_ev_is_varusr(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR) 464#define snd_seq_ev_is_varusr(ev) (snd_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)
463 465
464/* time-stamp type */ 466/* time-stamp type */
465#define sndrv_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK) 467#define snd_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)
466#define sndrv_seq_ev_is_tick(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK) 468#define snd_seq_ev_is_tick(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)
467#define sndrv_seq_ev_is_real(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL) 469#define snd_seq_ev_is_real(ev) (snd_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)
468 470
469/* time-mode type */ 471/* time-mode type */
470#define sndrv_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK) 472#define snd_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)
471#define sndrv_seq_ev_is_abstime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS) 473#define snd_seq_ev_is_abstime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)
472#define sndrv_seq_ev_is_reltime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL) 474#define snd_seq_ev_is_reltime(ev) (snd_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)
473 475
474/* queue sync port */ 476/* queue sync port */
475#define sndrv_seq_queue_sync_port(q) ((q) + 16) 477#define snd_seq_queue_sync_port(q) ((q) + 16)
478
479#endif /* __KERNEL__ */
476 480
477 /* system information */ 481 /* system information */
478struct sndrv_seq_system_info { 482struct snd_seq_system_info {
479 int queues; /* maximum queues count */ 483 int queues; /* maximum queues count */
480 int clients; /* maximum clients count */ 484 int clients; /* maximum clients count */
481 int ports; /* maximum ports per client */ 485 int ports; /* maximum ports per client */
@@ -487,7 +491,7 @@ struct sndrv_seq_system_info {
487 491
488 492
489 /* system running information */ 493 /* system running information */
490struct sndrv_seq_running_info { 494struct snd_seq_running_info {
491 unsigned char client; /* client id */ 495 unsigned char client; /* client id */
492 unsigned char big_endian; /* 1 = big-endian */ 496 unsigned char big_endian; /* 1 = big-endian */
493 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */ 497 unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
@@ -498,16 +502,16 @@ struct sndrv_seq_running_info {
498 502
499 /* known client numbers */ 503 /* known client numbers */
500#define SNDRV_SEQ_CLIENT_SYSTEM 0 504#define SNDRV_SEQ_CLIENT_SYSTEM 0
501#define SNDRV_SEQ_CLIENT_DUMMY 62 /* dummy ports */ 505 /* internal client numbers */
502#define SNDRV_SEQ_CLIENT_OSS 63 /* oss sequencer emulator */ 506#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
507#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
503 508
504 509
505 /* client types */ 510 /* client types */
506enum sndrv_seq_client_type { 511typedef int __bitwise snd_seq_client_type_t;
507 NO_CLIENT = 0, 512#define NO_CLIENT ((__force snd_seq_client_type_t) 0)
508 USER_CLIENT = 1, 513#define USER_CLIENT ((__force snd_seq_client_type_t) 1)
509 KERNEL_CLIENT = 2 514#define KERNEL_CLIENT ((__force snd_seq_client_type_t) 2)
510};
511 515
512 /* event filter flags */ 516 /* event filter flags */
513#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */ 517#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
@@ -515,9 +519,9 @@ enum sndrv_seq_client_type {
515#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */ 519#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
516#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */ 520#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
517 521
518struct sndrv_seq_client_info { 522struct snd_seq_client_info {
519 int client; /* client number to inquire */ 523 int client; /* client number to inquire */
520 enum sndrv_seq_client_type type; /* client type */ 524 snd_seq_client_type_t type; /* client type */
521 char name[64]; /* client name */ 525 char name[64]; /* client name */
522 unsigned int filter; /* filter flags */ 526 unsigned int filter; /* filter flags */
523 unsigned char multicast_filter[8]; /* multicast filter bitmap */ 527 unsigned char multicast_filter[8]; /* multicast filter bitmap */
@@ -529,7 +533,7 @@ struct sndrv_seq_client_info {
529 533
530 534
531/* client pool size */ 535/* client pool size */
532struct sndrv_seq_client_pool { 536struct snd_seq_client_pool {
533 int client; /* client number to inquire */ 537 int client; /* client number to inquire */
534 int output_pool; /* outgoing (write) pool size */ 538 int output_pool; /* outgoing (write) pool size */
535 int input_pool; /* incoming (read) pool size */ 539 int input_pool; /* incoming (read) pool size */
@@ -553,13 +557,13 @@ struct sndrv_seq_client_pool {
553#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */ 557#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
554#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */ 558#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
555 559
556struct sndrv_seq_remove_events { 560struct snd_seq_remove_events {
557 unsigned int remove_mode; /* Flags that determine what gets removed */ 561 unsigned int remove_mode; /* Flags that determine what gets removed */
558 562
559 union sndrv_seq_timestamp time; 563 union snd_seq_timestamp time;
560 564
561 unsigned char queue; /* Queue for REMOVE_DEST */ 565 unsigned char queue; /* Queue for REMOVE_DEST */
562 struct sndrv_seq_addr dest; /* Address for REMOVE_DEST */ 566 struct snd_seq_addr dest; /* Address for REMOVE_DEST */
563 unsigned char channel; /* Channel for REMOVE_DEST */ 567 unsigned char channel; /* Channel for REMOVE_DEST */
564 568
565 int type; /* For REMOVE_EVENT_TYPE */ 569 int type; /* For REMOVE_EVENT_TYPE */
@@ -608,8 +612,8 @@ struct sndrv_seq_remove_events {
608#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1) 612#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
609#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2) 613#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
610 614
611struct sndrv_seq_port_info { 615struct snd_seq_port_info {
612 struct sndrv_seq_addr addr; /* client/port numbers */ 616 struct snd_seq_addr addr; /* client/port numbers */
613 char name[64]; /* port name */ 617 char name[64]; /* port name */
614 618
615 unsigned int capability; /* port capability bits */ 619 unsigned int capability; /* port capability bits */
@@ -632,7 +636,7 @@ struct sndrv_seq_port_info {
632#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */ 636#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
633 637
634/* queue information */ 638/* queue information */
635struct sndrv_seq_queue_info { 639struct snd_seq_queue_info {
636 int queue; /* queue id */ 640 int queue; /* queue id */
637 641
638 /* 642 /*
@@ -648,11 +652,11 @@ struct sndrv_seq_queue_info {
648}; 652};
649 653
650/* queue info/status */ 654/* queue info/status */
651struct sndrv_seq_queue_status { 655struct snd_seq_queue_status {
652 int queue; /* queue id */ 656 int queue; /* queue id */
653 int events; /* read-only - queue size */ 657 int events; /* read-only - queue size */
654 sndrv_seq_tick_time_t tick; /* current tick */ 658 snd_seq_tick_time_t tick; /* current tick */
655 struct sndrv_seq_real_time time; /* current time */ 659 struct snd_seq_real_time time; /* current time */
656 int running; /* running state of queue */ 660 int running; /* running state of queue */
657 int flags; /* various flags */ 661 int flags; /* various flags */
658 char reserved[64]; /* for the future */ 662 char reserved[64]; /* for the future */
@@ -660,7 +664,7 @@ struct sndrv_seq_queue_status {
660 664
661 665
662/* queue tempo */ 666/* queue tempo */
663struct sndrv_seq_queue_tempo { 667struct snd_seq_queue_tempo {
664 int queue; /* sequencer queue */ 668 int queue; /* sequencer queue */
665 unsigned int tempo; /* current tempo, us/tick */ 669 unsigned int tempo; /* current tempo, us/tick */
666 int ppq; /* time resolution, ticks/quarter */ 670 int ppq; /* time resolution, ticks/quarter */
@@ -676,12 +680,12 @@ struct sndrv_seq_queue_tempo {
676#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */ 680#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
677 681
678/* queue timer info */ 682/* queue timer info */
679struct sndrv_seq_queue_timer { 683struct snd_seq_queue_timer {
680 int queue; /* sequencer queue */ 684 int queue; /* sequencer queue */
681 int type; /* source timer type */ 685 int type; /* source timer type */
682 union { 686 union {
683 struct { 687 struct {
684 struct sndrv_timer_id id; /* ALSA's timer ID */ 688 struct snd_timer_id id; /* ALSA's timer ID */
685 unsigned int resolution; /* resolution in Hz */ 689 unsigned int resolution; /* resolution in Hz */
686 } alsa; 690 } alsa;
687 } u; 691 } u;
@@ -689,7 +693,7 @@ struct sndrv_seq_queue_timer {
689}; 693};
690 694
691 695
692struct sndrv_seq_queue_client { 696struct snd_seq_queue_client {
693 int queue; /* sequencer queue */ 697 int queue; /* sequencer queue */
694 int client; /* sequencer client */ 698 int client; /* sequencer client */
695 int used; /* queue is used with this client 699 int used; /* queue is used with this client
@@ -703,9 +707,9 @@ struct sndrv_seq_queue_client {
703#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1) 707#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
704#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2) 708#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
705 709
706struct sndrv_seq_port_subscribe { 710struct snd_seq_port_subscribe {
707 struct sndrv_seq_addr sender; /* sender address */ 711 struct snd_seq_addr sender; /* sender address */
708 struct sndrv_seq_addr dest; /* destination address */ 712 struct snd_seq_addr dest; /* destination address */
709 unsigned int voices; /* number of voices to be allocated (0 = don't care) */ 713 unsigned int voices; /* number of voices to be allocated (0 = don't care) */
710 unsigned int flags; /* modes */ 714 unsigned int flags; /* modes */
711 unsigned char queue; /* input time-stamp queue (optional) */ 715 unsigned char queue; /* input time-stamp queue (optional) */
@@ -717,12 +721,12 @@ struct sndrv_seq_port_subscribe {
717#define SNDRV_SEQ_QUERY_SUBS_READ 0 721#define SNDRV_SEQ_QUERY_SUBS_READ 0
718#define SNDRV_SEQ_QUERY_SUBS_WRITE 1 722#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
719 723
720struct sndrv_seq_query_subs { 724struct snd_seq_query_subs {
721 struct sndrv_seq_addr root; /* client/port id to be searched */ 725 struct snd_seq_addr root; /* client/port id to be searched */
722 int type; /* READ or WRITE */ 726 int type; /* READ or WRITE */
723 int index; /* 0..N-1 */ 727 int index; /* 0..N-1 */
724 int num_subs; /* R/O: number of subscriptions on this port */ 728 int num_subs; /* R/O: number of subscriptions on this port */
725 struct sndrv_seq_addr addr; /* R/O: result */ 729 struct snd_seq_addr addr; /* R/O: result */
726 unsigned char queue; /* R/O: result */ 730 unsigned char queue; /* R/O: result */
727 unsigned int flags; /* R/O: result */ 731 unsigned int flags; /* R/O: result */
728 char reserved[64]; /* for future use */ 732 char reserved[64]; /* for future use */
@@ -779,72 +783,72 @@ struct sndrv_seq_query_subs {
779#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3 783#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3
780 784
781/* size of ROM/RAM */ 785/* size of ROM/RAM */
782typedef unsigned int sndrv_seq_instr_size_t; 786typedef unsigned int snd_seq_instr_size_t;
783 787
784/* INSTR_INFO */ 788/* INSTR_INFO */
785 789
786struct sndrv_seq_instr_info { 790struct snd_seq_instr_info {
787 int result; /* operation result */ 791 int result; /* operation result */
788 unsigned int formats[8]; /* bitmap of supported formats */ 792 unsigned int formats[8]; /* bitmap of supported formats */
789 int ram_count; /* count of RAM banks */ 793 int ram_count; /* count of RAM banks */
790 sndrv_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */ 794 snd_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */
791 int rom_count; /* count of ROM banks */ 795 int rom_count; /* count of ROM banks */
792 sndrv_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */ 796 snd_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */
793 char reserved[128]; 797 char reserved[128];
794}; 798};
795 799
796/* INSTR_STATUS */ 800/* INSTR_STATUS */
797 801
798struct sndrv_seq_instr_status { 802struct snd_seq_instr_status {
799 int result; /* operation result */ 803 int result; /* operation result */
800 sndrv_seq_instr_size_t free_ram[16]; /* free RAM in banks */ 804 snd_seq_instr_size_t free_ram[16]; /* free RAM in banks */
801 int instrument_count; /* count of downloaded instruments */ 805 int instrument_count; /* count of downloaded instruments */
802 char reserved[128]; 806 char reserved[128];
803}; 807};
804 808
805/* INSTR_FORMAT_INFO */ 809/* INSTR_FORMAT_INFO */
806 810
807struct sndrv_seq_instr_format_info { 811struct snd_seq_instr_format_info {
808 char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */ 812 char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */
809 unsigned int len; /* max data length (without this structure) */ 813 unsigned int len; /* max data length (without this structure) */
810}; 814};
811 815
812struct sndrv_seq_instr_format_info_result { 816struct snd_seq_instr_format_info_result {
813 int result; /* operation result */ 817 int result; /* operation result */
814 char format[16]; /* format identifier */ 818 char format[16]; /* format identifier */
815 unsigned int len; /* filled data length (without this structure) */ 819 unsigned int len; /* filled data length (without this structure) */
816}; 820};
817 821
818/* instrument data */ 822/* instrument data */
819struct sndrv_seq_instr_data { 823struct snd_seq_instr_data {
820 char name[32]; /* instrument name */ 824 char name[32]; /* instrument name */
821 char reserved[16]; /* for the future use */ 825 char reserved[16]; /* for the future use */
822 int type; /* instrument type */ 826 int type; /* instrument type */
823 union { 827 union {
824 char format[16]; /* format identifier */ 828 char format[16]; /* format identifier */
825 struct sndrv_seq_instr alias; 829 struct snd_seq_instr alias;
826 } data; 830 } data;
827}; 831};
828 832
829/* INSTR_PUT/GET, data are stored in one block (extended), header + data */ 833/* INSTR_PUT/GET, data are stored in one block (extended), header + data */
830 834
831struct sndrv_seq_instr_header { 835struct snd_seq_instr_header {
832 union { 836 union {
833 struct sndrv_seq_instr instr; 837 struct snd_seq_instr instr;
834 sndrv_seq_instr_cluster_t cluster; 838 snd_seq_instr_cluster_t cluster;
835 } id; /* instrument identifier */ 839 } id; /* instrument identifier */
836 unsigned int cmd; /* get/put/free command */ 840 unsigned int cmd; /* get/put/free command */
837 unsigned int flags; /* query flags (only for get) */ 841 unsigned int flags; /* query flags (only for get) */
838 unsigned int len; /* real instrument data length (without header) */ 842 unsigned int len; /* real instrument data length (without header) */
839 int result; /* operation result */ 843 int result; /* operation result */
840 char reserved[16]; /* for the future */ 844 char reserved[16]; /* for the future */
841 struct sndrv_seq_instr_data data; /* instrument data (for put/get result) */ 845 struct snd_seq_instr_data data; /* instrument data (for put/get result) */
842}; 846};
843 847
844/* INSTR_CLUSTER_SET */ 848/* INSTR_CLUSTER_SET */
845 849
846struct sndrv_seq_instr_cluster_set { 850struct snd_seq_instr_cluster_set {
847 sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ 851 snd_seq_instr_cluster_t cluster; /* cluster identifier */
848 char name[32]; /* cluster name */ 852 char name[32]; /* cluster name */
849 int priority; /* cluster priority */ 853 int priority; /* cluster priority */
850 char reserved[64]; /* for the future use */ 854 char reserved[64]; /* for the future use */
@@ -852,8 +856,8 @@ struct sndrv_seq_instr_cluster_set {
852 856
853/* INSTR_CLUSTER_GET */ 857/* INSTR_CLUSTER_GET */
854 858
855struct sndrv_seq_instr_cluster_get { 859struct snd_seq_instr_cluster_get {
856 sndrv_seq_instr_cluster_t cluster; /* cluster identifier */ 860 snd_seq_instr_cluster_t cluster; /* cluster identifier */
857 char name[32]; /* cluster name */ 861 char name[32]; /* cluster name */
858 int priority; /* cluster priority */ 862 int priority; /* cluster priority */
859 char reserved[64]; /* for the future use */ 863 char reserved[64]; /* for the future use */
@@ -865,44 +869,44 @@ struct sndrv_seq_instr_cluster_get {
865 869
866#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int) 870#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
867#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int) 871#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
868#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct sndrv_seq_system_info) 872#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct snd_seq_system_info)
869#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct sndrv_seq_running_info) 873#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct snd_seq_running_info)
870 874
871#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct sndrv_seq_client_info) 875#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct snd_seq_client_info)
872#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct sndrv_seq_client_info) 876#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct snd_seq_client_info)
873 877
874#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct sndrv_seq_port_info) 878#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct snd_seq_port_info)
875#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct sndrv_seq_port_info) 879#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct snd_seq_port_info)
876#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct sndrv_seq_port_info) 880#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct snd_seq_port_info)
877#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct sndrv_seq_port_info) 881#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct snd_seq_port_info)
878 882
879#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct sndrv_seq_port_subscribe) 883#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct snd_seq_port_subscribe)
880#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct sndrv_seq_port_subscribe) 884#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct snd_seq_port_subscribe)
881 885
882#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct sndrv_seq_queue_info) 886#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct snd_seq_queue_info)
883#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct sndrv_seq_queue_info) 887#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct snd_seq_queue_info)
884#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct sndrv_seq_queue_info) 888#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct snd_seq_queue_info)
885#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct sndrv_seq_queue_info) 889#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct snd_seq_queue_info)
886#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct sndrv_seq_queue_info) 890#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct snd_seq_queue_info)
887#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct sndrv_seq_queue_status) 891#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct snd_seq_queue_status)
888#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct sndrv_seq_queue_tempo) 892#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct snd_seq_queue_tempo)
889#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct sndrv_seq_queue_tempo) 893#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct snd_seq_queue_tempo)
890#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct sndrv_seq_queue_owner) 894#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct snd_seq_queue_owner)
891#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct sndrv_seq_queue_owner) 895#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct snd_seq_queue_owner)
892#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct sndrv_seq_queue_timer) 896#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct snd_seq_queue_timer)
893#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct sndrv_seq_queue_timer) 897#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct snd_seq_queue_timer)
894/* XXX 898/* XXX
895#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct sndrv_seq_queue_sync) 899#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct snd_seq_queue_sync)
896#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct sndrv_seq_queue_sync) 900#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct snd_seq_queue_sync)
897*/ 901*/
898#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct sndrv_seq_queue_client) 902#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct snd_seq_queue_client)
899#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct sndrv_seq_queue_client) 903#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct snd_seq_queue_client)
900#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct sndrv_seq_client_pool) 904#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct snd_seq_client_pool)
901#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct sndrv_seq_client_pool) 905#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct snd_seq_client_pool)
902#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct sndrv_seq_remove_events) 906#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct snd_seq_remove_events)
903#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct sndrv_seq_query_subs) 907#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct snd_seq_query_subs)
904#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct sndrv_seq_port_subscribe) 908#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe)
905#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct sndrv_seq_client_info) 909#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct snd_seq_client_info)
906#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct sndrv_seq_port_info) 910#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct snd_seq_port_info)
907 911
908#endif /* __SOUND_ASEQUENCER_H */ 912#endif /* __SOUND_ASEQUENCER_H */
diff --git a/include/sound/asound.h b/include/sound/asound.h
index 8e552d627fa5..9cc021c7ee11 100644
--- a/include/sound/asound.h
+++ b/include/sound/asound.h
@@ -23,12 +23,8 @@
23#ifndef __SOUND_ASOUND_H 23#ifndef __SOUND_ASOUND_H
24#define __SOUND_ASOUND_H 24#define __SOUND_ASOUND_H
25 25
26#if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
27
28#include <linux/ioctl.h>
29
30#ifdef __KERNEL__ 26#ifdef __KERNEL__
31 27#include <linux/ioctl.h>
32#include <linux/types.h> 28#include <linux/types.h>
33#include <linux/time.h> 29#include <linux/time.h>
34#include <asm/byteorder.h> 30#include <asm/byteorder.h>
@@ -43,25 +39,7 @@
43#endif 39#endif
44#endif 40#endif
45 41
46#else /* !__KERNEL__ */ 42#endif /* __KERNEL__ **/
47
48#include <endian.h>
49#if __BYTE_ORDER == __LITTLE_ENDIAN
50#define SNDRV_LITTLE_ENDIAN
51#elif __BYTE_ORDER == __BIG_ENDIAN
52#define SNDRV_BIG_ENDIAN
53#else
54#error "Unsupported endian..."
55#endif
56
57#endif /* __KERNEL **/
58
59#endif /* LINUX */
60
61#ifndef __KERNEL__
62#include <sys/time.h>
63#include <sys/types.h>
64#endif
65 43
66/* 44/*
67 * protocol version 45 * protocol version
@@ -82,7 +60,7 @@
82 * * 60 * *
83 ****************************************************************************/ 61 ****************************************************************************/
84 62
85struct sndrv_aes_iec958 { 63struct snd_aes_iec958 {
86 unsigned char status[24]; /* AES/IEC958 channel status bits */ 64 unsigned char status[24]; /* AES/IEC958 channel status bits */
87 unsigned char subcode[147]; /* AES/IEC958 subcode bits */ 65 unsigned char subcode[147]; /* AES/IEC958 subcode bits */
88 unsigned char pad; /* nothing */ 66 unsigned char pad; /* nothing */
@@ -97,7 +75,7 @@ struct sndrv_aes_iec958 {
97 75
98#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1) 76#define SNDRV_HWDEP_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 1)
99 77
100enum sndrv_hwdep_iface { 78enum {
101 SNDRV_HWDEP_IFACE_OPL2 = 0, 79 SNDRV_HWDEP_IFACE_OPL2 = 0,
102 SNDRV_HWDEP_IFACE_OPL3, 80 SNDRV_HWDEP_IFACE_OPL3,
103 SNDRV_HWDEP_IFACE_OPL4, 81 SNDRV_HWDEP_IFACE_OPL4,
@@ -119,17 +97,17 @@ enum sndrv_hwdep_iface {
119 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC 97 SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_SB_RC
120}; 98};
121 99
122struct sndrv_hwdep_info { 100struct snd_hwdep_info {
123 unsigned int device; /* WR: device number */ 101 unsigned int device; /* WR: device number */
124 int card; /* R: card number */ 102 int card; /* R: card number */
125 unsigned char id[64]; /* ID (user selectable) */ 103 unsigned char id[64]; /* ID (user selectable) */
126 unsigned char name[80]; /* hwdep name */ 104 unsigned char name[80]; /* hwdep name */
127 enum sndrv_hwdep_iface iface; /* hwdep interface */ 105 int iface; /* hwdep interface */
128 unsigned char reserved[64]; /* reserved for future */ 106 unsigned char reserved[64]; /* reserved for future */
129}; 107};
130 108
131/* generic DSP loader */ 109/* generic DSP loader */
132struct sndrv_hwdep_dsp_status { 110struct snd_hwdep_dsp_status {
133 unsigned int version; /* R: driver-specific version */ 111 unsigned int version; /* R: driver-specific version */
134 unsigned char id[32]; /* R: driver-specific ID string */ 112 unsigned char id[32]; /* R: driver-specific ID string */
135 unsigned int num_dsps; /* R: number of DSP images to transfer */ 113 unsigned int num_dsps; /* R: number of DSP images to transfer */
@@ -138,7 +116,7 @@ struct sndrv_hwdep_dsp_status {
138 unsigned char reserved[16]; /* reserved for future use */ 116 unsigned char reserved[16]; /* reserved for future use */
139}; 117};
140 118
141struct sndrv_hwdep_dsp_image { 119struct snd_hwdep_dsp_image {
142 unsigned int index; /* W: DSP index */ 120 unsigned int index; /* W: DSP index */
143 unsigned char name[64]; /* W: ID (e.g. file name) */ 121 unsigned char name[64]; /* W: ID (e.g. file name) */
144 unsigned char __user *image; /* W: binary image */ 122 unsigned char __user *image; /* W: binary image */
@@ -148,9 +126,9 @@ struct sndrv_hwdep_dsp_image {
148 126
149enum { 127enum {
150 SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int), 128 SNDRV_HWDEP_IOCTL_PVERSION = _IOR ('H', 0x00, int),
151 SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct sndrv_hwdep_info), 129 SNDRV_HWDEP_IOCTL_INFO = _IOR ('H', 0x01, struct snd_hwdep_info),
152 SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct sndrv_hwdep_dsp_status), 130 SNDRV_HWDEP_IOCTL_DSP_STATUS = _IOR('H', 0x02, struct snd_hwdep_dsp_status),
153 SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct sndrv_hwdep_dsp_image) 131 SNDRV_HWDEP_IOCTL_DSP_LOAD = _IOW('H', 0x03, struct snd_hwdep_dsp_image)
154}; 132};
155 133
156/***************************************************************************** 134/*****************************************************************************
@@ -161,10 +139,10 @@ enum {
161 139
162#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7) 140#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 7)
163 141
164typedef unsigned long sndrv_pcm_uframes_t; 142typedef unsigned long snd_pcm_uframes_t;
165typedef long sndrv_pcm_sframes_t; 143typedef signed long snd_pcm_sframes_t;
166 144
167enum sndrv_pcm_class { 145enum {
168 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */ 146 SNDRV_PCM_CLASS_GENERIC = 0, /* standard mono or stereo device */
169 SNDRV_PCM_CLASS_MULTI, /* multichannel device */ 147 SNDRV_PCM_CLASS_MULTI, /* multichannel device */
170 SNDRV_PCM_CLASS_MODEM, /* software modem class */ 148 SNDRV_PCM_CLASS_MODEM, /* software modem class */
@@ -173,97 +151,94 @@ enum sndrv_pcm_class {
173 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER, 151 SNDRV_PCM_CLASS_LAST = SNDRV_PCM_CLASS_DIGITIZER,
174}; 152};
175 153
176enum sndrv_pcm_subclass { 154enum {
177 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */ 155 SNDRV_PCM_SUBCLASS_GENERIC_MIX = 0, /* mono or stereo subdevices are mixed together */
178 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */ 156 SNDRV_PCM_SUBCLASS_MULTI_MIX, /* multichannel subdevices are mixed together */
179 /* Don't forget to change the following: */ 157 /* Don't forget to change the following: */
180 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX, 158 SNDRV_PCM_SUBCLASS_LAST = SNDRV_PCM_SUBCLASS_MULTI_MIX,
181}; 159};
182 160
183enum sndrv_pcm_stream { 161enum {
184 SNDRV_PCM_STREAM_PLAYBACK = 0, 162 SNDRV_PCM_STREAM_PLAYBACK = 0,
185 SNDRV_PCM_STREAM_CAPTURE, 163 SNDRV_PCM_STREAM_CAPTURE,
186 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE, 164 SNDRV_PCM_STREAM_LAST = SNDRV_PCM_STREAM_CAPTURE,
187}; 165};
188 166
189enum sndrv_pcm_access { 167typedef int __bitwise snd_pcm_access_t;
190 SNDRV_PCM_ACCESS_MMAP_INTERLEAVED = 0, /* interleaved mmap */ 168#define SNDRV_PCM_ACCESS_MMAP_INTERLEAVED ((__force snd_pcm_access_t) 0) /* interleaved mmap */
191 SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED, /* noninterleaved mmap */ 169#define SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED ((__force snd_pcm_access_t) 1) /* noninterleaved mmap */
192 SNDRV_PCM_ACCESS_MMAP_COMPLEX, /* complex mmap */ 170#define SNDRV_PCM_ACCESS_MMAP_COMPLEX ((__force snd_pcm_access_t) 2) /* complex mmap */
193 SNDRV_PCM_ACCESS_RW_INTERLEAVED, /* readi/writei */ 171#define SNDRV_PCM_ACCESS_RW_INTERLEAVED ((__force snd_pcm_access_t) 3) /* readi/writei */
194 SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, /* readn/writen */ 172#define SNDRV_PCM_ACCESS_RW_NONINTERLEAVED ((__force snd_pcm_access_t) 4) /* readn/writen */
195 SNDRV_PCM_ACCESS_LAST = SNDRV_PCM_ACCESS_RW_NONINTERLEAVED, 173#define SNDRV_PCM_ACCESS_LAST SNDRV_PCM_ACCESS_RW_NONINTERLEAVED
196}; 174
197 175typedef int __bitwise snd_pcm_format_t;
198enum sndrv_pcm_format { 176#define SNDRV_PCM_FORMAT_S8 ((__force snd_pcm_format_t) 0)
199 SNDRV_PCM_FORMAT_S8 = 0, 177#define SNDRV_PCM_FORMAT_U8 ((__force snd_pcm_format_t) 1)
200 SNDRV_PCM_FORMAT_U8, 178#define SNDRV_PCM_FORMAT_S16_LE ((__force snd_pcm_format_t) 2)
201 SNDRV_PCM_FORMAT_S16_LE, 179#define SNDRV_PCM_FORMAT_S16_BE ((__force snd_pcm_format_t) 3)
202 SNDRV_PCM_FORMAT_S16_BE, 180#define SNDRV_PCM_FORMAT_U16_LE ((__force snd_pcm_format_t) 4)
203 SNDRV_PCM_FORMAT_U16_LE, 181#define SNDRV_PCM_FORMAT_U16_BE ((__force snd_pcm_format_t) 5)
204 SNDRV_PCM_FORMAT_U16_BE, 182#define SNDRV_PCM_FORMAT_S24_LE ((__force snd_pcm_format_t) 6) /* low three bytes */
205 SNDRV_PCM_FORMAT_S24_LE, /* low three bytes */ 183#define SNDRV_PCM_FORMAT_S24_BE ((__force snd_pcm_format_t) 7) /* low three bytes */
206 SNDRV_PCM_FORMAT_S24_BE, /* low three bytes */ 184#define SNDRV_PCM_FORMAT_U24_LE ((__force snd_pcm_format_t) 8) /* low three bytes */
207 SNDRV_PCM_FORMAT_U24_LE, /* low three bytes */ 185#define SNDRV_PCM_FORMAT_U24_BE ((__force snd_pcm_format_t) 9) /* low three bytes */
208 SNDRV_PCM_FORMAT_U24_BE, /* low three bytes */ 186#define SNDRV_PCM_FORMAT_S32_LE ((__force snd_pcm_format_t) 10)
209 SNDRV_PCM_FORMAT_S32_LE, 187#define SNDRV_PCM_FORMAT_S32_BE ((__force snd_pcm_format_t) 11)
210 SNDRV_PCM_FORMAT_S32_BE, 188#define SNDRV_PCM_FORMAT_U32_LE ((__force snd_pcm_format_t) 12)
211 SNDRV_PCM_FORMAT_U32_LE, 189#define SNDRV_PCM_FORMAT_U32_BE ((__force snd_pcm_format_t) 13)
212 SNDRV_PCM_FORMAT_U32_BE, 190#define SNDRV_PCM_FORMAT_FLOAT_LE ((__force snd_pcm_format_t) 14) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
213 SNDRV_PCM_FORMAT_FLOAT_LE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ 191#define SNDRV_PCM_FORMAT_FLOAT_BE ((__force snd_pcm_format_t) 15) /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */
214 SNDRV_PCM_FORMAT_FLOAT_BE, /* 4-byte float, IEEE-754 32-bit, range -1.0 to 1.0 */ 192#define SNDRV_PCM_FORMAT_FLOAT64_LE ((__force snd_pcm_format_t) 16) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
215 SNDRV_PCM_FORMAT_FLOAT64_LE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ 193#define SNDRV_PCM_FORMAT_FLOAT64_BE ((__force snd_pcm_format_t) 17) /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */
216 SNDRV_PCM_FORMAT_FLOAT64_BE, /* 8-byte float, IEEE-754 64-bit, range -1.0 to 1.0 */ 194#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE ((__force snd_pcm_format_t) 18) /* IEC-958 subframe, Little Endian */
217 SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, /* IEC-958 subframe, Little Endian */ 195#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE ((__force snd_pcm_format_t) 19) /* IEC-958 subframe, Big Endian */
218 SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, /* IEC-958 subframe, Big Endian */ 196#define SNDRV_PCM_FORMAT_MU_LAW ((__force snd_pcm_format_t) 20)
219 SNDRV_PCM_FORMAT_MU_LAW, 197#define SNDRV_PCM_FORMAT_A_LAW ((__force snd_pcm_format_t) 21)
220 SNDRV_PCM_FORMAT_A_LAW, 198#define SNDRV_PCM_FORMAT_IMA_ADPCM ((__force snd_pcm_format_t) 22)
221 SNDRV_PCM_FORMAT_IMA_ADPCM, 199#define SNDRV_PCM_FORMAT_MPEG ((__force snd_pcm_format_t) 23)
222 SNDRV_PCM_FORMAT_MPEG, 200#define SNDRV_PCM_FORMAT_GSM ((__force snd_pcm_format_t) 24)
223 SNDRV_PCM_FORMAT_GSM, 201#define SNDRV_PCM_FORMAT_SPECIAL ((__force snd_pcm_format_t) 31)
224 SNDRV_PCM_FORMAT_SPECIAL = 31, 202#define SNDRV_PCM_FORMAT_S24_3LE ((__force snd_pcm_format_t) 32) /* in three bytes */
225 SNDRV_PCM_FORMAT_S24_3LE = 32, /* in three bytes */ 203#define SNDRV_PCM_FORMAT_S24_3BE ((__force snd_pcm_format_t) 33) /* in three bytes */
226 SNDRV_PCM_FORMAT_S24_3BE, /* in three bytes */ 204#define SNDRV_PCM_FORMAT_U24_3LE ((__force snd_pcm_format_t) 34) /* in three bytes */
227 SNDRV_PCM_FORMAT_U24_3LE, /* in three bytes */ 205#define SNDRV_PCM_FORMAT_U24_3BE ((__force snd_pcm_format_t) 35) /* in three bytes */
228 SNDRV_PCM_FORMAT_U24_3BE, /* in three bytes */ 206#define SNDRV_PCM_FORMAT_S20_3LE ((__force snd_pcm_format_t) 36) /* in three bytes */
229 SNDRV_PCM_FORMAT_S20_3LE, /* in three bytes */ 207#define SNDRV_PCM_FORMAT_S20_3BE ((__force snd_pcm_format_t) 37) /* in three bytes */
230 SNDRV_PCM_FORMAT_S20_3BE, /* in three bytes */ 208#define SNDRV_PCM_FORMAT_U20_3LE ((__force snd_pcm_format_t) 38) /* in three bytes */
231 SNDRV_PCM_FORMAT_U20_3LE, /* in three bytes */ 209#define SNDRV_PCM_FORMAT_U20_3BE ((__force snd_pcm_format_t) 39) /* in three bytes */
232 SNDRV_PCM_FORMAT_U20_3BE, /* in three bytes */ 210#define SNDRV_PCM_FORMAT_S18_3LE ((__force snd_pcm_format_t) 40) /* in three bytes */
233 SNDRV_PCM_FORMAT_S18_3LE, /* in three bytes */ 211#define SNDRV_PCM_FORMAT_S18_3BE ((__force snd_pcm_format_t) 41) /* in three bytes */
234 SNDRV_PCM_FORMAT_S18_3BE, /* in three bytes */ 212#define SNDRV_PCM_FORMAT_U18_3LE ((__force snd_pcm_format_t) 42) /* in three bytes */
235 SNDRV_PCM_FORMAT_U18_3LE, /* in three bytes */ 213#define SNDRV_PCM_FORMAT_U18_3BE ((__force snd_pcm_format_t) 43) /* in three bytes */
236 SNDRV_PCM_FORMAT_U18_3BE, /* in three bytes */ 214#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_U18_3BE
237 SNDRV_PCM_FORMAT_LAST = SNDRV_PCM_FORMAT_U18_3BE,
238 215
239#ifdef SNDRV_LITTLE_ENDIAN 216#ifdef SNDRV_LITTLE_ENDIAN
240 SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_LE, 217#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
241 SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_LE, 218#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_LE
242 SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_LE, 219#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_LE
243 SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_LE, 220#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_LE
244 SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_LE, 221#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_LE
245 SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_LE, 222#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_LE
246 SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_LE, 223#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_LE
247 SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_LE, 224#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_LE
248 SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE, 225#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE
249#endif 226#endif
250#ifdef SNDRV_BIG_ENDIAN 227#ifdef SNDRV_BIG_ENDIAN
251 SNDRV_PCM_FORMAT_S16 = SNDRV_PCM_FORMAT_S16_BE, 228#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_BE
252 SNDRV_PCM_FORMAT_U16 = SNDRV_PCM_FORMAT_U16_BE, 229#define SNDRV_PCM_FORMAT_U16 SNDRV_PCM_FORMAT_U16_BE
253 SNDRV_PCM_FORMAT_S24 = SNDRV_PCM_FORMAT_S24_BE, 230#define SNDRV_PCM_FORMAT_S24 SNDRV_PCM_FORMAT_S24_BE
254 SNDRV_PCM_FORMAT_U24 = SNDRV_PCM_FORMAT_U24_BE, 231#define SNDRV_PCM_FORMAT_U24 SNDRV_PCM_FORMAT_U24_BE
255 SNDRV_PCM_FORMAT_S32 = SNDRV_PCM_FORMAT_S32_BE, 232#define SNDRV_PCM_FORMAT_S32 SNDRV_PCM_FORMAT_S32_BE
256 SNDRV_PCM_FORMAT_U32 = SNDRV_PCM_FORMAT_U32_BE, 233#define SNDRV_PCM_FORMAT_U32 SNDRV_PCM_FORMAT_U32_BE
257 SNDRV_PCM_FORMAT_FLOAT = SNDRV_PCM_FORMAT_FLOAT_BE, 234#define SNDRV_PCM_FORMAT_FLOAT SNDRV_PCM_FORMAT_FLOAT_BE
258 SNDRV_PCM_FORMAT_FLOAT64 = SNDRV_PCM_FORMAT_FLOAT64_BE, 235#define SNDRV_PCM_FORMAT_FLOAT64 SNDRV_PCM_FORMAT_FLOAT64_BE
259 SNDRV_PCM_FORMAT_IEC958_SUBFRAME = SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE, 236#define SNDRV_PCM_FORMAT_IEC958_SUBFRAME SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE
260#endif 237#endif
261};
262 238
263enum sndrv_pcm_subformat { 239typedef int __bitwise snd_pcm_subformat_t;
264 SNDRV_PCM_SUBFORMAT_STD = 0, 240#define SNDRV_PCM_SUBFORMAT_STD ((__force snd_pcm_subformat_t) 0)
265 SNDRV_PCM_SUBFORMAT_LAST = SNDRV_PCM_SUBFORMAT_STD, 241#define SNDRV_PCM_SUBFORMAT_LAST SNDRV_PCM_SUBFORMAT_STD
266};
267 242
268#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */ 243#define SNDRV_PCM_INFO_MMAP 0x00000001 /* hardware supports mmap */
269#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */ 244#define SNDRV_PCM_INFO_MMAP_VALID 0x00000002 /* period data are valid during transfer */
@@ -280,18 +255,17 @@ enum sndrv_pcm_subformat {
280#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */ 255#define SNDRV_PCM_INFO_JOINT_DUPLEX 0x00200000 /* playback and capture stream are somewhat correlated */
281#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */ 256#define SNDRV_PCM_INFO_SYNC_START 0x00400000 /* pcm support some kind of sync go */
282 257
283enum sndrv_pcm_state { 258typedef int __bitwise snd_pcm_state_t;
284 SNDRV_PCM_STATE_OPEN = 0, /* stream is open */ 259#define SNDRV_PCM_STATE_OPEN ((__force snd_pcm_state_t) 0) /* stream is open */
285 SNDRV_PCM_STATE_SETUP, /* stream has a setup */ 260#define SNDRV_PCM_STATE_SETUP ((__force snd_pcm_state_t) 1) /* stream has a setup */
286 SNDRV_PCM_STATE_PREPARED, /* stream is ready to start */ 261#define SNDRV_PCM_STATE_PREPARED ((__force snd_pcm_state_t) 2) /* stream is ready to start */
287 SNDRV_PCM_STATE_RUNNING, /* stream is running */ 262#define SNDRV_PCM_STATE_RUNNING ((__force snd_pcm_state_t) 3) /* stream is running */
288 SNDRV_PCM_STATE_XRUN, /* stream reached an xrun */ 263#define SNDRV_PCM_STATE_XRUN ((__force snd_pcm_state_t) 4) /* stream reached an xrun */
289 SNDRV_PCM_STATE_DRAINING, /* stream is draining */ 264#define SNDRV_PCM_STATE_DRAINING ((__force snd_pcm_state_t) 5) /* stream is draining */
290 SNDRV_PCM_STATE_PAUSED, /* stream is paused */ 265#define SNDRV_PCM_STATE_PAUSED ((__force snd_pcm_state_t) 6) /* stream is paused */
291 SNDRV_PCM_STATE_SUSPENDED, /* hardware is suspended */ 266#define SNDRV_PCM_STATE_SUSPENDED ((__force snd_pcm_state_t) 7) /* hardware is suspended */
292 SNDRV_PCM_STATE_DISCONNECTED, /* hardware is disconnected */ 267#define SNDRV_PCM_STATE_DISCONNECTED ((__force snd_pcm_state_t) 8) /* hardware is disconnected */
293 SNDRV_PCM_STATE_LAST = SNDRV_PCM_STATE_DISCONNECTED, 268#define SNDRV_PCM_STATE_LAST SNDRV_PCM_STATE_DISCONNECTED
294};
295 269
296enum { 270enum {
297 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000, 271 SNDRV_PCM_MMAP_OFFSET_DATA = 0x00000000,
@@ -299,55 +273,53 @@ enum {
299 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000, 273 SNDRV_PCM_MMAP_OFFSET_CONTROL = 0x81000000,
300}; 274};
301 275
302union sndrv_pcm_sync_id { 276union snd_pcm_sync_id {
303 unsigned char id[16]; 277 unsigned char id[16];
304 unsigned short id16[8]; 278 unsigned short id16[8];
305 unsigned int id32[4]; 279 unsigned int id32[4];
306}; 280};
307 281
308struct sndrv_pcm_info { 282struct snd_pcm_info {
309 unsigned int device; /* RO/WR (control): device number */ 283 unsigned int device; /* RO/WR (control): device number */
310 unsigned int subdevice; /* RO/WR (control): subdevice number */ 284 unsigned int subdevice; /* RO/WR (control): subdevice number */
311 enum sndrv_pcm_stream stream; /* RO/WR (control): stream number */ 285 int stream; /* RO/WR (control): stream direction */
312 int card; /* R: card number */ 286 int card; /* R: card number */
313 unsigned char id[64]; /* ID (user selectable) */ 287 unsigned char id[64]; /* ID (user selectable) */
314 unsigned char name[80]; /* name of this device */ 288 unsigned char name[80]; /* name of this device */
315 unsigned char subname[32]; /* subdevice name */ 289 unsigned char subname[32]; /* subdevice name */
316 enum sndrv_pcm_class dev_class; /* SNDRV_PCM_CLASS_* */ 290 int dev_class; /* SNDRV_PCM_CLASS_* */
317 enum sndrv_pcm_subclass dev_subclass; /* SNDRV_PCM_SUBCLASS_* */ 291 int dev_subclass; /* SNDRV_PCM_SUBCLASS_* */
318 unsigned int subdevices_count; 292 unsigned int subdevices_count;
319 unsigned int subdevices_avail; 293 unsigned int subdevices_avail;
320 union sndrv_pcm_sync_id sync; /* hardware synchronization ID */ 294 union snd_pcm_sync_id sync; /* hardware synchronization ID */
321 unsigned char reserved[64]; /* reserved for future... */ 295 unsigned char reserved[64]; /* reserved for future... */
322}; 296};
323 297
324enum sndrv_pcm_hw_param { 298typedef int __bitwise snd_pcm_hw_param_t;
325 SNDRV_PCM_HW_PARAM_ACCESS = 0, /* Access type */ 299#define SNDRV_PCM_HW_PARAM_ACCESS ((__force snd_pcm_hw_param_t) 0) /* Access type */
326 SNDRV_PCM_HW_PARAM_FIRST_MASK = SNDRV_PCM_HW_PARAM_ACCESS, 300#define SNDRV_PCM_HW_PARAM_FORMAT ((__force snd_pcm_hw_param_t) 1) /* Format */
327 SNDRV_PCM_HW_PARAM_FORMAT, /* Format */ 301#define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */
328 SNDRV_PCM_HW_PARAM_SUBFORMAT, /* Subformat */ 302#define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS
329 SNDRV_PCM_HW_PARAM_LAST_MASK = SNDRV_PCM_HW_PARAM_SUBFORMAT, 303#define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT
330 304
331 SNDRV_PCM_HW_PARAM_SAMPLE_BITS = 8, /* Bits per sample */ 305#define SNDRV_PCM_HW_PARAM_SAMPLE_BITS ((__force snd_pcm_hw_param_t) 8) /* Bits per sample */
332 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL = SNDRV_PCM_HW_PARAM_SAMPLE_BITS, 306#define SNDRV_PCM_HW_PARAM_FRAME_BITS ((__force snd_pcm_hw_param_t) 9) /* Bits per frame */
333 SNDRV_PCM_HW_PARAM_FRAME_BITS, /* Bits per frame */ 307#define SNDRV_PCM_HW_PARAM_CHANNELS ((__force snd_pcm_hw_param_t) 10) /* Channels */
334 SNDRV_PCM_HW_PARAM_CHANNELS, /* Channels */ 308#define SNDRV_PCM_HW_PARAM_RATE ((__force snd_pcm_hw_param_t) 11) /* Approx rate */
335 SNDRV_PCM_HW_PARAM_RATE, /* Approx rate */ 309#define SNDRV_PCM_HW_PARAM_PERIOD_TIME ((__force snd_pcm_hw_param_t) 12) /* Approx distance between interrupts in us */
336 SNDRV_PCM_HW_PARAM_PERIOD_TIME, /* Approx distance between interrupts 310#define SNDRV_PCM_HW_PARAM_PERIOD_SIZE ((__force snd_pcm_hw_param_t) 13) /* Approx frames between interrupts */
337 in us */ 311#define SNDRV_PCM_HW_PARAM_PERIOD_BYTES ((__force snd_pcm_hw_param_t) 14) /* Approx bytes between interrupts */
338 SNDRV_PCM_HW_PARAM_PERIOD_SIZE, /* Approx frames between interrupts */ 312#define SNDRV_PCM_HW_PARAM_PERIODS ((__force snd_pcm_hw_param_t) 15) /* Approx interrupts per buffer */
339 SNDRV_PCM_HW_PARAM_PERIOD_BYTES, /* Approx bytes between interrupts */ 313#define SNDRV_PCM_HW_PARAM_BUFFER_TIME ((__force snd_pcm_hw_param_t) 16) /* Approx duration of buffer in us */
340 SNDRV_PCM_HW_PARAM_PERIODS, /* Approx interrupts per buffer */ 314#define SNDRV_PCM_HW_PARAM_BUFFER_SIZE ((__force snd_pcm_hw_param_t) 17) /* Size of buffer in frames */
341 SNDRV_PCM_HW_PARAM_BUFFER_TIME, /* Approx duration of buffer in us */ 315#define SNDRV_PCM_HW_PARAM_BUFFER_BYTES ((__force snd_pcm_hw_param_t) 18) /* Size of buffer in bytes */
342 SNDRV_PCM_HW_PARAM_BUFFER_SIZE, /* Size of buffer in frames */ 316#define SNDRV_PCM_HW_PARAM_TICK_TIME ((__force snd_pcm_hw_param_t) 19) /* Approx tick duration in us */
343 SNDRV_PCM_HW_PARAM_BUFFER_BYTES, /* Size of buffer in bytes */ 317#define SNDRV_PCM_HW_PARAM_FIRST_INTERVAL SNDRV_PCM_HW_PARAM_SAMPLE_BITS
344 SNDRV_PCM_HW_PARAM_TICK_TIME, /* Approx tick duration in us */ 318#define SNDRV_PCM_HW_PARAM_LAST_INTERVAL SNDRV_PCM_HW_PARAM_TICK_TIME
345 SNDRV_PCM_HW_PARAM_LAST_INTERVAL = SNDRV_PCM_HW_PARAM_TICK_TIME
346};
347 319
348#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */ 320#define SNDRV_PCM_HW_PARAMS_NORESAMPLE (1<<0) /* avoid rate resampling */
349 321
350struct sndrv_interval { 322struct snd_interval {
351 unsigned int min, max; 323 unsigned int min, max;
352 unsigned int openmin:1, 324 unsigned int openmin:1,
353 openmax:1, 325 openmax:1,
@@ -357,137 +329,137 @@ struct sndrv_interval {
357 329
358#define SNDRV_MASK_MAX 256 330#define SNDRV_MASK_MAX 256
359 331
360struct sndrv_mask { 332struct snd_mask {
361 u_int32_t bits[(SNDRV_MASK_MAX+31)/32]; 333 u_int32_t bits[(SNDRV_MASK_MAX+31)/32];
362}; 334};
363 335
364struct sndrv_pcm_hw_params { 336struct snd_pcm_hw_params {
365 unsigned int flags; 337 unsigned int flags;
366 struct sndrv_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 338 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
367 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; 339 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
368 struct sndrv_mask mres[5]; /* reserved masks */ 340 struct snd_mask mres[5]; /* reserved masks */
369 struct sndrv_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - 341 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
370 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; 342 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
371 struct sndrv_interval ires[9]; /* reserved intervals */ 343 struct snd_interval ires[9]; /* reserved intervals */
372 unsigned int rmask; /* W: requested masks */ 344 unsigned int rmask; /* W: requested masks */
373 unsigned int cmask; /* R: changed masks */ 345 unsigned int cmask; /* R: changed masks */
374 unsigned int info; /* R: Info flags for returned setup */ 346 unsigned int info; /* R: Info flags for returned setup */
375 unsigned int msbits; /* R: used most significant bits */ 347 unsigned int msbits; /* R: used most significant bits */
376 unsigned int rate_num; /* R: rate numerator */ 348 unsigned int rate_num; /* R: rate numerator */
377 unsigned int rate_den; /* R: rate denominator */ 349 unsigned int rate_den; /* R: rate denominator */
378 sndrv_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */ 350 snd_pcm_uframes_t fifo_size; /* R: chip FIFO size in frames */
379 unsigned char reserved[64]; /* reserved for future */ 351 unsigned char reserved[64]; /* reserved for future */
380}; 352};
381 353
382enum sndrv_pcm_tstamp { 354enum {
383 SNDRV_PCM_TSTAMP_NONE = 0, 355 SNDRV_PCM_TSTAMP_NONE = 0,
384 SNDRV_PCM_TSTAMP_MMAP, 356 SNDRV_PCM_TSTAMP_MMAP,
385 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP, 357 SNDRV_PCM_TSTAMP_LAST = SNDRV_PCM_TSTAMP_MMAP,
386}; 358};
387 359
388struct sndrv_pcm_sw_params { 360struct snd_pcm_sw_params {
389 enum sndrv_pcm_tstamp tstamp_mode; /* timestamp mode */ 361 int tstamp_mode; /* timestamp mode */
390 unsigned int period_step; 362 unsigned int period_step;
391 unsigned int sleep_min; /* min ticks to sleep */ 363 unsigned int sleep_min; /* min ticks to sleep */
392 sndrv_pcm_uframes_t avail_min; /* min avail frames for wakeup */ 364 snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
393 sndrv_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ 365 snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */
394 sndrv_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */ 366 snd_pcm_uframes_t start_threshold; /* min hw_avail frames for automatic start */
395 sndrv_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */ 367 snd_pcm_uframes_t stop_threshold; /* min avail frames for automatic stop */
396 sndrv_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */ 368 snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
397 sndrv_pcm_uframes_t silence_size; /* silence block size */ 369 snd_pcm_uframes_t silence_size; /* silence block size */
398 sndrv_pcm_uframes_t boundary; /* pointers wrap point */ 370 snd_pcm_uframes_t boundary; /* pointers wrap point */
399 unsigned char reserved[64]; /* reserved for future */ 371 unsigned char reserved[64]; /* reserved for future */
400}; 372};
401 373
402struct sndrv_pcm_channel_info { 374struct snd_pcm_channel_info {
403 unsigned int channel; 375 unsigned int channel;
404 off_t offset; /* mmap offset */ 376 off_t offset; /* mmap offset */
405 unsigned int first; /* offset to first sample in bits */ 377 unsigned int first; /* offset to first sample in bits */
406 unsigned int step; /* samples distance in bits */ 378 unsigned int step; /* samples distance in bits */
407}; 379};
408 380
409struct sndrv_pcm_status { 381struct snd_pcm_status {
410 enum sndrv_pcm_state state; /* stream state */ 382 snd_pcm_state_t state; /* stream state */
411 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */ 383 struct timespec trigger_tstamp; /* time when stream was started/stopped/paused */
412 struct timespec tstamp; /* reference timestamp */ 384 struct timespec tstamp; /* reference timestamp */
413 sndrv_pcm_uframes_t appl_ptr; /* appl ptr */ 385 snd_pcm_uframes_t appl_ptr; /* appl ptr */
414 sndrv_pcm_uframes_t hw_ptr; /* hw ptr */ 386 snd_pcm_uframes_t hw_ptr; /* hw ptr */
415 sndrv_pcm_sframes_t delay; /* current delay in frames */ 387 snd_pcm_sframes_t delay; /* current delay in frames */
416 sndrv_pcm_uframes_t avail; /* number of frames available */ 388 snd_pcm_uframes_t avail; /* number of frames available */
417 sndrv_pcm_uframes_t avail_max; /* max frames available on hw since last status */ 389 snd_pcm_uframes_t avail_max; /* max frames available on hw since last status */
418 sndrv_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */ 390 snd_pcm_uframes_t overrange; /* count of ADC (capture) overrange detections from last status */
419 enum sndrv_pcm_state suspended_state; /* suspended stream state */ 391 snd_pcm_state_t suspended_state; /* suspended stream state */
420 unsigned char reserved[60]; /* must be filled with zero */ 392 unsigned char reserved[60]; /* must be filled with zero */
421}; 393};
422 394
423struct sndrv_pcm_mmap_status { 395struct snd_pcm_mmap_status {
424 enum sndrv_pcm_state state; /* RO: state - SNDRV_PCM_STATE_XXXX */ 396 snd_pcm_state_t state; /* RO: state - SNDRV_PCM_STATE_XXXX */
425 int pad1; /* Needed for 64 bit alignment */ 397 int pad1; /* Needed for 64 bit alignment */
426 sndrv_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */ 398 snd_pcm_uframes_t hw_ptr; /* RO: hw ptr (0...boundary-1) */
427 struct timespec tstamp; /* Timestamp */ 399 struct timespec tstamp; /* Timestamp */
428 enum sndrv_pcm_state suspended_state; /* RO: suspended stream state */ 400 snd_pcm_state_t suspended_state; /* RO: suspended stream state */
429}; 401};
430 402
431struct sndrv_pcm_mmap_control { 403struct snd_pcm_mmap_control {
432 sndrv_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */ 404 snd_pcm_uframes_t appl_ptr; /* RW: appl ptr (0...boundary-1) */
433 sndrv_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */ 405 snd_pcm_uframes_t avail_min; /* RW: min available frames for wakeup */
434}; 406};
435 407
436#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */ 408#define SNDRV_PCM_SYNC_PTR_HWSYNC (1<<0) /* execute hwsync */
437#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */ 409#define SNDRV_PCM_SYNC_PTR_APPL (1<<1) /* get appl_ptr from driver (r/w op) */
438#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */ 410#define SNDRV_PCM_SYNC_PTR_AVAIL_MIN (1<<2) /* get avail_min from driver */
439 411
440struct sndrv_pcm_sync_ptr { 412struct snd_pcm_sync_ptr {
441 unsigned int flags; 413 unsigned int flags;
442 union { 414 union {
443 struct sndrv_pcm_mmap_status status; 415 struct snd_pcm_mmap_status status;
444 unsigned char reserved[64]; 416 unsigned char reserved[64];
445 } s; 417 } s;
446 union { 418 union {
447 struct sndrv_pcm_mmap_control control; 419 struct snd_pcm_mmap_control control;
448 unsigned char reserved[64]; 420 unsigned char reserved[64];
449 } c; 421 } c;
450}; 422};
451 423
452struct sndrv_xferi { 424struct snd_xferi {
453 sndrv_pcm_sframes_t result; 425 snd_pcm_sframes_t result;
454 void __user *buf; 426 void __user *buf;
455 sndrv_pcm_uframes_t frames; 427 snd_pcm_uframes_t frames;
456}; 428};
457 429
458struct sndrv_xfern { 430struct snd_xfern {
459 sndrv_pcm_sframes_t result; 431 snd_pcm_sframes_t result;
460 void __user * __user *bufs; 432 void __user * __user *bufs;
461 sndrv_pcm_uframes_t frames; 433 snd_pcm_uframes_t frames;
462}; 434};
463 435
464enum { 436enum {
465 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int), 437 SNDRV_PCM_IOCTL_PVERSION = _IOR('A', 0x00, int),
466 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct sndrv_pcm_info), 438 SNDRV_PCM_IOCTL_INFO = _IOR('A', 0x01, struct snd_pcm_info),
467 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int), 439 SNDRV_PCM_IOCTL_TSTAMP = _IOW('A', 0x02, int),
468 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct sndrv_pcm_hw_params), 440 SNDRV_PCM_IOCTL_HW_REFINE = _IOWR('A', 0x10, struct snd_pcm_hw_params),
469 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct sndrv_pcm_hw_params), 441 SNDRV_PCM_IOCTL_HW_PARAMS = _IOWR('A', 0x11, struct snd_pcm_hw_params),
470 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12), 442 SNDRV_PCM_IOCTL_HW_FREE = _IO('A', 0x12),
471 SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct sndrv_pcm_sw_params), 443 SNDRV_PCM_IOCTL_SW_PARAMS = _IOWR('A', 0x13, struct snd_pcm_sw_params),
472 SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct sndrv_pcm_status), 444 SNDRV_PCM_IOCTL_STATUS = _IOR('A', 0x20, struct snd_pcm_status),
473 SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, sndrv_pcm_sframes_t), 445 SNDRV_PCM_IOCTL_DELAY = _IOR('A', 0x21, snd_pcm_sframes_t),
474 SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22), 446 SNDRV_PCM_IOCTL_HWSYNC = _IO('A', 0x22),
475 SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct sndrv_pcm_sync_ptr), 447 SNDRV_PCM_IOCTL_SYNC_PTR = _IOWR('A', 0x23, struct snd_pcm_sync_ptr),
476 SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct sndrv_pcm_channel_info), 448 SNDRV_PCM_IOCTL_CHANNEL_INFO = _IOR('A', 0x32, struct snd_pcm_channel_info),
477 SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40), 449 SNDRV_PCM_IOCTL_PREPARE = _IO('A', 0x40),
478 SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41), 450 SNDRV_PCM_IOCTL_RESET = _IO('A', 0x41),
479 SNDRV_PCM_IOCTL_START = _IO('A', 0x42), 451 SNDRV_PCM_IOCTL_START = _IO('A', 0x42),
480 SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43), 452 SNDRV_PCM_IOCTL_DROP = _IO('A', 0x43),
481 SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44), 453 SNDRV_PCM_IOCTL_DRAIN = _IO('A', 0x44),
482 SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int), 454 SNDRV_PCM_IOCTL_PAUSE = _IOW('A', 0x45, int),
483 SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, sndrv_pcm_uframes_t), 455 SNDRV_PCM_IOCTL_REWIND = _IOW('A', 0x46, snd_pcm_uframes_t),
484 SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47), 456 SNDRV_PCM_IOCTL_RESUME = _IO('A', 0x47),
485 SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48), 457 SNDRV_PCM_IOCTL_XRUN = _IO('A', 0x48),
486 SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, sndrv_pcm_uframes_t), 458 SNDRV_PCM_IOCTL_FORWARD = _IOW('A', 0x49, snd_pcm_uframes_t),
487 SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct sndrv_xferi), 459 SNDRV_PCM_IOCTL_WRITEI_FRAMES = _IOW('A', 0x50, struct snd_xferi),
488 SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct sndrv_xferi), 460 SNDRV_PCM_IOCTL_READI_FRAMES = _IOR('A', 0x51, struct snd_xferi),
489 SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct sndrv_xfern), 461 SNDRV_PCM_IOCTL_WRITEN_FRAMES = _IOW('A', 0x52, struct snd_xfern),
490 SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct sndrv_xfern), 462 SNDRV_PCM_IOCTL_READN_FRAMES = _IOR('A', 0x53, struct snd_xfern),
491 SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int), 463 SNDRV_PCM_IOCTL_LINK = _IOW('A', 0x60, int),
492 SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61), 464 SNDRV_PCM_IOCTL_UNLINK = _IO('A', 0x61),
493}; 465};
@@ -507,7 +479,7 @@ enum {
507 479
508#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0) 480#define SNDRV_RAWMIDI_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 0)
509 481
510enum sndrv_rawmidi_stream { 482enum {
511 SNDRV_RAWMIDI_STREAM_OUTPUT = 0, 483 SNDRV_RAWMIDI_STREAM_OUTPUT = 0,
512 SNDRV_RAWMIDI_STREAM_INPUT, 484 SNDRV_RAWMIDI_STREAM_INPUT,
513 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT, 485 SNDRV_RAWMIDI_STREAM_LAST = SNDRV_RAWMIDI_STREAM_INPUT,
@@ -517,10 +489,10 @@ enum sndrv_rawmidi_stream {
517#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002 489#define SNDRV_RAWMIDI_INFO_INPUT 0x00000002
518#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004 490#define SNDRV_RAWMIDI_INFO_DUPLEX 0x00000004
519 491
520struct sndrv_rawmidi_info { 492struct snd_rawmidi_info {
521 unsigned int device; /* RO/WR (control): device number */ 493 unsigned int device; /* RO/WR (control): device number */
522 unsigned int subdevice; /* RO/WR (control): subdevice number */ 494 unsigned int subdevice; /* RO/WR (control): subdevice number */
523 enum sndrv_rawmidi_stream stream; /* WR: stream */ 495 int stream; /* WR: stream */
524 int card; /* R: card number */ 496 int card; /* R: card number */
525 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */ 497 unsigned int flags; /* SNDRV_RAWMIDI_INFO_XXXX */
526 unsigned char id[64]; /* ID (user selectable) */ 498 unsigned char id[64]; /* ID (user selectable) */
@@ -531,16 +503,16 @@ struct sndrv_rawmidi_info {
531 unsigned char reserved[64]; /* reserved for future use */ 503 unsigned char reserved[64]; /* reserved for future use */
532}; 504};
533 505
534struct sndrv_rawmidi_params { 506struct snd_rawmidi_params {
535 enum sndrv_rawmidi_stream stream; 507 int stream;
536 size_t buffer_size; /* queue size in bytes */ 508 size_t buffer_size; /* queue size in bytes */
537 size_t avail_min; /* minimum avail bytes for wakeup */ 509 size_t avail_min; /* minimum avail bytes for wakeup */
538 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */ 510 unsigned int no_active_sensing: 1; /* do not send active sensing byte in close() */
539 unsigned char reserved[16]; /* reserved for future use */ 511 unsigned char reserved[16]; /* reserved for future use */
540}; 512};
541 513
542struct sndrv_rawmidi_status { 514struct snd_rawmidi_status {
543 enum sndrv_rawmidi_stream stream; 515 int stream;
544 struct timespec tstamp; /* Timestamp */ 516 struct timespec tstamp; /* Timestamp */
545 size_t avail; /* available bytes */ 517 size_t avail; /* available bytes */
546 size_t xruns; /* count of overruns since last status (in bytes) */ 518 size_t xruns; /* count of overruns since last status (in bytes) */
@@ -549,9 +521,9 @@ struct sndrv_rawmidi_status {
549 521
550enum { 522enum {
551 SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int), 523 SNDRV_RAWMIDI_IOCTL_PVERSION = _IOR('W', 0x00, int),
552 SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct sndrv_rawmidi_info), 524 SNDRV_RAWMIDI_IOCTL_INFO = _IOR('W', 0x01, struct snd_rawmidi_info),
553 SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct sndrv_rawmidi_params), 525 SNDRV_RAWMIDI_IOCTL_PARAMS = _IOWR('W', 0x10, struct snd_rawmidi_params),
554 SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct sndrv_rawmidi_status), 526 SNDRV_RAWMIDI_IOCTL_STATUS = _IOWR('W', 0x20, struct snd_rawmidi_status),
555 SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int), 527 SNDRV_RAWMIDI_IOCTL_DROP = _IOW('W', 0x30, int),
556 SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int), 528 SNDRV_RAWMIDI_IOCTL_DRAIN = _IOW('W', 0x31, int),
557}; 529};
@@ -562,7 +534,7 @@ enum {
562 534
563#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5) 535#define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 5)
564 536
565enum sndrv_timer_class { 537enum {
566 SNDRV_TIMER_CLASS_NONE = -1, 538 SNDRV_TIMER_CLASS_NONE = -1,
567 SNDRV_TIMER_CLASS_SLAVE = 0, 539 SNDRV_TIMER_CLASS_SLAVE = 0,
568 SNDRV_TIMER_CLASS_GLOBAL, 540 SNDRV_TIMER_CLASS_GLOBAL,
@@ -572,7 +544,7 @@ enum sndrv_timer_class {
572}; 544};
573 545
574/* slave timer classes */ 546/* slave timer classes */
575enum sndrv_timer_slave_class { 547enum {
576 SNDRV_TIMER_SCLASS_NONE = 0, 548 SNDRV_TIMER_SCLASS_NONE = 0,
577 SNDRV_TIMER_SCLASS_APPLICATION, 549 SNDRV_TIMER_SCLASS_APPLICATION,
578 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */ 550 SNDRV_TIMER_SCLASS_SEQUENCER, /* alias */
@@ -588,16 +560,16 @@ enum sndrv_timer_slave_class {
588/* info flags */ 560/* info flags */
589#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */ 561#define SNDRV_TIMER_FLG_SLAVE (1<<0) /* cannot be controlled */
590 562
591struct sndrv_timer_id { 563struct snd_timer_id {
592 enum sndrv_timer_class dev_class; 564 int dev_class;
593 enum sndrv_timer_slave_class dev_sclass; 565 int dev_sclass;
594 int card; 566 int card;
595 int device; 567 int device;
596 int subdevice; 568 int subdevice;
597}; 569};
598 570
599struct sndrv_timer_ginfo { 571struct snd_timer_ginfo {
600 struct sndrv_timer_id tid; /* requested timer ID */ 572 struct snd_timer_id tid; /* requested timer ID */
601 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ 573 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
602 int card; /* card number */ 574 int card; /* card number */
603 unsigned char id[64]; /* timer identification */ 575 unsigned char id[64]; /* timer identification */
@@ -610,27 +582,27 @@ struct sndrv_timer_ginfo {
610 unsigned char reserved[32]; 582 unsigned char reserved[32];
611}; 583};
612 584
613struct sndrv_timer_gparams { 585struct snd_timer_gparams {
614 struct sndrv_timer_id tid; /* requested timer ID */ 586 struct snd_timer_id tid; /* requested timer ID */
615 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */ 587 unsigned long period_num; /* requested precise period duration (in seconds) - numerator */
616 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */ 588 unsigned long period_den; /* requested precise period duration (in seconds) - denominator */
617 unsigned char reserved[32]; 589 unsigned char reserved[32];
618}; 590};
619 591
620struct sndrv_timer_gstatus { 592struct snd_timer_gstatus {
621 struct sndrv_timer_id tid; /* requested timer ID */ 593 struct snd_timer_id tid; /* requested timer ID */
622 unsigned long resolution; /* current period resolution in ns */ 594 unsigned long resolution; /* current period resolution in ns */
623 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */ 595 unsigned long resolution_num; /* precise current period resolution (in seconds) - numerator */
624 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */ 596 unsigned long resolution_den; /* precise current period resolution (in seconds) - denominator */
625 unsigned char reserved[32]; 597 unsigned char reserved[32];
626}; 598};
627 599
628struct sndrv_timer_select { 600struct snd_timer_select {
629 struct sndrv_timer_id id; /* bind to timer ID */ 601 struct snd_timer_id id; /* bind to timer ID */
630 unsigned char reserved[32]; /* reserved */ 602 unsigned char reserved[32]; /* reserved */
631}; 603};
632 604
633struct sndrv_timer_info { 605struct snd_timer_info {
634 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */ 606 unsigned int flags; /* timer flags - SNDRV_TIMER_FLG_* */
635 int card; /* card number */ 607 int card; /* card number */
636 unsigned char id[64]; /* timer identificator */ 608 unsigned char id[64]; /* timer identificator */
@@ -644,7 +616,7 @@ struct sndrv_timer_info {
644#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */ 616#define SNDRV_TIMER_PSFLG_EXCLUSIVE (1<<1) /* exclusive use, precise start/stop/pause/continue */
645#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */ 617#define SNDRV_TIMER_PSFLG_EARLY_EVENT (1<<2) /* write early event to the poll queue */
646 618
647struct sndrv_timer_params { 619struct snd_timer_params {
648 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */ 620 unsigned int flags; /* flags - SNDRV_MIXER_PSFLG_* */
649 unsigned int ticks; /* requested resolution in ticks */ 621 unsigned int ticks; /* requested resolution in ticks */
650 unsigned int queue_size; /* total size of queue (32-1024) */ 622 unsigned int queue_size; /* total size of queue (32-1024) */
@@ -653,7 +625,7 @@ struct sndrv_timer_params {
653 unsigned char reserved[60]; /* reserved */ 625 unsigned char reserved[60]; /* reserved */
654}; 626};
655 627
656struct sndrv_timer_status { 628struct snd_timer_status {
657 struct timespec tstamp; /* Timestamp - last update */ 629 struct timespec tstamp; /* Timestamp - last update */
658 unsigned int resolution; /* current period resolution in ns */ 630 unsigned int resolution; /* current period resolution in ns */
659 unsigned int lost; /* counter of master tick lost */ 631 unsigned int lost; /* counter of master tick lost */
@@ -664,15 +636,15 @@ struct sndrv_timer_status {
664 636
665enum { 637enum {
666 SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int), 638 SNDRV_TIMER_IOCTL_PVERSION = _IOR('T', 0x00, int),
667 SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct sndrv_timer_id), 639 SNDRV_TIMER_IOCTL_NEXT_DEVICE = _IOWR('T', 0x01, struct snd_timer_id),
668 SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int), 640 SNDRV_TIMER_IOCTL_TREAD = _IOW('T', 0x02, int),
669 SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct sndrv_timer_ginfo), 641 SNDRV_TIMER_IOCTL_GINFO = _IOWR('T', 0x03, struct snd_timer_ginfo),
670 SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct sndrv_timer_gparams), 642 SNDRV_TIMER_IOCTL_GPARAMS = _IOW('T', 0x04, struct snd_timer_gparams),
671 SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct sndrv_timer_gstatus), 643 SNDRV_TIMER_IOCTL_GSTATUS = _IOWR('T', 0x05, struct snd_timer_gstatus),
672 SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct sndrv_timer_select), 644 SNDRV_TIMER_IOCTL_SELECT = _IOW('T', 0x10, struct snd_timer_select),
673 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), 645 SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct snd_timer_info),
674 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), 646 SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct snd_timer_params),
675 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), 647 SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct snd_timer_status),
676 /* The following four ioctls are changed since 1.0.9 due to confliction */ 648 /* The following four ioctls are changed since 1.0.9 due to confliction */
677 SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), 649 SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0),
678 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), 650 SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1),
@@ -680,12 +652,12 @@ enum {
680 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), 652 SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3),
681}; 653};
682 654
683struct sndrv_timer_read { 655struct snd_timer_read {
684 unsigned int resolution; 656 unsigned int resolution;
685 unsigned int ticks; 657 unsigned int ticks;
686}; 658};
687 659
688enum sndrv_timer_event { 660enum {
689 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ 661 SNDRV_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */
690 SNDRV_TIMER_EVENT_TICK, /* val = ticks */ 662 SNDRV_TIMER_EVENT_TICK, /* val = ticks */
691 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */ 663 SNDRV_TIMER_EVENT_START, /* val = resolution in ns */
@@ -704,8 +676,8 @@ enum sndrv_timer_event {
704 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10, 676 SNDRV_TIMER_EVENT_MRESUME = SNDRV_TIMER_EVENT_RESUME + 10,
705}; 677};
706 678
707struct sndrv_timer_tread { 679struct snd_timer_tread {
708 enum sndrv_timer_event event; 680 int event;
709 struct timespec tstamp; 681 struct timespec tstamp;
710 unsigned int val; 682 unsigned int val;
711}; 683};
@@ -718,7 +690,7 @@ struct sndrv_timer_tread {
718 690
719#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) 691#define SNDRV_CTL_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3)
720 692
721struct sndrv_ctl_card_info { 693struct snd_ctl_card_info {
722 int card; /* card number */ 694 int card; /* card number */
723 int pad; /* reserved for future (was type) */ 695 int pad; /* reserved for future (was type) */
724 unsigned char id[16]; /* ID of card (user selectable) */ 696 unsigned char id[16]; /* ID of card (user selectable) */
@@ -731,27 +703,25 @@ struct sndrv_ctl_card_info {
731 unsigned char reserved[48]; /* reserved for future */ 703 unsigned char reserved[48]; /* reserved for future */
732}; 704};
733 705
734enum sndrv_ctl_elem_type { 706typedef int __bitwise snd_ctl_elem_type_t;
735 SNDRV_CTL_ELEM_TYPE_NONE = 0, /* invalid */ 707#define SNDRV_CTL_ELEM_TYPE_NONE ((__force snd_ctl_elem_type_t) 0) /* invalid */
736 SNDRV_CTL_ELEM_TYPE_BOOLEAN, /* boolean type */ 708#define SNDRV_CTL_ELEM_TYPE_BOOLEAN ((__force snd_ctl_elem_type_t) 1) /* boolean type */
737 SNDRV_CTL_ELEM_TYPE_INTEGER, /* integer type */ 709#define SNDRV_CTL_ELEM_TYPE_INTEGER ((__force snd_ctl_elem_type_t) 2) /* integer type */
738 SNDRV_CTL_ELEM_TYPE_ENUMERATED, /* enumerated type */ 710#define SNDRV_CTL_ELEM_TYPE_ENUMERATED ((__force snd_ctl_elem_type_t) 3) /* enumerated type */
739 SNDRV_CTL_ELEM_TYPE_BYTES, /* byte array */ 711#define SNDRV_CTL_ELEM_TYPE_BYTES ((__force snd_ctl_elem_type_t) 4) /* byte array */
740 SNDRV_CTL_ELEM_TYPE_IEC958, /* IEC958 (S/PDIF) setup */ 712#define SNDRV_CTL_ELEM_TYPE_IEC958 ((__force snd_ctl_elem_type_t) 5) /* IEC958 (S/PDIF) setup */
741 SNDRV_CTL_ELEM_TYPE_INTEGER64, /* 64-bit integer type */ 713#define SNDRV_CTL_ELEM_TYPE_INTEGER64 ((__force snd_ctl_elem_type_t) 6) /* 64-bit integer type */
742 SNDRV_CTL_ELEM_TYPE_LAST = SNDRV_CTL_ELEM_TYPE_INTEGER64, 714#define SNDRV_CTL_ELEM_TYPE_LAST SNDRV_CTL_ELEM_TYPE_INTEGER64
743}; 715
744 716typedef int __bitwise snd_ctl_elem_iface_t;
745enum sndrv_ctl_elem_iface { 717#define SNDRV_CTL_ELEM_IFACE_CARD ((__force snd_ctl_elem_iface_t) 0) /* global control */
746 SNDRV_CTL_ELEM_IFACE_CARD = 0, /* global control */ 718#define SNDRV_CTL_ELEM_IFACE_HWDEP ((__force snd_ctl_elem_iface_t) 1) /* hardware dependent device */
747 SNDRV_CTL_ELEM_IFACE_HWDEP, /* hardware dependent device */ 719#define SNDRV_CTL_ELEM_IFACE_MIXER ((__force snd_ctl_elem_iface_t) 2) /* virtual mixer device */
748 SNDRV_CTL_ELEM_IFACE_MIXER, /* virtual mixer device */ 720#define SNDRV_CTL_ELEM_IFACE_PCM ((__force snd_ctl_elem_iface_t) 3) /* PCM device */
749 SNDRV_CTL_ELEM_IFACE_PCM, /* PCM device */ 721#define SNDRV_CTL_ELEM_IFACE_RAWMIDI ((__force snd_ctl_elem_iface_t) 4) /* RawMidi device */
750 SNDRV_CTL_ELEM_IFACE_RAWMIDI, /* RawMidi device */ 722#define SNDRV_CTL_ELEM_IFACE_TIMER ((__force snd_ctl_elem_iface_t) 5) /* timer device */
751 SNDRV_CTL_ELEM_IFACE_TIMER, /* timer device */ 723#define SNDRV_CTL_ELEM_IFACE_SEQUENCER ((__force snd_ctl_elem_iface_t) 6) /* sequencer client */
752 SNDRV_CTL_ELEM_IFACE_SEQUENCER, /* sequencer client */ 724#define SNDRV_CTL_ELEM_IFACE_LAST SNDRV_CTL_ELEM_IFACE_SEQUENCER
753 SNDRV_CTL_ELEM_IFACE_LAST = SNDRV_CTL_ELEM_IFACE_SEQUENCER,
754};
755 725
756#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0) 726#define SNDRV_CTL_ELEM_ACCESS_READ (1<<0)
757#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1) 727#define SNDRV_CTL_ELEM_ACCESS_WRITE (1<<1)
@@ -773,27 +743,27 @@ enum sndrv_ctl_elem_iface {
773#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */ 743#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
774#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */ 744#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
775 745
776struct sndrv_ctl_elem_id { 746struct snd_ctl_elem_id {
777 unsigned int numid; /* numeric identifier, zero = invalid */ 747 unsigned int numid; /* numeric identifier, zero = invalid */
778 enum sndrv_ctl_elem_iface iface; /* interface identifier */ 748 snd_ctl_elem_iface_t iface; /* interface identifier */
779 unsigned int device; /* device/client number */ 749 unsigned int device; /* device/client number */
780 unsigned int subdevice; /* subdevice (substream) number */ 750 unsigned int subdevice; /* subdevice (substream) number */
781 unsigned char name[44]; /* ASCII name of item */ 751 unsigned char name[44]; /* ASCII name of item */
782 unsigned int index; /* index of item */ 752 unsigned int index; /* index of item */
783}; 753};
784 754
785struct sndrv_ctl_elem_list { 755struct snd_ctl_elem_list {
786 unsigned int offset; /* W: first element ID to get */ 756 unsigned int offset; /* W: first element ID to get */
787 unsigned int space; /* W: count of element IDs to get */ 757 unsigned int space; /* W: count of element IDs to get */
788 unsigned int used; /* R: count of element IDs set */ 758 unsigned int used; /* R: count of element IDs set */
789 unsigned int count; /* R: count of all elements */ 759 unsigned int count; /* R: count of all elements */
790 struct sndrv_ctl_elem_id __user *pids; /* R: IDs */ 760 struct snd_ctl_elem_id __user *pids; /* R: IDs */
791 unsigned char reserved[50]; 761 unsigned char reserved[50];
792}; 762};
793 763
794struct sndrv_ctl_elem_info { 764struct snd_ctl_elem_info {
795 struct sndrv_ctl_elem_id id; /* W: element ID */ 765 struct snd_ctl_elem_id id; /* W: element ID */
796 enum sndrv_ctl_elem_type type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ 766 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
797 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ 767 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
798 unsigned int count; /* count of values */ 768 unsigned int count; /* count of values */
799 pid_t owner; /* owner's PID of this control */ 769 pid_t owner; /* owner's PID of this control */
@@ -822,8 +792,8 @@ struct sndrv_ctl_elem_info {
822 unsigned char reserved[64-4*sizeof(unsigned short)]; 792 unsigned char reserved[64-4*sizeof(unsigned short)];
823}; 793};
824 794
825struct sndrv_ctl_elem_value { 795struct snd_ctl_elem_value {
826 struct sndrv_ctl_elem_id id; /* W: element ID */ 796 struct snd_ctl_elem_id id; /* W: element ID */
827 unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */ 797 unsigned int indirect: 1; /* W: use indirect pointer (xxx_ptr member) */
828 union { 798 union {
829 union { 799 union {
@@ -842,7 +812,7 @@ struct sndrv_ctl_elem_value {
842 unsigned char data[512]; 812 unsigned char data[512];
843 unsigned char *data_ptr; 813 unsigned char *data_ptr;
844 } bytes; 814 } bytes;
845 struct sndrv_aes_iec958 iec958; 815 struct snd_aes_iec958 iec958;
846 } value; /* RO */ 816 } value; /* RO */
847 struct timespec tstamp; 817 struct timespec tstamp;
848 unsigned char reserved[128-sizeof(struct timespec)]; 818 unsigned char reserved[128-sizeof(struct timespec)];
@@ -850,24 +820,24 @@ struct sndrv_ctl_elem_value {
850 820
851enum { 821enum {
852 SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int), 822 SNDRV_CTL_IOCTL_PVERSION = _IOR('U', 0x00, int),
853 SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct sndrv_ctl_card_info), 823 SNDRV_CTL_IOCTL_CARD_INFO = _IOR('U', 0x01, struct snd_ctl_card_info),
854 SNDRV_CTL_IOCTL_ELEM_LIST = _IOWR('U', 0x10, struct sndrv_ctl_elem_list), 824 SNDRV_CTL_IOCTL_ELEM_LIST = _IOWR('U', 0x10, struct snd_ctl_elem_list),
855 SNDRV_CTL_IOCTL_ELEM_INFO = _IOWR('U', 0x11, struct sndrv_ctl_elem_info), 825 SNDRV_CTL_IOCTL_ELEM_INFO = _IOWR('U', 0x11, struct snd_ctl_elem_info),
856 SNDRV_CTL_IOCTL_ELEM_READ = _IOWR('U', 0x12, struct sndrv_ctl_elem_value), 826 SNDRV_CTL_IOCTL_ELEM_READ = _IOWR('U', 0x12, struct snd_ctl_elem_value),
857 SNDRV_CTL_IOCTL_ELEM_WRITE = _IOWR('U', 0x13, struct sndrv_ctl_elem_value), 827 SNDRV_CTL_IOCTL_ELEM_WRITE = _IOWR('U', 0x13, struct snd_ctl_elem_value),
858 SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct sndrv_ctl_elem_id), 828 SNDRV_CTL_IOCTL_ELEM_LOCK = _IOW('U', 0x14, struct snd_ctl_elem_id),
859 SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct sndrv_ctl_elem_id), 829 SNDRV_CTL_IOCTL_ELEM_UNLOCK = _IOW('U', 0x15, struct snd_ctl_elem_id),
860 SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int), 830 SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS = _IOWR('U', 0x16, int),
861 SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct sndrv_ctl_elem_info), 831 SNDRV_CTL_IOCTL_ELEM_ADD = _IOWR('U', 0x17, struct snd_ctl_elem_info),
862 SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct sndrv_ctl_elem_info), 832 SNDRV_CTL_IOCTL_ELEM_REPLACE = _IOWR('U', 0x18, struct snd_ctl_elem_info),
863 SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct sndrv_ctl_elem_id), 833 SNDRV_CTL_IOCTL_ELEM_REMOVE = _IOWR('U', 0x19, struct snd_ctl_elem_id),
864 SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int), 834 SNDRV_CTL_IOCTL_HWDEP_NEXT_DEVICE = _IOWR('U', 0x20, int),
865 SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct sndrv_hwdep_info), 835 SNDRV_CTL_IOCTL_HWDEP_INFO = _IOR('U', 0x21, struct snd_hwdep_info),
866 SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int), 836 SNDRV_CTL_IOCTL_PCM_NEXT_DEVICE = _IOR('U', 0x30, int),
867 SNDRV_CTL_IOCTL_PCM_INFO = _IOWR('U', 0x31, struct sndrv_pcm_info), 837 SNDRV_CTL_IOCTL_PCM_INFO = _IOWR('U', 0x31, struct snd_pcm_info),
868 SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int), 838 SNDRV_CTL_IOCTL_PCM_PREFER_SUBDEVICE = _IOW('U', 0x32, int),
869 SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int), 839 SNDRV_CTL_IOCTL_RAWMIDI_NEXT_DEVICE = _IOWR('U', 0x40, int),
870 SNDRV_CTL_IOCTL_RAWMIDI_INFO = _IOWR('U', 0x41, struct sndrv_rawmidi_info), 840 SNDRV_CTL_IOCTL_RAWMIDI_INFO = _IOWR('U', 0x41, struct snd_rawmidi_info),
871 SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int), 841 SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int),
872 SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int), 842 SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int),
873 SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), 843 SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int),
@@ -887,12 +857,12 @@ enum sndrv_ctl_event_type {
887#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */ 857#define SNDRV_CTL_EVENT_MASK_ADD (1<<2) /* element was added */
888#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */ 858#define SNDRV_CTL_EVENT_MASK_REMOVE (~0U) /* element was removed */
889 859
890struct sndrv_ctl_event { 860struct snd_ctl_event {
891 enum sndrv_ctl_event_type type; /* event type - SNDRV_CTL_EVENT_* */ 861 int type; /* event type - SNDRV_CTL_EVENT_* */
892 union { 862 union {
893 struct { 863 struct {
894 unsigned int mask; 864 unsigned int mask;
895 struct sndrv_ctl_elem_id id; 865 struct snd_ctl_elem_id id;
896 } elem; 866 } elem;
897 unsigned char data8[60]; 867 unsigned char data8[60];
898 } data; 868 } data;
@@ -920,14 +890,14 @@ struct sndrv_ctl_event {
920 * 890 *
921 */ 891 */
922 892
923struct sndrv_xferv { 893struct snd_xferv {
924 const struct iovec *vector; 894 const struct iovec *vector;
925 unsigned long count; 895 unsigned long count;
926}; 896};
927 897
928enum { 898enum {
929 SNDRV_IOCTL_READV = _IOW('K', 0x00, struct sndrv_xferv), 899 SNDRV_IOCTL_READV = _IOW('K', 0x00, struct snd_xferv),
930 SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct sndrv_xferv), 900 SNDRV_IOCTL_WRITEV = _IOW('K', 0x01, struct snd_xferv),
931}; 901};
932 902
933#endif /* __SOUND_ASOUND_H */ 903#endif /* __SOUND_ASOUND_H */
diff --git a/include/sound/asound_fm.h b/include/sound/asound_fm.h
index b0da677f8f75..956fdc23c595 100644
--- a/include/sound/asound_fm.h
+++ b/include/sound/asound_fm.h
@@ -29,16 +29,16 @@
29#define SNDRV_DM_FM_MODE_OPL2 0x00 29#define SNDRV_DM_FM_MODE_OPL2 0x00
30#define SNDRV_DM_FM_MODE_OPL3 0x01 30#define SNDRV_DM_FM_MODE_OPL3 0x01
31 31
32typedef struct snd_dm_fm_info { 32struct snd_dm_fm_info {
33 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ 33 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
34 unsigned char rhythm; /* percussion mode flag */ 34 unsigned char rhythm; /* percussion mode flag */
35} snd_dm_fm_info_t; 35};
36 36
37/* 37/*
38 * Data structure composing an FM "note" or sound event. 38 * Data structure composing an FM "note" or sound event.
39 */ 39 */
40 40
41typedef struct snd_dm_fm_voice { 41struct snd_dm_fm_voice {
42 unsigned char op; /* operator cell (0 or 1) */ 42 unsigned char op; /* operator cell (0 or 1) */
43 unsigned char voice; /* FM voice (0 to 17) */ 43 unsigned char voice; /* FM voice (0 to 17) */
44 44
@@ -60,25 +60,25 @@ typedef struct snd_dm_fm_voice {
60 unsigned char left; /* stereo left */ 60 unsigned char left; /* stereo left */
61 unsigned char right; /* stereo right */ 61 unsigned char right; /* stereo right */
62 unsigned char waveform; /* 3 bits: waveform shape */ 62 unsigned char waveform; /* 3 bits: waveform shape */
63} snd_dm_fm_voice_t; 63};
64 64
65/* 65/*
66 * This describes an FM note by its voice, octave, frequency number (10bit) 66 * This describes an FM note by its voice, octave, frequency number (10bit)
67 * and key on/off. 67 * and key on/off.
68 */ 68 */
69 69
70typedef struct snd_dm_fm_note { 70struct snd_dm_fm_note {
71 unsigned char voice; /* 0-17 voice channel */ 71 unsigned char voice; /* 0-17 voice channel */
72 unsigned char octave; /* 3 bits: what octave to play */ 72 unsigned char octave; /* 3 bits: what octave to play */
73 unsigned int fnum; /* 10 bits: frequency number */ 73 unsigned int fnum; /* 10 bits: frequency number */
74 unsigned char key_on; /* set for active, clear for silent */ 74 unsigned char key_on; /* set for active, clear for silent */
75} snd_dm_fm_note_t; 75};
76 76
77/* 77/*
78 * FM parameters that apply globally to all voices, and thus are not "notes" 78 * FM parameters that apply globally to all voices, and thus are not "notes"
79 */ 79 */
80 80
81typedef struct snd_dm_fm_params { 81struct snd_dm_fm_params {
82 unsigned char am_depth; /* amplitude modulation depth (1=hi) */ 82 unsigned char am_depth; /* amplitude modulation depth (1=hi) */
83 unsigned char vib_depth; /* vibrato depth (1=hi) */ 83 unsigned char vib_depth; /* vibrato depth (1=hi) */
84 unsigned char kbd_split; /* keyboard split */ 84 unsigned char kbd_split; /* keyboard split */
@@ -90,17 +90,17 @@ typedef struct snd_dm_fm_params {
90 unsigned char tomtom; 90 unsigned char tomtom;
91 unsigned char cymbal; 91 unsigned char cymbal;
92 unsigned char hihat; 92 unsigned char hihat;
93} snd_dm_fm_params_t; 93};
94 94
95/* 95/*
96 * FM mode ioctl settings 96 * FM mode ioctl settings
97 */ 97 */
98 98
99#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, snd_dm_fm_info_t) 99#define SNDRV_DM_FM_IOCTL_INFO _IOR('H', 0x20, struct snd_dm_fm_info)
100#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21) 100#define SNDRV_DM_FM_IOCTL_RESET _IO ('H', 0x21)
101#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, snd_dm_fm_note_t) 101#define SNDRV_DM_FM_IOCTL_PLAY_NOTE _IOW('H', 0x22, struct snd_dm_fm_note)
102#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, snd_dm_fm_voice_t) 102#define SNDRV_DM_FM_IOCTL_SET_VOICE _IOW('H', 0x23, struct snd_dm_fm_voice)
103#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, snd_dm_fm_params_t) 103#define SNDRV_DM_FM_IOCTL_SET_PARAMS _IOW('H', 0x24, struct snd_dm_fm_params)
104#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int) 104#define SNDRV_DM_FM_IOCTL_SET_MODE _IOW('H', 0x25, int)
105/* for OPL3 only */ 105/* for OPL3 only */
106#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int) 106#define SNDRV_DM_FM_IOCTL_SET_CONNECTION _IOW('H', 0x26, int)
diff --git a/include/sound/control.h b/include/sound/control.h
index ef7903c7a327..2489b1eb0110 100644
--- a/include/sound/control.h
+++ b/include/sound/control.h
@@ -24,24 +24,14 @@
24 24
25#include <sound/asound.h> 25#include <sound/asound.h>
26 26
27typedef struct sndrv_aes_iec958 snd_aes_iec958_t;
28typedef struct sndrv_ctl_card_info snd_ctl_card_info_t;
29typedef enum sndrv_ctl_elem_type snd_ctl_elem_type_t;
30typedef enum sndrv_ctl_elem_iface snd_ctl_elem_iface_t;
31typedef struct sndrv_ctl_elem_id snd_ctl_elem_id_t;
32typedef struct sndrv_ctl_elem_list snd_ctl_elem_list_t;
33typedef struct sndrv_ctl_elem_info snd_ctl_elem_info_t;
34typedef struct sndrv_ctl_elem_value snd_ctl_elem_value_t;
35typedef enum sndrv_ctl_event_type snd_ctl_event_type_t;
36typedef struct sndrv_ctl_event snd_ctl_event_t;
37
38#define snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data) 27#define snd_kcontrol_chip(kcontrol) ((kcontrol)->private_data)
39 28
40typedef int (snd_kcontrol_info_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_info_t * uinfo); 29struct snd_kcontrol;
41typedef int (snd_kcontrol_get_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 30typedef int (snd_kcontrol_info_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_info * uinfo);
42typedef int (snd_kcontrol_put_t) (snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 31typedef int (snd_kcontrol_get_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol);
32typedef int (snd_kcontrol_put_t) (struct snd_kcontrol * kcontrol, struct snd_ctl_elem_value * ucontrol);
43 33
44typedef struct _snd_kcontrol_new { 34struct snd_kcontrol_new {
45 snd_ctl_elem_iface_t iface; /* interface identifier */ 35 snd_ctl_elem_iface_t iface; /* interface identifier */
46 unsigned int device; /* device/client number */ 36 unsigned int device; /* device/client number */
47 unsigned int subdevice; /* subdevice (substream) number */ 37 unsigned int subdevice; /* subdevice (substream) number */
@@ -53,40 +43,40 @@ typedef struct _snd_kcontrol_new {
53 snd_kcontrol_get_t *get; 43 snd_kcontrol_get_t *get;
54 snd_kcontrol_put_t *put; 44 snd_kcontrol_put_t *put;
55 unsigned long private_value; 45 unsigned long private_value;
56} snd_kcontrol_new_t; 46};
57 47
58typedef struct _snd_kcontrol_volatile { 48struct snd_kcontrol_volatile {
59 snd_ctl_file_t *owner; /* locked */ 49 struct snd_ctl_file *owner; /* locked */
60 pid_t owner_pid; 50 pid_t owner_pid;
61 unsigned int access; /* access rights */ 51 unsigned int access; /* access rights */
62} snd_kcontrol_volatile_t; 52};
63 53
64struct _snd_kcontrol { 54struct snd_kcontrol {
65 struct list_head list; /* list of controls */ 55 struct list_head list; /* list of controls */
66 snd_ctl_elem_id_t id; 56 struct snd_ctl_elem_id id;
67 unsigned int count; /* count of same elements */ 57 unsigned int count; /* count of same elements */
68 snd_kcontrol_info_t *info; 58 snd_kcontrol_info_t *info;
69 snd_kcontrol_get_t *get; 59 snd_kcontrol_get_t *get;
70 snd_kcontrol_put_t *put; 60 snd_kcontrol_put_t *put;
71 unsigned long private_value; 61 unsigned long private_value;
72 void *private_data; 62 void *private_data;
73 void (*private_free)(snd_kcontrol_t *kcontrol); 63 void (*private_free)(struct snd_kcontrol *kcontrol);
74 snd_kcontrol_volatile_t vd[0]; /* volatile data */ 64 struct snd_kcontrol_volatile vd[0]; /* volatile data */
75}; 65};
76 66
77#define snd_kcontrol(n) list_entry(n, snd_kcontrol_t, list) 67#define snd_kcontrol(n) list_entry(n, struct snd_kcontrol, list)
78 68
79typedef struct _snd_kctl_event { 69struct snd_kctl_event {
80 struct list_head list; /* list of events */ 70 struct list_head list; /* list of events */
81 snd_ctl_elem_id_t id; 71 struct snd_ctl_elem_id id;
82 unsigned int mask; 72 unsigned int mask;
83} snd_kctl_event_t; 73};
84 74
85#define snd_kctl_event(n) list_entry(n, snd_kctl_event_t, list) 75#define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list)
86 76
87struct _snd_ctl_file { 77struct snd_ctl_file {
88 struct list_head list; /* list of all control files */ 78 struct list_head list; /* list of all control files */
89 snd_card_t *card; 79 struct snd_card *card;
90 pid_t pid; 80 pid_t pid;
91 int prefer_pcm_subdevice; 81 int prefer_pcm_subdevice;
92 int prefer_rawmidi_subdevice; 82 int prefer_rawmidi_subdevice;
@@ -97,25 +87,25 @@ struct _snd_ctl_file {
97 struct list_head events; /* waiting events for read */ 87 struct list_head events; /* waiting events for read */
98}; 88};
99 89
100#define snd_ctl_file(n) list_entry(n, snd_ctl_file_t, list) 90#define snd_ctl_file(n) list_entry(n, struct snd_ctl_file, list)
101 91
102typedef int (*snd_kctl_ioctl_func_t) (snd_card_t * card, 92typedef int (*snd_kctl_ioctl_func_t) (struct snd_card * card,
103 snd_ctl_file_t * control, 93 struct snd_ctl_file * control,
104 unsigned int cmd, unsigned long arg); 94 unsigned int cmd, unsigned long arg);
105 95
106void snd_ctl_notify(snd_card_t * card, unsigned int mask, snd_ctl_elem_id_t * id); 96void snd_ctl_notify(struct snd_card * card, unsigned int mask, struct snd_ctl_elem_id * id);
107 97
108snd_kcontrol_t *snd_ctl_new(snd_kcontrol_t * kcontrol, unsigned int access); 98struct snd_kcontrol *snd_ctl_new(struct snd_kcontrol * kcontrol, unsigned int access);
109snd_kcontrol_t *snd_ctl_new1(const snd_kcontrol_new_t * kcontrolnew, void * private_data); 99struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new * kcontrolnew, void * private_data);
110void snd_ctl_free_one(snd_kcontrol_t * kcontrol); 100void snd_ctl_free_one(struct snd_kcontrol * kcontrol);
111int snd_ctl_add(snd_card_t * card, snd_kcontrol_t * kcontrol); 101int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol);
112int snd_ctl_remove(snd_card_t * card, snd_kcontrol_t * kcontrol); 102int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol);
113int snd_ctl_remove_id(snd_card_t * card, snd_ctl_elem_id_t *id); 103int snd_ctl_remove_id(struct snd_card * card, struct snd_ctl_elem_id *id);
114int snd_ctl_rename_id(snd_card_t * card, snd_ctl_elem_id_t *src_id, snd_ctl_elem_id_t *dst_id); 104int snd_ctl_rename_id(struct snd_card * card, struct snd_ctl_elem_id *src_id, struct snd_ctl_elem_id *dst_id);
115snd_kcontrol_t *snd_ctl_find_numid(snd_card_t * card, unsigned int numid); 105struct snd_kcontrol *snd_ctl_find_numid(struct snd_card * card, unsigned int numid);
116snd_kcontrol_t *snd_ctl_find_id(snd_card_t * card, snd_ctl_elem_id_t *id); 106struct snd_kcontrol *snd_ctl_find_id(struct snd_card * card, struct snd_ctl_elem_id *id);
117 107
118int snd_ctl_create(snd_card_t *card); 108int snd_ctl_create(struct snd_card *card);
119 109
120int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn); 110int snd_ctl_register_ioctl(snd_kctl_ioctl_func_t fcn);
121int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn); 111int snd_ctl_unregister_ioctl(snd_kctl_ioctl_func_t fcn);
@@ -127,20 +117,20 @@ int snd_ctl_unregister_ioctl_compat(snd_kctl_ioctl_func_t fcn);
127#define snd_ctl_unregister_ioctl_compat(fcn) 117#define snd_ctl_unregister_ioctl_compat(fcn)
128#endif 118#endif
129 119
130int snd_ctl_elem_read(snd_card_t *card, snd_ctl_elem_value_t *control); 120int snd_ctl_elem_read(struct snd_card *card, struct snd_ctl_elem_value *control);
131int snd_ctl_elem_write(snd_card_t *card, snd_ctl_file_t *file, snd_ctl_elem_value_t *control); 121int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file, struct snd_ctl_elem_value *control);
132 122
133static inline unsigned int snd_ctl_get_ioffnum(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id) 123static inline unsigned int snd_ctl_get_ioffnum(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id)
134{ 124{
135 return id->numid - kctl->id.numid; 125 return id->numid - kctl->id.numid;
136} 126}
137 127
138static inline unsigned int snd_ctl_get_ioffidx(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id) 128static inline unsigned int snd_ctl_get_ioffidx(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id)
139{ 129{
140 return id->index - kctl->id.index; 130 return id->index - kctl->id.index;
141} 131}
142 132
143static inline unsigned int snd_ctl_get_ioff(snd_kcontrol_t *kctl, snd_ctl_elem_id_t *id) 133static inline unsigned int snd_ctl_get_ioff(struct snd_kcontrol *kctl, struct snd_ctl_elem_id *id)
144{ 134{
145 if (id->numid) { 135 if (id->numid) {
146 return snd_ctl_get_ioffnum(kctl, id); 136 return snd_ctl_get_ioffnum(kctl, id);
@@ -149,8 +139,8 @@ static inline unsigned int snd_ctl_get_ioff(snd_kcontrol_t *kctl, snd_ctl_elem_i
149 } 139 }
150} 140}
151 141
152static inline snd_ctl_elem_id_t *snd_ctl_build_ioff(snd_ctl_elem_id_t *dst_id, 142static inline struct snd_ctl_elem_id *snd_ctl_build_ioff(struct snd_ctl_elem_id *dst_id,
153 snd_kcontrol_t *src_kctl, 143 struct snd_kcontrol *src_kctl,
154 unsigned int offset) 144 unsigned int offset)
155{ 145{
156 *dst_id = src_kctl->id; 146 *dst_id = src_kctl->id;
diff --git a/include/sound/core.h b/include/sound/core.h
index 2be65ad2fd83..90ac6132ea3b 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -28,13 +28,6 @@
28#include <linux/workqueue.h> /* struct workqueue_struct */ 28#include <linux/workqueue.h> /* struct workqueue_struct */
29#include <linux/pm.h> /* pm_message_t */ 29#include <linux/pm.h> /* pm_message_t */
30 30
31/* Typedef's */
32typedef struct sndrv_interval snd_interval_t;
33typedef enum sndrv_card_type snd_card_type;
34typedef struct sndrv_xferi snd_xferi_t;
35typedef struct sndrv_xfern snd_xfern_t;
36typedef struct sndrv_xferv snd_xferv_t;
37
38/* forward declarations */ 31/* forward declarations */
39#ifdef CONFIG_PCI 32#ifdef CONFIG_PCI
40struct pci_dev; 33struct pci_dev;
@@ -47,76 +40,50 @@ struct sbus_dev;
47 40
48#define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000 41#define SNDRV_DEV_TYPE_RANGE_SIZE 0x1000
49 42
50typedef enum { 43typedef int __bitwise snd_device_type_t;
51 SNDRV_DEV_TOPLEVEL = (0*SNDRV_DEV_TYPE_RANGE_SIZE), 44#define SNDRV_DEV_TOPLEVEL ((__force snd_device_type_t) 0)
52 SNDRV_DEV_CONTROL, 45#define SNDRV_DEV_CONTROL ((__force snd_device_type_t) 1)
53 SNDRV_DEV_LOWLEVEL_PRE, 46#define SNDRV_DEV_LOWLEVEL_PRE ((__force snd_device_type_t) 2)
54 SNDRV_DEV_LOWLEVEL_NORMAL = (1*SNDRV_DEV_TYPE_RANGE_SIZE), 47#define SNDRV_DEV_LOWLEVEL_NORMAL ((__force snd_device_type_t) 0x1000)
55 SNDRV_DEV_PCM, 48#define SNDRV_DEV_PCM ((__force snd_device_type_t) 0x1001)
56 SNDRV_DEV_RAWMIDI, 49#define SNDRV_DEV_RAWMIDI ((__force snd_device_type_t) 0x1002)
57 SNDRV_DEV_TIMER, 50#define SNDRV_DEV_TIMER ((__force snd_device_type_t) 0x1003)
58 SNDRV_DEV_SEQUENCER, 51#define SNDRV_DEV_SEQUENCER ((__force snd_device_type_t) 0x1004)
59 SNDRV_DEV_HWDEP, 52#define SNDRV_DEV_HWDEP ((__force snd_device_type_t) 0x1005)
60 SNDRV_DEV_INFO, 53#define SNDRV_DEV_INFO ((__force snd_device_type_t) 0x1006)
61 SNDRV_DEV_BUS, 54#define SNDRV_DEV_BUS ((__force snd_device_type_t) 0x1007)
62 SNDRV_DEV_CODEC, 55#define SNDRV_DEV_CODEC ((__force snd_device_type_t) 0x1008)
63 SNDRV_DEV_LOWLEVEL = (2*SNDRV_DEV_TYPE_RANGE_SIZE) 56#define SNDRV_DEV_LOWLEVEL ((__force snd_device_type_t) 0x2000)
64} snd_device_type_t; 57
65 58typedef int __bitwise snd_device_state_t;
66typedef enum { 59#define SNDRV_DEV_BUILD ((__force snd_device_state_t) 0)
67 SNDRV_DEV_BUILD, 60#define SNDRV_DEV_REGISTERED ((__force snd_device_state_t) 1)
68 SNDRV_DEV_REGISTERED, 61#define SNDRV_DEV_DISCONNECTED ((__force snd_device_state_t) 2)
69 SNDRV_DEV_DISCONNECTED 62
70} snd_device_state_t; 63typedef int __bitwise snd_device_cmd_t;
71 64#define SNDRV_DEV_CMD_PRE ((__force snd_device_cmd_t) 0)
72typedef enum { 65#define SNDRV_DEV_CMD_NORMAL ((__force snd_device_cmd_t) 1)
73 SNDRV_DEV_CMD_PRE = 0, 66#define SNDRV_DEV_CMD_POST ((__force snd_device_cmd_t) 2)
74 SNDRV_DEV_CMD_NORMAL = 1, 67
75 SNDRV_DEV_CMD_POST = 2 68struct snd_device;
76} snd_device_cmd_t; 69
77 70struct snd_device_ops {
78typedef struct _snd_card snd_card_t; 71 int (*dev_free)(struct snd_device *dev);
79typedef struct _snd_device snd_device_t; 72 int (*dev_register)(struct snd_device *dev);
80 73 int (*dev_disconnect)(struct snd_device *dev);
81typedef int (snd_dev_free_t)(snd_device_t *device); 74 int (*dev_unregister)(struct snd_device *dev);
82typedef int (snd_dev_register_t)(snd_device_t *device); 75};
83typedef int (snd_dev_disconnect_t)(snd_device_t *device); 76
84typedef int (snd_dev_unregister_t)(snd_device_t *device); 77struct snd_device {
85
86typedef struct {
87 snd_dev_free_t *dev_free;
88 snd_dev_register_t *dev_register;
89 snd_dev_disconnect_t *dev_disconnect;
90 snd_dev_unregister_t *dev_unregister;
91} snd_device_ops_t;
92
93struct _snd_device {
94 struct list_head list; /* list of registered devices */ 78 struct list_head list; /* list of registered devices */
95 snd_card_t *card; /* card which holds this device */ 79 struct snd_card *card; /* card which holds this device */
96 snd_device_state_t state; /* state of the device */ 80 snd_device_state_t state; /* state of the device */
97 snd_device_type_t type; /* device type */ 81 snd_device_type_t type; /* device type */
98 void *device_data; /* device structure */ 82 void *device_data; /* device structure */
99 snd_device_ops_t *ops; /* operations */ 83 struct snd_device_ops *ops; /* operations */
100}; 84};
101 85
102#define snd_device(n) list_entry(n, snd_device_t, list) 86#define snd_device(n) list_entry(n, struct snd_device, list)
103
104/* various typedefs */
105
106typedef struct snd_info_entry snd_info_entry_t;
107typedef struct _snd_pcm snd_pcm_t;
108typedef struct _snd_pcm_str snd_pcm_str_t;
109typedef struct _snd_pcm_substream snd_pcm_substream_t;
110typedef struct _snd_mixer snd_kmixer_t;
111typedef struct _snd_rawmidi snd_rawmidi_t;
112typedef struct _snd_ctl_file snd_ctl_file_t;
113typedef struct _snd_kcontrol snd_kcontrol_t;
114typedef struct _snd_timer snd_timer_t;
115typedef struct _snd_timer_instance snd_timer_instance_t;
116typedef struct _snd_hwdep snd_hwdep_t;
117#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
118typedef struct _snd_oss_mixer snd_mixer_oss_t;
119#endif
120 87
121/* monitor files for graceful shutdown (hotplug) */ 88/* monitor files for graceful shutdown (hotplug) */
122 89
@@ -129,7 +96,7 @@ struct snd_shutdown_f_ops; /* define it later in init.c */
129 96
130/* main structure for soundcard */ 97/* main structure for soundcard */
131 98
132struct _snd_card { 99struct snd_card {
133 int number; /* number of soundcard (index to 100 int number; /* number of soundcard (index to
134 snd_cards) */ 101 snd_cards) */
135 102
@@ -143,7 +110,7 @@ struct _snd_card {
143 struct module *module; /* top-level module */ 110 struct module *module; /* top-level module */
144 111
145 void *private_data; /* private data for soundcard */ 112 void *private_data; /* private data for soundcard */
146 void (*private_free) (snd_card_t *card); /* callback for freeing of 113 void (*private_free) (struct snd_card *card); /* callback for freeing of
147 private data */ 114 private data */
148 struct list_head devices; /* devices */ 115 struct list_head devices; /* devices */
149 116
@@ -155,8 +122,8 @@ struct _snd_card {
155 struct list_head controls; /* all controls for this card */ 122 struct list_head controls; /* all controls for this card */
156 struct list_head ctl_files; /* active control files */ 123 struct list_head ctl_files; /* active control files */
157 124
158 snd_info_entry_t *proc_root; /* root for soundcard specific files */ 125 struct snd_info_entry *proc_root; /* root for soundcard specific files */
159 snd_info_entry_t *proc_id; /* the card id */ 126 struct snd_info_entry *proc_id; /* the card id */
160 struct proc_dir_entry *proc_root_link; /* number link to real id */ 127 struct proc_dir_entry *proc_root_link; /* number link to real id */
161 128
162 struct snd_monitor_file *files; /* all files associated to this card */ 129 struct snd_monitor_file *files; /* all files associated to this card */
@@ -167,92 +134,64 @@ struct _snd_card {
167 wait_queue_head_t shutdown_sleep; 134 wait_queue_head_t shutdown_sleep;
168 struct work_struct free_workq; /* for free in workqueue */ 135 struct work_struct free_workq; /* for free in workqueue */
169 struct device *dev; 136 struct device *dev;
170#ifdef CONFIG_SND_GENERIC_DRIVER
171 struct snd_generic_device *generic_dev;
172#endif
173 137
174#ifdef CONFIG_PM 138#ifdef CONFIG_PM
175 int (*pm_suspend)(snd_card_t *card, pm_message_t state);
176 int (*pm_resume)(snd_card_t *card);
177 void *pm_private_data;
178 unsigned int power_state; /* power state */ 139 unsigned int power_state; /* power state */
179 struct semaphore power_lock; /* power lock */ 140 struct semaphore power_lock; /* power lock */
180 wait_queue_head_t power_sleep; 141 wait_queue_head_t power_sleep;
181#endif 142#endif
182 143
183#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 144#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
184 snd_mixer_oss_t *mixer_oss; 145 struct snd_mixer_oss *mixer_oss;
185 int mixer_oss_change_count; 146 int mixer_oss_change_count;
186#endif 147#endif
187}; 148};
188 149
189#ifdef CONFIG_PM 150#ifdef CONFIG_PM
190static inline void snd_power_lock(snd_card_t *card) 151static inline void snd_power_lock(struct snd_card *card)
191{ 152{
192 down(&card->power_lock); 153 down(&card->power_lock);
193} 154}
194 155
195static inline void snd_power_unlock(snd_card_t *card) 156static inline void snd_power_unlock(struct snd_card *card)
196{ 157{
197 up(&card->power_lock); 158 up(&card->power_lock);
198} 159}
199 160
200static inline unsigned int snd_power_get_state(snd_card_t *card) 161static inline unsigned int snd_power_get_state(struct snd_card *card)
201{ 162{
202 return card->power_state; 163 return card->power_state;
203} 164}
204 165
205static inline void snd_power_change_state(snd_card_t *card, unsigned int state) 166static inline void snd_power_change_state(struct snd_card *card, unsigned int state)
206{ 167{
207 card->power_state = state; 168 card->power_state = state;
208 wake_up(&card->power_sleep); 169 wake_up(&card->power_sleep);
209} 170}
210 171
211/* init.c */ 172/* init.c */
212int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file); 173int snd_power_wait(struct snd_card *card, unsigned int power_state, struct file *file);
213
214int snd_card_set_pm_callback(snd_card_t *card,
215 int (*suspend)(snd_card_t *, pm_message_t),
216 int (*resume)(snd_card_t *),
217 void *private_data);
218int snd_card_set_generic_pm_callback(snd_card_t *card,
219 int (*suspend)(snd_card_t *, pm_message_t),
220 int (*resume)(snd_card_t *),
221 void *private_data);
222#define snd_card_set_isa_pm_callback(card,suspend,resume,data) \
223 snd_card_set_generic_pm_callback(card, suspend, resume, data)
224struct pci_dev;
225int snd_card_pci_suspend(struct pci_dev *dev, pm_message_t state);
226int snd_card_pci_resume(struct pci_dev *dev);
227#define SND_PCI_PM_CALLBACKS \
228 .suspend = snd_card_pci_suspend, .resume = snd_card_pci_resume
229 174
230#else /* ! CONFIG_PM */ 175#else /* ! CONFIG_PM */
231 176
232#define snd_power_lock(card) do { (void)(card); } while (0) 177#define snd_power_lock(card) do { (void)(card); } while (0)
233#define snd_power_unlock(card) do { (void)(card); } while (0) 178#define snd_power_unlock(card) do { (void)(card); } while (0)
234static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file *file) { return 0; } 179static inline int snd_power_wait(struct snd_card *card, unsigned int state, struct file *file) { return 0; }
235#define snd_power_get_state(card) SNDRV_CTL_POWER_D0 180#define snd_power_get_state(card) SNDRV_CTL_POWER_D0
236#define snd_power_change_state(card, state) do { (void)(card); } while (0) 181#define snd_power_change_state(card, state) do { (void)(card); } while (0)
237#define snd_card_set_pm_callback(card,suspend,resume,data)
238#define snd_card_set_generic_pm_callback(card,suspend,resume,data)
239#define snd_card_set_isa_pm_callback(card,suspend,resume,data)
240#define SND_PCI_PM_CALLBACKS
241 182
242#endif /* CONFIG_PM */ 183#endif /* CONFIG_PM */
243 184
244struct _snd_minor { 185struct snd_minor {
245 struct list_head list; /* list of all minors per card */ 186 int type; /* SNDRV_DEVICE_TYPE_XXX */
246 int number; /* minor number */ 187 int card; /* card number */
247 int device; /* device number */ 188 int device; /* device number */
248 const char *comment; /* for /proc/asound/devices */
249 struct file_operations *f_ops; /* file operations */ 189 struct file_operations *f_ops; /* file operations */
190 void *private_data; /* private data for f_ops->open */
250 char name[0]; /* device name (keep at the end of 191 char name[0]; /* device name (keep at the end of
251 structure) */ 192 structure) */
252}; 193};
253 194
254typedef struct _snd_minor snd_minor_t;
255
256/* sound.c */ 195/* sound.c */
257 196
258extern int snd_major; 197extern int snd_major;
@@ -260,12 +199,18 @@ extern int snd_ecards_limit;
260 199
261void snd_request_card(int card); 200void snd_request_card(int card);
262 201
263int snd_register_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name); 202int snd_register_device(int type, struct snd_card *card, int dev,
264int snd_unregister_device(int type, snd_card_t *card, int dev); 203 struct file_operations *f_ops, void *private_data,
204 const char *name);
205int snd_unregister_device(int type, struct snd_card *card, int dev);
206void *snd_lookup_minor_data(unsigned int minor, int type);
265 207
266#ifdef CONFIG_SND_OSSEMUL 208#ifdef CONFIG_SND_OSSEMUL
267int snd_register_oss_device(int type, snd_card_t *card, int dev, snd_minor_t *reg, const char *name); 209int snd_register_oss_device(int type, struct snd_card *card, int dev,
268int snd_unregister_oss_device(int type, snd_card_t *card, int dev); 210 struct file_operations *f_ops, void *private_data,
211 const char *name);
212int snd_unregister_oss_device(int type, struct snd_card *card, int dev);
213void *snd_lookup_oss_minor_data(unsigned int minor, int type);
269#endif 214#endif
270 215
271int snd_minor_info_init(void); 216int snd_minor_info_init(void);
@@ -276,11 +221,9 @@ int snd_minor_info_done(void);
276#ifdef CONFIG_SND_OSSEMUL 221#ifdef CONFIG_SND_OSSEMUL
277int snd_minor_info_oss_init(void); 222int snd_minor_info_oss_init(void);
278int snd_minor_info_oss_done(void); 223int snd_minor_info_oss_done(void);
279int snd_oss_init_module(void);
280#else 224#else
281#define snd_minor_info_oss_init() /*NOP*/ 225#define snd_minor_info_oss_init() /*NOP*/
282#define snd_minor_info_oss_done() /*NOP*/ 226#define snd_minor_info_oss_done() /*NOP*/
283#define snd_oss_init_module() 0
284#endif 227#endif
285 228
286/* memory.c */ 229/* memory.c */
@@ -291,43 +234,41 @@ int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size
291/* init.c */ 234/* init.c */
292 235
293extern unsigned int snd_cards_lock; 236extern unsigned int snd_cards_lock;
294extern snd_card_t *snd_cards[SNDRV_CARDS]; 237extern struct snd_card *snd_cards[SNDRV_CARDS];
295extern rwlock_t snd_card_rwlock; 238extern rwlock_t snd_card_rwlock;
296#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 239#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
297#define SND_MIXER_OSS_NOTIFY_REGISTER 0 240#define SND_MIXER_OSS_NOTIFY_REGISTER 0
298#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1 241#define SND_MIXER_OSS_NOTIFY_DISCONNECT 1
299#define SND_MIXER_OSS_NOTIFY_FREE 2 242#define SND_MIXER_OSS_NOTIFY_FREE 2
300extern int (*snd_mixer_oss_notify_callback)(snd_card_t *card, int cmd); 243extern int (*snd_mixer_oss_notify_callback)(struct snd_card *card, int cmd);
301#endif 244#endif
302 245
303snd_card_t *snd_card_new(int idx, const char *id, 246struct snd_card *snd_card_new(int idx, const char *id,
304 struct module *module, int extra_size); 247 struct module *module, int extra_size);
305int snd_card_disconnect(snd_card_t *card); 248int snd_card_disconnect(struct snd_card *card);
306int snd_card_free(snd_card_t *card); 249int snd_card_free(struct snd_card *card);
307int snd_card_free_in_thread(snd_card_t *card); 250int snd_card_free_in_thread(struct snd_card *card);
308int snd_card_register(snd_card_t *card); 251int snd_card_register(struct snd_card *card);
309int snd_card_info_init(void); 252int snd_card_info_init(void);
310int snd_card_info_done(void); 253int snd_card_info_done(void);
311int snd_component_add(snd_card_t *card, const char *component); 254int snd_component_add(struct snd_card *card, const char *component);
312int snd_card_file_add(snd_card_t *card, struct file *file); 255int snd_card_file_add(struct snd_card *card, struct file *file);
313int snd_card_file_remove(snd_card_t *card, struct file *file); 256int snd_card_file_remove(struct snd_card *card, struct file *file);
314 257
315#ifndef snd_card_set_dev 258#ifndef snd_card_set_dev
316#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr)) 259#define snd_card_set_dev(card,devptr) ((card)->dev = (devptr))
317#endif 260#endif
318/* register a generic device (for ISA, etc) */
319int snd_card_set_generic_dev(snd_card_t *card);
320 261
321/* device.c */ 262/* device.c */
322 263
323int snd_device_new(snd_card_t *card, snd_device_type_t type, 264int snd_device_new(struct snd_card *card, snd_device_type_t type,
324 void *device_data, snd_device_ops_t *ops); 265 void *device_data, struct snd_device_ops *ops);
325int snd_device_register(snd_card_t *card, void *device_data); 266int snd_device_register(struct snd_card *card, void *device_data);
326int snd_device_register_all(snd_card_t *card); 267int snd_device_register_all(struct snd_card *card);
327int snd_device_disconnect(snd_card_t *card, void *device_data); 268int snd_device_disconnect(struct snd_card *card, void *device_data);
328int snd_device_disconnect_all(snd_card_t *card); 269int snd_device_disconnect_all(struct snd_card *card);
329int snd_device_free(snd_card_t *card, void *device_data); 270int snd_device_free(struct snd_card *card, void *device_data);
330int snd_device_free_all(snd_card_t *card, snd_device_cmd_t cmd); 271int snd_device_free_all(struct snd_card *card, snd_device_cmd_t cmd);
331 272
332/* isadma.c */ 273/* isadma.c */
333 274
@@ -443,4 +384,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
443#endif 384#endif
444#endif 385#endif
445 386
387#include "typedefs.h"
388
446#endif /* __SOUND_CORE_H */ 389#endif /* __SOUND_CORE_H */
diff --git a/include/sound/cs4231.h b/include/sound/cs4231.h
index d7f90823778a..ac6a5d882088 100644
--- a/include/sound/cs4231.h
+++ b/include/sound/cs4231.h
@@ -26,21 +26,6 @@
26#include "pcm.h" 26#include "pcm.h"
27#include "timer.h" 27#include "timer.h"
28 28
29#ifdef CONFIG_SBUS
30#define SBUS_SUPPORT
31#include <asm/sbus.h>
32#endif
33
34#if defined(CONFIG_PCI) && defined(CONFIG_SPARC64)
35#define EBUS_SUPPORT
36#include <linux/pci.h>
37#include <asm/ebus.h>
38#endif
39
40#if !defined(SBUS_SUPPORT) && !defined(EBUS_SUPPORT)
41#define LEGACY_SUPPORT
42#endif
43
44/* IO ports */ 29/* IO ports */
45 30
46#define CS4231P(x) (c_d_c_CS4231##x) 31#define CS4231P(x) (c_d_c_CS4231##x)
@@ -232,18 +217,14 @@
232#define CS4231_HWSHARE_DMA1 (1<<1) 217#define CS4231_HWSHARE_DMA1 (1<<1)
233#define CS4231_HWSHARE_DMA2 (1<<2) 218#define CS4231_HWSHARE_DMA2 (1<<2)
234 219
235typedef struct _snd_cs4231 cs4231_t; 220struct snd_cs4231 {
236
237struct _snd_cs4231 {
238 unsigned long port; /* base i/o port */ 221 unsigned long port; /* base i/o port */
239#ifdef LEGACY_SUPPORT
240 struct resource *res_port; 222 struct resource *res_port;
241 unsigned long cport; /* control base i/o port (CS4236) */ 223 unsigned long cport; /* control base i/o port (CS4236) */
242 struct resource *res_cport; 224 struct resource *res_cport;
243 int irq; /* IRQ line */ 225 int irq; /* IRQ line */
244 int dma1; /* playback DMA */ 226 int dma1; /* playback DMA */
245 int dma2; /* record DMA */ 227 int dma2; /* record DMA */
246#endif
247 unsigned short version; /* version of CODEC chip */ 228 unsigned short version; /* version of CODEC chip */
248 unsigned short mode; /* see to CS4231_MODE_XXXX */ 229 unsigned short mode; /* see to CS4231_MODE_XXXX */
249 unsigned short hardware; /* see to CS4231_HW_XXXX */ 230 unsigned short hardware; /* see to CS4231_HW_XXXX */
@@ -251,29 +232,11 @@ struct _snd_cs4231 {
251 unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */ 232 unsigned short single_dma:1, /* forced single DMA mode (GUS 16-bit daughter board) or dma1 == dma2 */
252 ebus_flag:1; /* SPARC: EBUS present */ 233 ebus_flag:1; /* SPARC: EBUS present */
253 234
254#ifdef EBUS_SUPPORT 235 struct snd_card *card;
255 struct ebus_dma_info eb2c; 236 struct snd_pcm *pcm;
256 struct ebus_dma_info eb2p; 237 struct snd_pcm_substream *playback_substream;
257#endif 238 struct snd_pcm_substream *capture_substream;
258 239 struct snd_timer *timer;
259#if defined(SBUS_SUPPORT) || defined(EBUS_SUPPORT)
260 union {
261#ifdef SBUS_SUPPORT
262 struct sbus_dev *sdev;
263#endif
264#ifdef EBUS_SUPPORT
265 struct pci_dev *pdev;
266#endif
267 } dev_u;
268 unsigned int p_periods_sent;
269 unsigned int c_periods_sent;
270#endif
271
272 snd_card_t *card;
273 snd_pcm_t *pcm;
274 snd_pcm_substream_t *playback_substream;
275 snd_pcm_substream_t *capture_substream;
276 snd_timer_t *timer;
277 240
278 unsigned char image[32]; /* registers image */ 241 unsigned char image[32]; /* registers image */
279 unsigned char eimage[32]; /* extended registers image */ 242 unsigned char eimage[32]; /* extended registers image */
@@ -281,63 +244,59 @@ struct _snd_cs4231 {
281 int mce_bit; 244 int mce_bit;
282 int calibrate_mute; 245 int calibrate_mute;
283 int sw_3d_bit; 246 int sw_3d_bit;
284#ifdef LEGACY_SUPPORT
285 unsigned int p_dma_size; 247 unsigned int p_dma_size;
286 unsigned int c_dma_size; 248 unsigned int c_dma_size;
287#endif
288 249
289 spinlock_t reg_lock; 250 spinlock_t reg_lock;
290 struct semaphore mce_mutex; 251 struct semaphore mce_mutex;
291 struct semaphore open_mutex; 252 struct semaphore open_mutex;
292 253
293 int (*rate_constraint) (snd_pcm_runtime_t *runtime); 254 int (*rate_constraint) (struct snd_pcm_runtime *runtime);
294 void (*set_playback_format) (cs4231_t *chip, snd_pcm_hw_params_t *hw_params, unsigned char pdfr); 255 void (*set_playback_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char pdfr);
295 void (*set_capture_format) (cs4231_t *chip, snd_pcm_hw_params_t *hw_params, unsigned char cdfr); 256 void (*set_capture_format) (struct snd_cs4231 *chip, struct snd_pcm_hw_params *hw_params, unsigned char cdfr);
296 void (*trigger) (cs4231_t *chip, unsigned int what, int start); 257 void (*trigger) (struct snd_cs4231 *chip, unsigned int what, int start);
297#ifdef CONFIG_PM 258#ifdef CONFIG_PM
298 void (*suspend) (cs4231_t *chip); 259 void (*suspend) (struct snd_cs4231 *chip);
299 void (*resume) (cs4231_t *chip); 260 void (*resume) (struct snd_cs4231 *chip);
300#endif 261#endif
301 void *dma_private_data; 262 void *dma_private_data;
302#ifdef LEGACY_SUPPORT 263 int (*claim_dma) (struct snd_cs4231 *chip, void *dma_private_data, int dma);
303 int (*claim_dma) (cs4231_t *chip, void *dma_private_data, int dma); 264 int (*release_dma) (struct snd_cs4231 *chip, void *dma_private_data, int dma);
304 int (*release_dma) (cs4231_t *chip, void *dma_private_data, int dma);
305#endif
306}; 265};
307 266
308/* exported functions */ 267/* exported functions */
309 268
310void snd_cs4231_out(cs4231_t *chip, unsigned char reg, unsigned char val); 269void snd_cs4231_out(struct snd_cs4231 *chip, unsigned char reg, unsigned char val);
311unsigned char snd_cs4231_in(cs4231_t *chip, unsigned char reg); 270unsigned char snd_cs4231_in(struct snd_cs4231 *chip, unsigned char reg);
312void snd_cs4236_ext_out(cs4231_t *chip, unsigned char reg, unsigned char val); 271void snd_cs4236_ext_out(struct snd_cs4231 *chip, unsigned char reg, unsigned char val);
313unsigned char snd_cs4236_ext_in(cs4231_t *chip, unsigned char reg); 272unsigned char snd_cs4236_ext_in(struct snd_cs4231 *chip, unsigned char reg);
314void snd_cs4231_mce_up(cs4231_t *chip); 273void snd_cs4231_mce_up(struct snd_cs4231 *chip);
315void snd_cs4231_mce_down(cs4231_t *chip); 274void snd_cs4231_mce_down(struct snd_cs4231 *chip);
316 275
317irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs); 276irqreturn_t snd_cs4231_interrupt(int irq, void *dev_id, struct pt_regs *regs);
318 277
319const char *snd_cs4231_chip_id(cs4231_t *chip); 278const char *snd_cs4231_chip_id(struct snd_cs4231 *chip);
320 279
321int snd_cs4231_create(snd_card_t * card, 280int snd_cs4231_create(struct snd_card *card,
322 unsigned long port, 281 unsigned long port,
323 unsigned long cport, 282 unsigned long cport,
324 int irq, int dma1, int dma2, 283 int irq, int dma1, int dma2,
325 unsigned short hardware, 284 unsigned short hardware,
326 unsigned short hwshare, 285 unsigned short hwshare,
327 cs4231_t ** rchip); 286 struct snd_cs4231 ** rchip);
328int snd_cs4231_pcm(cs4231_t * chip, int device, snd_pcm_t **rpcm); 287int snd_cs4231_pcm(struct snd_cs4231 * chip, int device, struct snd_pcm **rpcm);
329int snd_cs4231_timer(cs4231_t * chip, int device, snd_timer_t **rtimer); 288int snd_cs4231_timer(struct snd_cs4231 * chip, int device, struct snd_timer **rtimer);
330int snd_cs4231_mixer(cs4231_t * chip); 289int snd_cs4231_mixer(struct snd_cs4231 * chip);
331 290
332int snd_cs4236_create(snd_card_t * card, 291int snd_cs4236_create(struct snd_card *card,
333 unsigned long port, 292 unsigned long port,
334 unsigned long cport, 293 unsigned long cport,
335 int irq, int dma1, int dma2, 294 int irq, int dma1, int dma2,
336 unsigned short hardware, 295 unsigned short hardware,
337 unsigned short hwshare, 296 unsigned short hwshare,
338 cs4231_t ** rchip); 297 struct snd_cs4231 ** rchip);
339int snd_cs4236_pcm(cs4231_t * chip, int device, snd_pcm_t **rpcm); 298int snd_cs4236_pcm(struct snd_cs4231 * chip, int device, struct snd_pcm **rpcm);
340int snd_cs4236_mixer(cs4231_t * chip); 299int snd_cs4236_mixer(struct snd_cs4231 * chip);
341 300
342/* 301/*
343 * mixer library 302 * mixer library
@@ -349,9 +308,9 @@ int snd_cs4236_mixer(cs4231_t * chip);
349 .get = snd_cs4231_get_single, .put = snd_cs4231_put_single, \ 308 .get = snd_cs4231_get_single, .put = snd_cs4231_put_single, \
350 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) } 309 .private_value = reg | (shift << 8) | (mask << 16) | (invert << 24) }
351 310
352int snd_cs4231_info_single(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); 311int snd_cs4231_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
353int snd_cs4231_get_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 312int snd_cs4231_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
354int snd_cs4231_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 313int snd_cs4231_put_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
355 314
356#define CS4231_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \ 315#define CS4231_DOUBLE(xname, xindex, left_reg, right_reg, shift_left, shift_right, mask, invert) \
357{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \ 316{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, .index = xindex, \
@@ -359,8 +318,8 @@ int snd_cs4231_put_single(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucon
359 .get = snd_cs4231_get_double, .put = snd_cs4231_put_double, \ 318 .get = snd_cs4231_get_double, .put = snd_cs4231_put_double, \
360 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) } 319 .private_value = left_reg | (right_reg << 8) | (shift_left << 16) | (shift_right << 19) | (mask << 24) | (invert << 22) }
361 320
362int snd_cs4231_info_double(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * uinfo); 321int snd_cs4231_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo);
363int snd_cs4231_get_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 322int snd_cs4231_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
364int snd_cs4231_put_double(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t * ucontrol); 323int snd_cs4231_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol);
365 324
366#endif /* __SOUND_CS4231_H */ 325#endif /* __SOUND_CS4231_H */
diff --git a/include/sound/cs46xx.h b/include/sound/cs46xx.h
index b0c0e192eb56..199b5098ff7e 100644
--- a/include/sound/cs46xx.h
+++ b/include/sound/cs46xx.h
@@ -1631,42 +1631,41 @@
1631#define CS46XX_MIXER_SPDIF_INPUT_ELEMENT 1 1631#define CS46XX_MIXER_SPDIF_INPUT_ELEMENT 1
1632#define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT 2 1632#define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT 2
1633 1633
1634typedef struct _snd_cs46xx cs46xx_t;
1635 1634
1636typedef struct _snd_cs46xx_pcm_t { 1635struct snd_cs46xx_pcm {
1637 struct snd_dma_buffer hw_buf; 1636 struct snd_dma_buffer hw_buf;
1638 1637
1639 unsigned int ctl; 1638 unsigned int ctl;
1640 unsigned int shift; /* Shift count to trasform frames in bytes */ 1639 unsigned int shift; /* Shift count to trasform frames in bytes */
1641 snd_pcm_indirect_t pcm_rec; 1640 struct snd_pcm_indirect pcm_rec;
1642 snd_pcm_substream_t *substream; 1641 struct snd_pcm_substream *substream;
1643 1642
1644 pcm_channel_descriptor_t * pcm_channel; 1643 struct dsp_pcm_channel_descriptor * pcm_channel;
1645 1644
1646 int pcm_channel_id; /* Fron Rear, Center Lfe ... */ 1645 int pcm_channel_id; /* Fron Rear, Center Lfe ... */
1647} cs46xx_pcm_t; 1646};
1648 1647
1649typedef struct { 1648struct snd_cs46xx_region {
1650 char name[24]; 1649 char name[24];
1651 unsigned long base; 1650 unsigned long base;
1652 void __iomem *remap_addr; 1651 void __iomem *remap_addr;
1653 unsigned long size; 1652 unsigned long size;
1654 struct resource *resource; 1653 struct resource *resource;
1655} snd_cs46xx_region_t; 1654};
1656 1655
1657struct _snd_cs46xx { 1656struct snd_cs46xx {
1658 int irq; 1657 int irq;
1659 unsigned long ba0_addr; 1658 unsigned long ba0_addr;
1660 unsigned long ba1_addr; 1659 unsigned long ba1_addr;
1661 union { 1660 union {
1662 struct { 1661 struct {
1663 snd_cs46xx_region_t ba0; 1662 struct snd_cs46xx_region ba0;
1664 snd_cs46xx_region_t data0; 1663 struct snd_cs46xx_region data0;
1665 snd_cs46xx_region_t data1; 1664 struct snd_cs46xx_region data1;
1666 snd_cs46xx_region_t pmem; 1665 struct snd_cs46xx_region pmem;
1667 snd_cs46xx_region_t reg; 1666 struct snd_cs46xx_region reg;
1668 } name; 1667 } name;
1669 snd_cs46xx_region_t idx[5]; 1668 struct snd_cs46xx_region idx[5];
1670 } region; 1669 } region;
1671 1670
1672 unsigned int mode; 1671 unsigned int mode;
@@ -1676,34 +1675,34 @@ struct _snd_cs46xx {
1676 1675
1677 unsigned int ctl; 1676 unsigned int ctl;
1678 unsigned int shift; /* Shift count to trasform frames in bytes */ 1677 unsigned int shift; /* Shift count to trasform frames in bytes */
1679 snd_pcm_indirect_t pcm_rec; 1678 struct snd_pcm_indirect pcm_rec;
1680 snd_pcm_substream_t *substream; 1679 struct snd_pcm_substream *substream;
1681 } capt; 1680 } capt;
1682 1681
1683 1682
1684 int nr_ac97_codecs; 1683 int nr_ac97_codecs;
1685 ac97_bus_t *ac97_bus; 1684 struct snd_ac97_bus *ac97_bus;
1686 ac97_t *ac97[MAX_NR_AC97]; 1685 struct snd_ac97 *ac97[MAX_NR_AC97];
1687 1686
1688 struct pci_dev *pci; 1687 struct pci_dev *pci;
1689 snd_card_t *card; 1688 struct snd_card *card;
1690 snd_pcm_t *pcm; 1689 struct snd_pcm *pcm;
1691 1690
1692 snd_rawmidi_t *rmidi; 1691 struct snd_rawmidi *rmidi;
1693 snd_rawmidi_substream_t *midi_input; 1692 struct snd_rawmidi_substream *midi_input;
1694 snd_rawmidi_substream_t *midi_output; 1693 struct snd_rawmidi_substream *midi_output;
1695 1694
1696 spinlock_t reg_lock; 1695 spinlock_t reg_lock;
1697 unsigned int midcr; 1696 unsigned int midcr;
1698 unsigned int uartm; 1697 unsigned int uartm;
1699 1698
1700 int amplifier; 1699 int amplifier;
1701 void (*amplifier_ctrl)(cs46xx_t *, int); 1700 void (*amplifier_ctrl)(struct snd_cs46xx *, int);
1702 void (*active_ctrl)(cs46xx_t *, int); 1701 void (*active_ctrl)(struct snd_cs46xx *, int);
1703 void (*mixer_init)(cs46xx_t *); 1702 void (*mixer_init)(struct snd_cs46xx *);
1704 1703
1705 int acpi_port; 1704 int acpi_port;
1706 snd_kcontrol_t *eapd_switch; /* for amplifier hack */ 1705 struct snd_kcontrol *eapd_switch; /* for amplifier hack */
1707 int accept_valid; /* accept mmap valid (for OSS) */ 1706 int accept_valid; /* accept mmap valid (for OSS) */
1708 1707
1709 struct gameport *gameport; 1708 struct gameport *gameport;
@@ -1714,29 +1713,31 @@ struct _snd_cs46xx {
1714#ifdef CONFIG_SND_CS46XX_NEW_DSP 1713#ifdef CONFIG_SND_CS46XX_NEW_DSP
1715 struct semaphore spos_mutex; 1714 struct semaphore spos_mutex;
1716 1715
1717 dsp_spos_instance_t * dsp_spos_instance; 1716 struct dsp_spos_instance * dsp_spos_instance;
1718 1717
1719 snd_pcm_t *pcm_rear; 1718 struct snd_pcm *pcm_rear;
1720 snd_pcm_t *pcm_center_lfe; 1719 struct snd_pcm *pcm_center_lfe;
1721 snd_pcm_t *pcm_iec958; 1720 struct snd_pcm *pcm_iec958;
1722#else /* for compatibility */ 1721#else /* for compatibility */
1723 cs46xx_pcm_t *playback_pcm; 1722 struct snd_cs46xx_pcm *playback_pcm;
1724 unsigned int play_ctl; 1723 unsigned int play_ctl;
1725#endif 1724#endif
1726}; 1725};
1727 1726
1728int snd_cs46xx_create(snd_card_t *card, 1727int snd_cs46xx_create(struct snd_card *card,
1729 struct pci_dev *pci, 1728 struct pci_dev *pci,
1730 int external_amp, int thinkpad, 1729 int external_amp, int thinkpad,
1731 cs46xx_t **rcodec); 1730 struct snd_cs46xx **rcodec);
1732 1731int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state);
1733int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1732int snd_cs46xx_resume(struct pci_dev *pci);
1734int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1733
1735int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1734int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
1736int snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1735int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
1737int snd_cs46xx_mixer(cs46xx_t *chip, int spdif_device); 1736int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
1738int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi); 1737int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm);
1739int snd_cs46xx_start_dsp(cs46xx_t *chip); 1738int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device);
1740int snd_cs46xx_gameport(cs46xx_t *chip); 1739int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rmidi);
1740int snd_cs46xx_start_dsp(struct snd_cs46xx *chip);
1741int snd_cs46xx_gameport(struct snd_cs46xx *chip);
1741 1742
1742#endif /* __SOUND_CS46XX_H */ 1743#endif /* __SOUND_CS46XX_H */
diff --git a/include/sound/cs46xx_dsp_scb_types.h b/include/sound/cs46xx_dsp_scb_types.h
index 3f990a3a6903..9cb6c7d09567 100644
--- a/include/sound/cs46xx_dsp_scb_types.h
+++ b/include/sound/cs46xx_dsp_scb_types.h
@@ -41,7 +41,7 @@
41 41
42/* This structs are used internally by the SP */ 42/* This structs are used internally by the SP */
43 43
44typedef struct _basic_dma_req_t { 44struct dsp_basic_dma_req {
45 /* DMA Requestor Word 0 (DCW) fields: 45 /* DMA Requestor Word 0 (DCW) fields:
46 46
47 31 [30-28]27 [26:24] 23 22 21 20 [19:18] [17:16] 15 14 13 12 11 10 9 8 7 6 [5:0] 47 31 [30-28]27 [26:24] 23 22 21 20 [19:18] [17:16] 15 14 13 12 11 10 9 8 7 6 [5:0]
@@ -53,9 +53,9 @@ typedef struct _basic_dma_req_t {
53 u32 dmw; /* DMA Mode Word */ 53 u32 dmw; /* DMA Mode Word */
54 u32 saw; /* Source Address Word */ 54 u32 saw; /* Source Address Word */
55 u32 daw; /* Destination Address Word */ 55 u32 daw; /* Destination Address Word */
56} basic_dma_req_t; 56};
57 57
58typedef struct _scatter_gather_ext_t { 58struct dsp_scatter_gather_ext {
59 u32 npaw; /* Next-Page Address Word */ 59 u32 npaw; /* Next-Page Address Word */
60 60
61 /* DMA Requestor Word 5 (NPCW) fields: 61 /* DMA Requestor Word 5 (NPCW) fields:
@@ -69,9 +69,9 @@ typedef struct _scatter_gather_ext_t {
69 u32 lbaw; /* Loop-Begin Address Word */ 69 u32 lbaw; /* Loop-Begin Address Word */
70 u32 nplbaw; /* Next-Page after Loop-Begin Address Word */ 70 u32 nplbaw; /* Next-Page after Loop-Begin Address Word */
71 u32 sgaw; /* Scatter/Gather Address Word */ 71 u32 sgaw; /* Scatter/Gather Address Word */
72} scatter_gather_ext_t; 72};
73 73
74typedef struct _volume_control_t { 74struct dsp_volume_control {
75 ___DSP_DUAL_16BIT_ALLOC( 75 ___DSP_DUAL_16BIT_ALLOC(
76 rightTarg, /* Target volume for left & right channels */ 76 rightTarg, /* Target volume for left & right channels */
77 leftTarg 77 leftTarg
@@ -80,10 +80,10 @@ typedef struct _volume_control_t {
80 rightVol, /* Current left & right channel volumes */ 80 rightVol, /* Current left & right channel volumes */
81 leftVol 81 leftVol
82 ) 82 )
83} volume_control_t; 83};
84 84
85/* Generic stream control block (SCB) structure definition */ 85/* Generic stream control block (SCB) structure definition */
86typedef struct _generic_scb_t { 86struct dsp_generic_scb {
87 /* For streaming I/O, the DSP should never alter any words in the DMA 87 /* For streaming I/O, the DSP should never alter any words in the DMA
88 requestor or the scatter/gather extension. Only ad hoc DMA request 88 requestor or the scatter/gather extension. Only ad hoc DMA request
89 streams are free to alter the requestor (currently only occur in the 89 streams are free to alter the requestor (currently only occur in the
@@ -99,13 +99,13 @@ typedef struct _generic_scb_t {
99 99
100 /* Initialized by the host, only modified by DMA 100 /* Initialized by the host, only modified by DMA
101 R/O for the DSP task */ 101 R/O for the DSP task */
102 basic_dma_req_t basic_req; /* Optional */ 102 struct dsp_basic_dma_req basic_req; /* Optional */
103 103
104 /* Scatter/gather DMA requestor extension (5 ints) 104 /* Scatter/gather DMA requestor extension (5 ints)
105 Initialized by the host, only modified by DMA 105 Initialized by the host, only modified by DMA
106 DSP task never needs to even read these. 106 DSP task never needs to even read these.
107 */ 107 */
108 scatter_gather_ext_t sg_ext; /* Optional */ 108 struct dsp_scatter_gather_ext sg_ext; /* Optional */
109 109
110 /* Sublist pointer & next stream control block (SCB) link. 110 /* Sublist pointer & next stream control block (SCB) link.
111 Initialized & modified by the host R/O for the DSP task 111 Initialized & modified by the host R/O for the DSP task
@@ -179,11 +179,11 @@ typedef struct _generic_scb_t {
179 179
180 These two 32-bit words are redefined for wavetable & 3-D voices. 180 These two 32-bit words are redefined for wavetable & 3-D voices.
181 */ 181 */
182 volume_control_t vol_ctrl_t; /* Optional */ 182 struct dsp_volume_control vol_ctrl_t; /* Optional */
183} generic_scb_t; 183};
184 184
185 185
186typedef struct _spos_control_block_t { 186struct dsp_spos_control_block {
187 /* WARNING: Certain items in this structure are modified by the host 187 /* WARNING: Certain items in this structure are modified by the host
188 Any dword that can be modified by the host, must not be 188 Any dword that can be modified by the host, must not be
189 modified by the SP as the host can only do atomic dword 189 modified by the SP as the host can only do atomic dword
@@ -273,10 +273,10 @@ typedef struct _spos_control_block_t {
273 u32 r32_save_for_spurious_int; 273 u32 r32_save_for_spurious_int;
274 u32 r32_save_for_trap; 274 u32 r32_save_for_trap;
275 u32 r32_save_for_HFG; 275 u32 r32_save_for_HFG;
276} spos_control_block_t; 276};
277 277
278/* SPB for MIX_TO_OSTREAM algorithm family */ 278/* SPB for MIX_TO_OSTREAM algorithm family */
279typedef struct _mix2_ostream_spb_t 279struct dsp_mix2_ostream_spb
280{ 280{
281 /* 16b.16b integer.frac approximation to the 281 /* 16b.16b integer.frac approximation to the
282 number of 3 sample triplets to output each 282 number of 3 sample triplets to output each
@@ -290,13 +290,13 @@ typedef struct _mix2_ostream_spb_t
290 output triplets since the start of group 290 output triplets since the start of group
291 */ 291 */
292 u32 accumOutTriplets; 292 u32 accumOutTriplets;
293} mix2_ostream_spb_t; 293};
294 294
295/* SCB for Timing master algorithm */ 295/* SCB for Timing master algorithm */
296typedef struct _timing_master_scb_t { 296struct dsp_timing_master_scb {
297 /* First 12 dwords from generic_scb_t */ 297 /* First 12 dwords from generic_scb_t */
298 basic_dma_req_t basic_req; /* Optional */ 298 struct dsp_basic_dma_req basic_req; /* Optional */
299 scatter_gather_ext_t sg_ext; /* Optional */ 299 struct dsp_scatter_gather_ext sg_ext; /* Optional */
300 ___DSP_DUAL_16BIT_ALLOC( 300 ___DSP_DUAL_16BIT_ALLOC(
301 next_scb, /* REQUIRED */ 301 next_scb, /* REQUIRED */
302 sub_list_ptr /* REQUIRED */ 302 sub_list_ptr /* REQUIRED */
@@ -358,13 +358,13 @@ typedef struct _timing_master_scb_t {
358 number of samples to output each frame. 358 number of samples to output each frame.
359 (approximation must be floor, to insure */ 359 (approximation must be floor, to insure */
360 u32 nsamp_per_frm_q15; 360 u32 nsamp_per_frm_q15;
361} timing_master_scb_t; 361};
362 362
363/* SCB for CODEC output algorithm */ 363/* SCB for CODEC output algorithm */
364typedef struct _codec_output_scb_t { 364struct dsp_codec_output_scb {
365 /* First 13 dwords from generic_scb_t */ 365 /* First 13 dwords from generic_scb_t */
366 basic_dma_req_t basic_req; /* Optional */ 366 struct dsp_basic_dma_req basic_req; /* Optional */
367 scatter_gather_ext_t sg_ext; /* Optional */ 367 struct dsp_scatter_gather_ext sg_ext; /* Optional */
368 ___DSP_DUAL_16BIT_ALLOC( 368 ___DSP_DUAL_16BIT_ALLOC(
369 next_scb, /* REQUIRED */ 369 next_scb, /* REQUIRED */
370 sub_list_ptr /* REQUIRED */ 370 sub_list_ptr /* REQUIRED */
@@ -422,13 +422,13 @@ typedef struct _codec_output_scb_t {
422 reserved, 422 reserved,
423 last_sub_ptr 423 last_sub_ptr
424 ) 424 )
425} codec_output_scb_t; 425};
426 426
427/* SCB for CODEC input algorithm */ 427/* SCB for CODEC input algorithm */
428typedef struct _codec_input_scb_t { 428struct dsp_codec_input_scb {
429 /* First 13 dwords from generic_scb_t */ 429 /* First 13 dwords from generic_scb_t */
430 basic_dma_req_t basic_req; /* Optional */ 430 struct dsp_basic_dma_req basic_req; /* Optional */
431 scatter_gather_ext_t sg_ext; /* Optional */ 431 struct dsp_scatter_gather_ext sg_ext; /* Optional */
432 ___DSP_DUAL_16BIT_ALLOC( 432 ___DSP_DUAL_16BIT_ALLOC(
433 next_scb, /* REQUIRED */ 433 next_scb, /* REQUIRED */
434 sub_list_ptr /* REQUIRED */ 434 sub_list_ptr /* REQUIRED */
@@ -479,13 +479,13 @@ typedef struct _codec_input_scb_t {
479 ) 479 )
480 480
481 u32 reserved2; 481 u32 reserved2;
482} codec_input_scb_t; 482};
483 483
484 484
485typedef struct _pcm_serial_input_scb_t { 485struct dsp_pcm_serial_input_scb {
486 /* First 13 dwords from generic_scb_t */ 486 /* First 13 dwords from generic_scb_t */
487 basic_dma_req_t basic_req; /* Optional */ 487 struct dsp_basic_dma_req basic_req; /* Optional */
488 scatter_gather_ext_t sg_ext; /* Optional */ 488 struct dsp_scatter_gather_ext sg_ext; /* Optional */
489 ___DSP_DUAL_16BIT_ALLOC( 489 ___DSP_DUAL_16BIT_ALLOC(
490 next_scb, /* REQUIRED */ 490 next_scb, /* REQUIRED */
491 sub_list_ptr /* REQUIRED */ 491 sub_list_ptr /* REQUIRED */
@@ -512,11 +512,11 @@ typedef struct _pcm_serial_input_scb_t {
512 ) 512 )
513 513
514 /* Initialized by the host (host updates target volumes) */ 514 /* Initialized by the host (host updates target volumes) */
515 volume_control_t psi_vol_ctrl; 515 struct dsp_volume_control psi_vol_ctrl;
516 516
517} pcm_serial_input_scb_t; 517};
518 518
519typedef struct _src_task_scb_t { 519struct dsp_src_task_scb {
520 ___DSP_DUAL_16BIT_ALLOC( 520 ___DSP_DUAL_16BIT_ALLOC(
521 frames_left_in_gof, 521 frames_left_in_gof,
522 gofs_left_in_sec 522 gofs_left_in_sec
@@ -571,10 +571,10 @@ typedef struct _src_task_scb_t {
571 571
572 u32 phiIncr6int_26frac; 572 u32 phiIncr6int_26frac;
573 573
574 volume_control_t src_vol_ctrl; 574 struct dsp_volume_control src_vol_ctrl;
575} src_task_scb_t; 575};
576 576
577typedef struct _decimate_by_pow2_scb_t { 577struct dsp_decimate_by_pow2_scb {
578 /* decimationFactor = 2, 4, or 8 (larger factors waste too much memory 578 /* decimationFactor = 2, 4, or 8 (larger factors waste too much memory
579 when compared to cascading decimators) 579 when compared to cascading decimators)
580 */ 580 */
@@ -648,10 +648,10 @@ typedef struct _decimate_by_pow2_scb_t {
648 648
649 u32 dec2_reserved4; 649 u32 dec2_reserved4;
650 650
651 volume_control_t dec2_vol_ctrl; /* Not used! */ 651 struct dsp_volume_control dec2_vol_ctrl; /* Not used! */
652} decimate_by_pow2_scb_t; 652};
653 653
654typedef struct _vari_decimate_scb_t { 654struct dsp_vari_decimate_scb {
655 ___DSP_DUAL_16BIT_ALLOC( 655 ___DSP_DUAL_16BIT_ALLOC(
656 vdec_frames_left_in_gof, 656 vdec_frames_left_in_gof,
657 vdec_gofs_left_in_sec 657 vdec_gofs_left_in_sec
@@ -711,15 +711,15 @@ typedef struct _vari_decimate_scb_t {
711 711
712 u32 vdec_phi_incr_6int_26frac; 712 u32 vdec_phi_incr_6int_26frac;
713 713
714 volume_control_t vdec_vol_ctrl; 714 struct dsp_volume_control vdec_vol_ctrl;
715} vari_decimate_scb_t; 715};
716 716
717 717
718/* SCB for MIX_TO_OSTREAM algorithm family */ 718/* SCB for MIX_TO_OSTREAM algorithm family */
719typedef struct _mix2_ostream_scb_t { 719struct dsp_mix2_ostream_scb {
720 /* First 13 dwords from generic_scb_t */ 720 /* First 13 dwords from generic_scb_t */
721 basic_dma_req_t basic_req; /* Optional */ 721 struct dsp_basic_dma_req basic_req; /* Optional */
722 scatter_gather_ext_t sg_ext; /* Optional */ 722 struct dsp_scatter_gather_ext sg_ext; /* Optional */
723 ___DSP_DUAL_16BIT_ALLOC( 723 ___DSP_DUAL_16BIT_ALLOC(
724 next_scb, /* REQUIRED */ 724 next_scb, /* REQUIRED */
725 sub_list_ptr /* REQUIRED */ 725 sub_list_ptr /* REQUIRED */
@@ -758,14 +758,14 @@ typedef struct _mix2_ostream_scb_t {
758 const_FFFF, 758 const_FFFF,
759 const_zero 759 const_zero
760 ) 760 )
761} mix2_ostream_scb_t; 761};
762 762
763 763
764/* SCB for S16_MIX algorithm */ 764/* SCB for S16_MIX algorithm */
765typedef struct _mix_only_scb_t { 765struct dsp_mix_only_scb {
766 /* First 13 dwords from generic_scb_t */ 766 /* First 13 dwords from generic_scb_t */
767 basic_dma_req_t basic_req; /* Optional */ 767 struct dsp_basic_dma_req basic_req; /* Optional */
768 scatter_gather_ext_t sg_ext; /* Optional */ 768 struct dsp_scatter_gather_ext sg_ext; /* Optional */
769 ___DSP_DUAL_16BIT_ALLOC( 769 ___DSP_DUAL_16BIT_ALLOC(
770 next_scb, /* REQUIRED */ 770 next_scb, /* REQUIRED */
771 sub_list_ptr /* REQUIRED */ 771 sub_list_ptr /* REQUIRED */
@@ -780,11 +780,11 @@ typedef struct _mix_only_scb_t {
780 u32 strm_buf_ptr; /* REQUIRED */ 780 u32 strm_buf_ptr; /* REQUIRED */
781 781
782 u32 reserved; 782 u32 reserved;
783 volume_control_t vol_ctrl; 783 struct dsp_volume_control vol_ctrl;
784} mix_only_scb_t; 784};
785 785
786/* SCB for the async. CODEC input algorithm */ 786/* SCB for the async. CODEC input algorithm */
787typedef struct _async_codec_input_scb_t { 787struct dsp_async_codec_input_scb {
788 u32 io_free2; 788 u32 io_free2;
789 789
790 u32 io_current_total; 790 u32 io_current_total;
@@ -837,11 +837,11 @@ typedef struct _async_codec_input_scb_t {
837 ) 837 )
838 838
839 u32 i_free; 839 u32 i_free;
840} async_codec_input_scb_t; 840};
841 841
842 842
843/* SCB for the SP/DIF CODEC input and output */ 843/* SCB for the SP/DIF CODEC input and output */
844typedef struct _spdifiscb_t { 844struct dsp_spdifiscb {
845 ___DSP_DUAL_16BIT_ALLOC( 845 ___DSP_DUAL_16BIT_ALLOC(
846 status_ptr, 846 status_ptr,
847 status_start_ptr 847 status_start_ptr
@@ -895,12 +895,11 @@ typedef struct _spdifiscb_t {
895 ) 895 )
896 896
897 u32 free1; 897 u32 free1;
898} spdifiscb_t; 898};
899 899
900 900
901/* SCB for the SP/DIF CODEC input and output */ 901/* SCB for the SP/DIF CODEC input and output */
902typedef struct _spdifoscb_t { 902struct dsp_spdifoscb {
903
904 903
905 u32 free2; 904 u32 free2;
906 905
@@ -941,11 +940,10 @@ typedef struct _spdifoscb_t {
941 ) 940 )
942 941
943 u32 free1; 942 u32 free1;
944} spdifoscb_t; 943};
945
946 944
947 945
948typedef struct _asynch_fg_rx_scb_t { 946struct dsp_asynch_fg_rx_scb {
949 ___DSP_DUAL_16BIT_ALLOC( 947 ___DSP_DUAL_16BIT_ALLOC(
950 bot_buf_mask, 948 bot_buf_mask,
951 buf_Mask 949 buf_Mask
@@ -993,11 +991,10 @@ typedef struct _asynch_fg_rx_scb_t {
993 right_vol, 991 right_vol,
994 left_vol 992 left_vol
995 ) 993 )
996} asynch_fg_rx_scb_t; 994};
997
998 995
999 996
1000typedef struct _asynch_fg_tx_scb_t { 997struct dsp_asynch_fg_tx_scb {
1001 ___DSP_DUAL_16BIT_ALLOC( 998 ___DSP_DUAL_16BIT_ALLOC(
1002 not_buf_mask, 999 not_buf_mask,
1003 buf_mask 1000 buf_mask
@@ -1052,13 +1049,13 @@ typedef struct _asynch_fg_tx_scb_t {
1052 unused_right_vol, 1049 unused_right_vol,
1053 unused_left_vol 1050 unused_left_vol
1054 ) 1051 )
1055} asynch_fg_tx_scb_t; 1052};
1056 1053
1057 1054
1058typedef struct _output_snoop_scb_t { 1055struct dsp_output_snoop_scb {
1059 /* First 13 dwords from generic_scb_t */ 1056 /* First 13 dwords from generic_scb_t */
1060 basic_dma_req_t basic_req; /* Optional */ 1057 struct dsp_basic_dma_req basic_req; /* Optional */
1061 scatter_gather_ext_t sg_ext; /* Optional */ 1058 struct dsp_scatter_gather_ext sg_ext; /* Optional */
1062 ___DSP_DUAL_16BIT_ALLOC( 1059 ___DSP_DUAL_16BIT_ALLOC(
1063 next_scb, /* REQUIRED */ 1060 next_scb, /* REQUIRED */
1064 sub_list_ptr /* REQUIRED */ 1061 sub_list_ptr /* REQUIRED */
@@ -1083,9 +1080,9 @@ typedef struct _output_snoop_scb_t {
1083 reserved, 1080 reserved,
1084 input_scb 1081 input_scb
1085 ) 1082 )
1086} output_snoop_scb_t; 1083};
1087 1084
1088typedef struct _spio_write_scb_t { 1085struct dsp_spio_write_scb {
1089 ___DSP_DUAL_16BIT_ALLOC( 1086 ___DSP_DUAL_16BIT_ALLOC(
1090 address1, 1087 address1,
1091 address2 1088 address2
@@ -1122,9 +1119,9 @@ typedef struct _spio_write_scb_t {
1122 ) 1119 )
1123 1120
1124 u32 unused3[5]; 1121 u32 unused3[5];
1125} spio_write_scb_t; 1122};
1126 1123
1127typedef struct _magic_snoop_task_t { 1124struct dsp_magic_snoop_task {
1128 u32 i0; 1125 u32 i0;
1129 u32 i1; 1126 u32 i1;
1130 1127
@@ -1155,11 +1152,11 @@ typedef struct _magic_snoop_task_t {
1155 1152
1156 u32 i8; 1153 u32 i8;
1157 1154
1158 volume_control_t vdec_vol_ctrl; 1155 struct dsp_volume_control vdec_vol_ctrl;
1159} magic_snoop_task_t; 1156};
1160 1157
1161 1158
1162typedef struct _filter_scb_t { 1159struct dsp_filter_scb {
1163 ___DSP_DUAL_16BIT_ALLOC( 1160 ___DSP_DUAL_16BIT_ALLOC(
1164 a0_right, /* 0x00 */ 1161 a0_right, /* 0x00 */
1165 a0_left 1162 a0_left
@@ -1212,5 +1209,5 @@ typedef struct _filter_scb_t {
1212 b2_right, /* 0x0F */ 1209 b2_right, /* 0x0F */
1213 b2_left 1210 b2_left
1214 ) 1211 )
1215} filter_scb_t; 1212};
1216#endif /* __DSP_SCB_TYPES_H__ */ 1213#endif /* __DSP_SCB_TYPES_H__ */
diff --git a/include/sound/cs46xx_dsp_spos.h b/include/sound/cs46xx_dsp_spos.h
index 10014cb62423..da934def31e9 100644
--- a/include/sound/cs46xx_dsp_spos.h
+++ b/include/sound/cs46xx_dsp_spos.h
@@ -65,133 +65,130 @@
65#define DSP_SPDIF_STATUS_HW_ENABLED 4 65#define DSP_SPDIF_STATUS_HW_ENABLED 4
66#define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8 66#define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8
67 67
68struct _dsp_module_desc_t; 68struct dsp_symbol_entry {
69
70typedef struct _symbol_entry_t {
71 u32 address; 69 u32 address;
72 char symbol_name[DSP_MAX_SYMBOL_NAME]; 70 char symbol_name[DSP_MAX_SYMBOL_NAME];
73 int symbol_type; 71 int symbol_type;
74 72
75 /* initialized by driver */ 73 /* initialized by driver */
76 struct _dsp_module_desc_t * module; 74 struct dsp_module_desc * module;
77 int deleted; 75 int deleted;
78} symbol_entry_t; 76};
79 77
80typedef struct _symbol_desc_t { 78struct dsp_symbol_desc {
81 int nsymbols; 79 int nsymbols;
82 80
83 symbol_entry_t * symbols; 81 struct dsp_symbol_entry *symbols;
84 82
85 /* initialized by driver */ 83 /* initialized by driver */
86 int highest_frag_index; 84 int highest_frag_index;
87} symbol_desc_t; 85};
88
89 86
90typedef struct _segment_desc_t { 87struct dsp_segment_desc {
91 int segment_type; 88 int segment_type;
92 u32 offset; 89 u32 offset;
93 u32 size; 90 u32 size;
94 u32 * data; 91 u32 * data;
95} segment_desc_t; 92};
96 93
97typedef struct _dsp_module_desc_t { 94struct dsp_module_desc {
98 char * module_name; 95 char * module_name;
99 symbol_desc_t symbol_table; 96 struct dsp_symbol_desc symbol_table;
100 int nsegments; 97 int nsegments;
101 segment_desc_t * segments; 98 struct dsp_segment_desc * segments;
102 99
103 /* initialized by driver */ 100 /* initialized by driver */
104 u32 overlay_begin_address; 101 u32 overlay_begin_address;
105 u32 load_address; 102 u32 load_address;
106 int nfixups; 103 int nfixups;
107} dsp_module_desc_t; 104};
108 105
109typedef struct _dsp_scb_descriptor_t { 106struct dsp_scb_descriptor {
110 char scb_name[DSP_MAX_SCB_NAME]; 107 char scb_name[DSP_MAX_SCB_NAME];
111 u32 address; 108 u32 address;
112 int index; 109 int index;
113 110
114 struct _dsp_scb_descriptor_t * sub_list_ptr; 111 struct dsp_scb_descriptor * sub_list_ptr;
115 struct _dsp_scb_descriptor_t * next_scb_ptr; 112 struct dsp_scb_descriptor * next_scb_ptr;
116 struct _dsp_scb_descriptor_t * parent_scb_ptr; 113 struct dsp_scb_descriptor * parent_scb_ptr;
117 114
118 symbol_entry_t * task_entry; 115 struct dsp_symbol_entry * task_entry;
119 symbol_entry_t * scb_symbol; 116 struct dsp_symbol_entry * scb_symbol;
120 117
121 snd_info_entry_t *proc_info; 118 struct snd_info_entry *proc_info;
122 int ref_count; 119 int ref_count;
123 spinlock_t lock; 120 spinlock_t lock;
124 121
125 int deleted; 122 int deleted;
126} dsp_scb_descriptor_t; 123};
127 124
128typedef struct _dsp_task_descriptor_t { 125struct dsp_task_descriptor {
129 char task_name[DSP_MAX_TASK_NAME]; 126 char task_name[DSP_MAX_TASK_NAME];
130 int size; 127 int size;
131 u32 address; 128 u32 address;
132 int index; 129 int index;
133} dsp_task_descriptor_t; 130};
134 131
135typedef struct _pcm_channel_descriptor_t { 132struct dsp_pcm_channel_descriptor {
136 int active; 133 int active;
137 int src_slot; 134 int src_slot;
138 int pcm_slot; 135 int pcm_slot;
139 u32 sample_rate; 136 u32 sample_rate;
140 u32 unlinked; 137 u32 unlinked;
141 dsp_scb_descriptor_t * pcm_reader_scb; 138 struct dsp_scb_descriptor * pcm_reader_scb;
142 dsp_scb_descriptor_t * src_scb; 139 struct dsp_scb_descriptor * src_scb;
143 dsp_scb_descriptor_t * mixer_scb; 140 struct dsp_scb_descriptor * mixer_scb;
144 141
145 void * private_data; 142 void * private_data;
146} pcm_channel_descriptor_t; 143};
147 144
148typedef struct _dsp_spos_instance_t { 145struct dsp_spos_instance {
149 symbol_desc_t symbol_table; /* currently availble loaded symbols in SP */ 146 struct dsp_symbol_desc symbol_table; /* currently availble loaded symbols in SP */
150 147
151 int nmodules; 148 int nmodules;
152 dsp_module_desc_t * modules; /* modules loaded into SP */ 149 struct dsp_module_desc * modules; /* modules loaded into SP */
153 150
154 segment_desc_t code; 151 struct dsp_segment_desc code;
155 152
156 /* Main PCM playback mixer */ 153 /* Main PCM playback mixer */
157 dsp_scb_descriptor_t * master_mix_scb; 154 struct dsp_scb_descriptor * master_mix_scb;
158 u16 dac_volume_right; 155 u16 dac_volume_right;
159 u16 dac_volume_left; 156 u16 dac_volume_left;
160 157
161 /* Rear/surround PCM playback mixer */ 158 /* Rear/surround PCM playback mixer */
162 dsp_scb_descriptor_t * rear_mix_scb; 159 struct dsp_scb_descriptor * rear_mix_scb;
163 160
164 /* Center/LFE mixer */ 161 /* Center/LFE mixer */
165 dsp_scb_descriptor_t * center_lfe_mix_scb; 162 struct dsp_scb_descriptor * center_lfe_mix_scb;
166 163
167 int npcm_channels; 164 int npcm_channels;
168 int nsrc_scb; 165 int nsrc_scb;
169 pcm_channel_descriptor_t pcm_channels[DSP_MAX_PCM_CHANNELS]; 166 struct dsp_pcm_channel_descriptor pcm_channels[DSP_MAX_PCM_CHANNELS];
170 int src_scb_slots[DSP_MAX_SRC_NR]; 167 int src_scb_slots[DSP_MAX_SRC_NR];
171 168
172 /* cache this symbols */ 169 /* cache this symbols */
173 symbol_entry_t * null_algorithm; /* used by PCMreaderSCB's */ 170 struct dsp_symbol_entry * null_algorithm; /* used by PCMreaderSCB's */
174 symbol_entry_t * s16_up; /* used by SRCtaskSCB's */ 171 struct dsp_symbol_entry * s16_up; /* used by SRCtaskSCB's */
175 172
176 /* proc fs */ 173 /* proc fs */
177 snd_card_t * snd_card; 174 struct snd_card *snd_card;
178 snd_info_entry_t * proc_dsp_dir; 175 struct snd_info_entry * proc_dsp_dir;
179 snd_info_entry_t * proc_sym_info_entry; 176 struct snd_info_entry * proc_sym_info_entry;
180 snd_info_entry_t * proc_modules_info_entry; 177 struct snd_info_entry * proc_modules_info_entry;
181 snd_info_entry_t * proc_parameter_dump_info_entry; 178 struct snd_info_entry * proc_parameter_dump_info_entry;
182 snd_info_entry_t * proc_sample_dump_info_entry; 179 struct snd_info_entry * proc_sample_dump_info_entry;
183 180
184 /* SCB's descriptors */ 181 /* SCB's descriptors */
185 int nscb; 182 int nscb;
186 int scb_highest_frag_index; 183 int scb_highest_frag_index;
187 dsp_scb_descriptor_t scbs[DSP_MAX_SCB_DESC]; 184 struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC];
188 snd_info_entry_t * proc_scb_info_entry; 185 struct snd_info_entry * proc_scb_info_entry;
189 dsp_scb_descriptor_t * the_null_scb; 186 struct dsp_scb_descriptor * the_null_scb;
190 187
191 /* Task's descriptors */ 188 /* Task's descriptors */
192 int ntask; 189 int ntask;
193 dsp_task_descriptor_t tasks[DSP_MAX_TASK_DESC]; 190 struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC];
194 snd_info_entry_t * proc_task_info_entry; 191 struct snd_info_entry * proc_task_info_entry;
195 192
196 /* SPDIF status */ 193 /* SPDIF status */
197 int spdif_status_out; 194 int spdif_status_out;
@@ -204,30 +201,30 @@ typedef struct _dsp_spos_instance_t {
204 unsigned int spdif_csuv_stream; 201 unsigned int spdif_csuv_stream;
205 202
206 /* SPDIF input sample rate converter */ 203 /* SPDIF input sample rate converter */
207 dsp_scb_descriptor_t * spdif_in_src; 204 struct dsp_scb_descriptor * spdif_in_src;
208 /* SPDIF input asynch. receiver */ 205 /* SPDIF input asynch. receiver */
209 dsp_scb_descriptor_t * asynch_rx_scb; 206 struct dsp_scb_descriptor * asynch_rx_scb;
210 207
211 /* Capture record mixer SCB */ 208 /* Capture record mixer SCB */
212 dsp_scb_descriptor_t * record_mixer_scb; 209 struct dsp_scb_descriptor * record_mixer_scb;
213 210
214 /* CODEC input SCB */ 211 /* CODEC input SCB */
215 dsp_scb_descriptor_t * codec_in_scb; 212 struct dsp_scb_descriptor * codec_in_scb;
216 213
217 /* reference snooper */ 214 /* reference snooper */
218 dsp_scb_descriptor_t * ref_snoop_scb; 215 struct dsp_scb_descriptor * ref_snoop_scb;
219 216
220 /* SPDIF output PCM reference */ 217 /* SPDIF output PCM reference */
221 dsp_scb_descriptor_t * spdif_pcm_input_scb; 218 struct dsp_scb_descriptor * spdif_pcm_input_scb;
222 219
223 /* asynch TX task */ 220 /* asynch TX task */
224 dsp_scb_descriptor_t * asynch_tx_scb; 221 struct dsp_scb_descriptor * asynch_tx_scb;
225 222
226 /* record sources */ 223 /* record sources */
227 dsp_scb_descriptor_t * pcm_input; 224 struct dsp_scb_descriptor * pcm_input;
228 dsp_scb_descriptor_t * adc_input; 225 struct dsp_scb_descriptor * adc_input;
229 226
230 int spdif_in_sample_rate; 227 int spdif_in_sample_rate;
231} dsp_spos_instance_t; 228};
232 229
233#endif /* __DSP_SPOS_H__ */ 230#endif /* __DSP_SPOS_H__ */
diff --git a/include/sound/cs46xx_dsp_task_types.h b/include/sound/cs46xx_dsp_task_types.h
index 5dd3bf69cb03..b3076c487de6 100644
--- a/include/sound/cs46xx_dsp_task_types.h
+++ b/include/sound/cs46xx_dsp_task_types.h
@@ -71,7 +71,7 @@ Ptr____Call (c)
71 at the end of BG */ 71 at the end of BG */
72 72
73/* Minimal context save area for Hyper Forground */ 73/* Minimal context save area for Hyper Forground */
74typedef struct _hf_save_area_t { 74struct dsp_hf_save_area {
75 u32 r10_save; 75 u32 r10_save;
76 u32 r54_save; 76 u32 r54_save;
77 u32 r98_save; 77 u32 r98_save;
@@ -96,11 +96,11 @@ typedef struct _hf_save_area_t {
96 rsa2Save 96 rsa2Save
97 ) 97 )
98 /* saved as part of HFG context */ 98 /* saved as part of HFG context */
99} hf_save_area_t; 99};
100 100
101 101
102/* Task link data structure */ 102/* Task link data structure */
103typedef struct _tree_link_t { 103struct dsp_tree_link {
104 ___DSP_DUAL_16BIT_ALLOC( 104 ___DSP_DUAL_16BIT_ALLOC(
105 /* Pointer to sibling task control block */ 105 /* Pointer to sibling task control block */
106 next_scb, 106 next_scb,
@@ -114,10 +114,10 @@ typedef struct _tree_link_t {
114 /* Pointer to local data */ 114 /* Pointer to local data */
115 this_spb 115 this_spb
116 ) 116 )
117} tree_link_t; 117};
118 118
119 119
120typedef struct _task_tree_data_t { 120struct dsp_task_tree_data {
121 ___DSP_DUAL_16BIT_ALLOC( 121 ___DSP_DUAL_16BIT_ALLOC(
122 /* Initial tock count; controls task tree execution rate */ 122 /* Initial tock count; controls task tree execution rate */
123 tock_count_limit, 123 tock_count_limit,
@@ -155,11 +155,10 @@ typedef struct _task_tree_data_t {
155 data_stack_base_ptr 155 data_stack_base_ptr
156 ) 156 )
157 157
158} task_tree_data_t; 158};
159 159
160 160
161 161struct dsp_interval_timer_data
162typedef struct _interval_timer_data_t
163{ 162{
164 /* These data items have the same relative locations to those */ 163 /* These data items have the same relative locations to those */
165 ___DSP_DUAL_16BIT_ALLOC( 164 ___DSP_DUAL_16BIT_ALLOC(
@@ -172,12 +171,12 @@ typedef struct _interval_timer_data_t
172 num_FG_ticks_this_interval, 171 num_FG_ticks_this_interval,
173 num_intervals 172 num_intervals
174 ) 173 )
175} interval_timer_data_t; 174};
176 175
177 176
178/* This structure contains extra storage for the task tree 177/* This structure contains extra storage for the task tree
179 Currently, this additional data is related only to a full context save */ 178 Currently, this additional data is related only to a full context save */
180typedef struct _task_tree_context_block_t { 179struct dsp_task_tree_context_block {
181 /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for 180 /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for
182 The access to the context switch (call or interrupt), and 1 spare that 181 The access to the context switch (call or interrupt), and 1 spare that
183 users should never use. This last may be required by the system */ 182 users should never use. This last may be required by the system */
@@ -238,16 +237,16 @@ typedef struct _task_tree_context_block_t {
238 u32 saveaux2xaux3x; 237 u32 saveaux2xaux3x;
239 u32 savershouthl; 238 u32 savershouthl;
240 u32 savershoutxmacmode; 239 u32 savershoutxmacmode;
241} task_tree_context_block_t; 240};
242 241
243 242
244typedef struct _task_tree_control_block_t { 243struct dsp_task_tree_control_block {
245 hf_save_area_t context; 244 struct dsp_hf_save_area context;
246 tree_link_t links; 245 struct dsp_tree_link links;
247 task_tree_data_t data; 246 struct dsp_task_tree_data data;
248 task_tree_context_block_t context_blk; 247 struct dsp_task_tree_context_block context_blk;
249 interval_timer_data_t int_timer; 248 struct dsp_interval_timer_data int_timer;
250} task_tree_control_block_t; 249};
251 250
252 251
253#endif /* __DSP_TASK_TYPES_H__ */ 252#endif /* __DSP_TASK_TYPES_H__ */
diff --git a/include/sound/cs8403.h b/include/sound/cs8403.h
index 0b7d216e24f1..c6c3f9f0da78 100644
--- a/include/sound/cs8403.h
+++ b/include/sound/cs8403.h
@@ -36,7 +36,7 @@
36#endif 36#endif
37 37
38 38
39SND_CS8403_DECL void SND_CS8403_DECODE(snd_aes_iec958_t *diga, unsigned char bits) 39SND_CS8403_DECL void SND_CS8403_DECODE(struct snd_aes_iec958 *diga, unsigned char bits)
40{ 40{
41 if (bits & 0x01) { /* consumer */ 41 if (bits & 0x01) { /* consumer */
42 if (!(bits & 0x02)) 42 if (!(bits & 0x02))
@@ -79,7 +79,7 @@ SND_CS8403_DECL void SND_CS8403_DECODE(snd_aes_iec958_t *diga, unsigned char bit
79 } 79 }
80} 80}
81 81
82SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(snd_aes_iec958_t *diga) 82SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(struct snd_aes_iec958 *diga)
83{ 83{
84 unsigned char bits; 84 unsigned char bits;
85 85
@@ -166,7 +166,7 @@ SND_CS8403_DECL unsigned char SND_CS8403_ENCODE(snd_aes_iec958_t *diga)
166#endif 166#endif
167 167
168 168
169SND_CS8404_DECL void SND_CS8404_DECODE(snd_aes_iec958_t *diga, unsigned char bits) 169SND_CS8404_DECL void SND_CS8404_DECODE(struct snd_aes_iec958 *diga, unsigned char bits)
170{ 170{
171 if (bits & 0x10) { /* consumer */ 171 if (bits & 0x10) { /* consumer */
172 if (!(bits & 0x20)) 172 if (!(bits & 0x20))
@@ -205,7 +205,7 @@ SND_CS8404_DECL void SND_CS8404_DECODE(snd_aes_iec958_t *diga, unsigned char bit
205 } 205 }
206} 206}
207 207
208SND_CS8404_DECL unsigned char SND_CS8404_ENCODE(snd_aes_iec958_t *diga) 208SND_CS8404_DECL unsigned char SND_CS8404_ENCODE(struct snd_aes_iec958 *diga)
209{ 209{
210 unsigned char bits; 210 unsigned char bits;
211 211
diff --git a/include/sound/cs8427.h b/include/sound/cs8427.h
index e725b7049a53..97fd9acf8028 100644
--- a/include/sound/cs8427.h
+++ b/include/sound/cs8427.h
@@ -186,11 +186,16 @@
186#define CS8427_VERSHIFT 0 186#define CS8427_VERSHIFT 0
187#define CS8427_VER8427A 0x71 187#define CS8427_VER8427A 0x71
188 188
189int snd_cs8427_create(snd_i2c_bus_t *bus, unsigned char addr, 189struct snd_pcm_substream;
190 unsigned int reset_timeout, snd_i2c_device_t **r_cs8427); 190
191int snd_cs8427_reg_write(snd_i2c_device_t *device, unsigned char reg, unsigned char val); 191int snd_cs8427_create(struct snd_i2c_bus *bus, unsigned char addr,
192int snd_cs8427_iec958_build(snd_i2c_device_t *cs8427, snd_pcm_substream_t *playback_substream, snd_pcm_substream_t *capture_substream); 192 unsigned int reset_timeout, struct snd_i2c_device **r_cs8427);
193int snd_cs8427_iec958_active(snd_i2c_device_t *cs8427, int active); 193int snd_cs8427_reg_write(struct snd_i2c_device *device, unsigned char reg,
194int snd_cs8427_iec958_pcm(snd_i2c_device_t *cs8427, unsigned int rate); 194 unsigned char val);
195int snd_cs8427_iec958_build(struct snd_i2c_device *cs8427,
196 struct snd_pcm_substream *playback_substream,
197 struct snd_pcm_substream *capture_substream);
198int snd_cs8427_iec958_active(struct snd_i2c_device *cs8427, int active);
199int snd_cs8427_iec958_pcm(struct snd_i2c_device *cs8427, unsigned int rate);
195 200
196#endif /* __SOUND_CS8427_H */ 201#endif /* __SOUND_CS8427_H */
diff --git a/include/sound/driver.h b/include/sound/driver.h
index 3f0416ac24d9..89c6a73f3920 100644
--- a/include/sound/driver.h
+++ b/include/sound/driver.h
@@ -28,7 +28,12 @@
28 28
29#include <linux/config.h> 29#include <linux/config.h>
30 30
31#define SNDRV_CARDS 8 /* number of supported soundcards - don't change - minor numbers */ 31/* number of supported soundcards */
32#ifdef CONFIG_SND_DYNAMIC_MINORS
33#define SNDRV_CARDS 32
34#else
35#define SNDRV_CARDS 8 /* don't change - minor numbers */
36#endif
32 37
33#ifndef CONFIG_SND_MAJOR /* standard configuration */ 38#ifndef CONFIG_SND_MAJOR /* standard configuration */
34#define CONFIG_SND_MAJOR 116 39#define CONFIG_SND_MAJOR 116
diff --git a/include/sound/emu10k1.h b/include/sound/emu10k1.h
index 8411c7ef6f11..951e40d720d9 100644
--- a/include/sound/emu10k1.h
+++ b/include/sound/emu10k1.h
@@ -887,47 +887,45 @@
887 887
888/* ------------------- STRUCTURES -------------------- */ 888/* ------------------- STRUCTURES -------------------- */
889 889
890typedef struct _snd_emu10k1 emu10k1_t; 890enum {
891typedef struct _snd_emu10k1_voice emu10k1_voice_t;
892typedef struct _snd_emu10k1_pcm emu10k1_pcm_t;
893
894typedef enum {
895 EMU10K1_EFX, 891 EMU10K1_EFX,
896 EMU10K1_PCM, 892 EMU10K1_PCM,
897 EMU10K1_SYNTH, 893 EMU10K1_SYNTH,
898 EMU10K1_MIDI 894 EMU10K1_MIDI
899} emu10k1_voice_type_t; 895};
896
897struct snd_emu10k1;
900 898
901struct _snd_emu10k1_voice { 899struct snd_emu10k1_voice {
902 emu10k1_t *emu; 900 struct snd_emu10k1 *emu;
903 int number; 901 int number;
904 unsigned int use: 1, 902 unsigned int use: 1,
905 pcm: 1, 903 pcm: 1,
906 efx: 1, 904 efx: 1,
907 synth: 1, 905 synth: 1,
908 midi: 1; 906 midi: 1;
909 void (*interrupt)(emu10k1_t *emu, emu10k1_voice_t *pvoice); 907 void (*interrupt)(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
910 908
911 emu10k1_pcm_t *epcm; 909 struct snd_emu10k1_pcm *epcm;
912}; 910};
913 911
914typedef enum { 912enum {
915 PLAYBACK_EMUVOICE, 913 PLAYBACK_EMUVOICE,
916 PLAYBACK_EFX, 914 PLAYBACK_EFX,
917 CAPTURE_AC97ADC, 915 CAPTURE_AC97ADC,
918 CAPTURE_AC97MIC, 916 CAPTURE_AC97MIC,
919 CAPTURE_EFX 917 CAPTURE_EFX
920} snd_emu10k1_pcm_type_t; 918};
921 919
922struct _snd_emu10k1_pcm { 920struct snd_emu10k1_pcm {
923 emu10k1_t *emu; 921 struct snd_emu10k1 *emu;
924 snd_emu10k1_pcm_type_t type; 922 int type;
925 snd_pcm_substream_t *substream; 923 struct snd_pcm_substream *substream;
926 emu10k1_voice_t *voices[NUM_EFX_PLAYBACK]; 924 struct snd_emu10k1_voice *voices[NUM_EFX_PLAYBACK];
927 emu10k1_voice_t *extra; 925 struct snd_emu10k1_voice *extra;
928 unsigned short running; 926 unsigned short running;
929 unsigned short first_ptr; 927 unsigned short first_ptr;
930 snd_util_memblk_t *memblk; 928 struct snd_util_memblk *memblk;
931 unsigned int start_addr; 929 unsigned int start_addr;
932 unsigned int ccca_start_addr; 930 unsigned int ccca_start_addr;
933 unsigned int capture_ipr; /* interrupt acknowledge mask */ 931 unsigned int capture_ipr; /* interrupt acknowledge mask */
@@ -941,13 +939,13 @@ struct _snd_emu10k1_pcm {
941 unsigned int capture_bufsize; /* buffer size in bytes */ 939 unsigned int capture_bufsize; /* buffer size in bytes */
942}; 940};
943 941
944typedef struct { 942struct snd_emu10k1_pcm_mixer {
945 /* mono, left, right x 8 sends (4 on emu10k1) */ 943 /* mono, left, right x 8 sends (4 on emu10k1) */
946 unsigned char send_routing[3][8]; 944 unsigned char send_routing[3][8];
947 unsigned char send_volume[3][8]; 945 unsigned char send_volume[3][8];
948 unsigned short attn[3]; 946 unsigned short attn[3];
949 emu10k1_pcm_t *epcm; 947 struct snd_emu10k1_pcm *epcm;
950} emu10k1_pcm_mixer_t; 948};
951 949
952#define snd_emu10k1_compose_send_routing(route) \ 950#define snd_emu10k1_compose_send_routing(route) \
953((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16) 951((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16)
@@ -958,20 +956,20 @@ typedef struct {
958#define snd_emu10k1_compose_audigy_fxrt2(route) \ 956#define snd_emu10k1_compose_audigy_fxrt2(route) \
959((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24)) 957((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24))
960 958
961typedef struct snd_emu10k1_memblk { 959struct snd_emu10k1_memblk {
962 snd_util_memblk_t mem; 960 struct snd_util_memblk mem;
963 /* private part */ 961 /* private part */
964 int first_page, last_page, pages, mapped_page; 962 int first_page, last_page, pages, mapped_page;
965 unsigned int map_locked; 963 unsigned int map_locked;
966 struct list_head mapped_link; 964 struct list_head mapped_link;
967 struct list_head mapped_order_link; 965 struct list_head mapped_order_link;
968} emu10k1_memblk_t; 966};
969 967
970#define snd_emu10k1_memblk_offset(blk) (((blk)->mapped_page << PAGE_SHIFT) | ((blk)->mem.offset & (PAGE_SIZE - 1))) 968#define snd_emu10k1_memblk_offset(blk) (((blk)->mapped_page << PAGE_SHIFT) | ((blk)->mem.offset & (PAGE_SIZE - 1)))
971 969
972#define EMU10K1_MAX_TRAM_BLOCKS_PER_CODE 16 970#define EMU10K1_MAX_TRAM_BLOCKS_PER_CODE 16
973 971
974typedef struct { 972struct snd_emu10k1_fx8010_ctl {
975 struct list_head list; /* list link container */ 973 struct list_head list; /* list link container */
976 unsigned int vcount; 974 unsigned int vcount;
977 unsigned int count; /* count of GPR (1..16) */ 975 unsigned int count; /* count of GPR (1..16) */
@@ -980,19 +978,19 @@ typedef struct {
980 unsigned int min; /* minimum range */ 978 unsigned int min; /* minimum range */
981 unsigned int max; /* maximum range */ 979 unsigned int max; /* maximum range */
982 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 980 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
983 snd_kcontrol_t *kcontrol; 981 struct snd_kcontrol *kcontrol;
984} snd_emu10k1_fx8010_ctl_t; 982};
985 983
986typedef void (snd_fx8010_irq_handler_t)(emu10k1_t *emu, void *private_data); 984typedef void (snd_fx8010_irq_handler_t)(struct snd_emu10k1 *emu, void *private_data);
987 985
988typedef struct _snd_emu10k1_fx8010_irq { 986struct snd_emu10k1_fx8010_irq {
989 struct _snd_emu10k1_fx8010_irq *next; 987 struct snd_emu10k1_fx8010_irq *next;
990 snd_fx8010_irq_handler_t *handler; 988 snd_fx8010_irq_handler_t *handler;
991 unsigned short gpr_running; 989 unsigned short gpr_running;
992 void *private_data; 990 void *private_data;
993} snd_emu10k1_fx8010_irq_t; 991};
994 992
995typedef struct { 993struct snd_emu10k1_fx8010_pcm {
996 unsigned int valid: 1, 994 unsigned int valid: 1,
997 opened: 1, 995 opened: 1,
998 active: 1; 996 active: 1;
@@ -1006,13 +1004,13 @@ typedef struct {
1006 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ 1004 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */
1007 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ 1005 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */
1008 unsigned char etram[32]; /* external TRAM address & data */ 1006 unsigned char etram[32]; /* external TRAM address & data */
1009 snd_pcm_indirect_t pcm_rec; 1007 struct snd_pcm_indirect pcm_rec;
1010 unsigned int tram_pos; 1008 unsigned int tram_pos;
1011 unsigned int tram_shift; 1009 unsigned int tram_shift;
1012 snd_emu10k1_fx8010_irq_t *irq; 1010 struct snd_emu10k1_fx8010_irq *irq;
1013} snd_emu10k1_fx8010_pcm_t; 1011};
1014 1012
1015typedef struct { 1013struct snd_emu10k1_fx8010 {
1016 unsigned short fxbus_mask; /* used FX buses (bitmask) */ 1014 unsigned short fxbus_mask; /* used FX buses (bitmask) */
1017 unsigned short extin_mask; /* used external inputs (bitmask) */ 1015 unsigned short extin_mask; /* used external inputs (bitmask) */
1018 unsigned short extout_mask; /* used external outputs (bitmask) */ 1016 unsigned short extout_mask; /* used external outputs (bitmask) */
@@ -1025,18 +1023,18 @@ typedef struct {
1025 int gpr_count; /* count of used kcontrols */ 1023 int gpr_count; /* count of used kcontrols */
1026 struct list_head gpr_ctl; /* GPR controls */ 1024 struct list_head gpr_ctl; /* GPR controls */
1027 struct semaphore lock; 1025 struct semaphore lock;
1028 snd_emu10k1_fx8010_pcm_t pcm[8]; 1026 struct snd_emu10k1_fx8010_pcm pcm[8];
1029 spinlock_t irq_lock; 1027 spinlock_t irq_lock;
1030 snd_emu10k1_fx8010_irq_t *irq_handlers; 1028 struct snd_emu10k1_fx8010_irq *irq_handlers;
1031} snd_emu10k1_fx8010_t; 1029};
1032 1030
1033#define emu10k1_gpr_ctl(n) list_entry(n, snd_emu10k1_fx8010_ctl_t, list) 1031#define emu10k1_gpr_ctl(n) list_entry(n, struct snd_emu10k1_fx8010_ctl, list)
1034 1032
1035typedef struct { 1033struct snd_emu10k1_midi {
1036 struct _snd_emu10k1 *emu; 1034 struct snd_emu10k1 *emu;
1037 snd_rawmidi_t *rmidi; 1035 struct snd_rawmidi *rmidi;
1038 snd_rawmidi_substream_t *substream_input; 1036 struct snd_rawmidi_substream *substream_input;
1039 snd_rawmidi_substream_t *substream_output; 1037 struct snd_rawmidi_substream *substream_output;
1040 unsigned int midi_mode; 1038 unsigned int midi_mode;
1041 spinlock_t input_lock; 1039 spinlock_t input_lock;
1042 spinlock_t output_lock; 1040 spinlock_t output_lock;
@@ -1044,10 +1042,10 @@ typedef struct {
1044 int tx_enable, rx_enable; 1042 int tx_enable, rx_enable;
1045 int port; 1043 int port;
1046 int ipr_tx, ipr_rx; 1044 int ipr_tx, ipr_rx;
1047 void (*interrupt)(emu10k1_t *emu, unsigned int status); 1045 void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1048} emu10k1_midi_t; 1046};
1049 1047
1050typedef struct { 1048struct snd_emu_chip_details {
1051 u32 vendor; 1049 u32 vendor;
1052 u32 device; 1050 u32 device;
1053 u32 subsystem; 1051 u32 subsystem;
@@ -1063,18 +1061,23 @@ typedef struct {
1063 unsigned char spdif_bug; /* Has Spdif phasing bug */ 1061 unsigned char spdif_bug; /* Has Spdif phasing bug */
1064 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1062 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */
1065 unsigned char ecard; /* APS EEPROM */ 1063 unsigned char ecard; /* APS EEPROM */
1064 unsigned char emu1212m; /* EMU 1212m card */
1065 unsigned char spi_dac; /* SPI interface for DAC */
1066 unsigned char i2c_adc; /* I2C interface for ADC */
1066 const char *driver; 1067 const char *driver;
1067 const char *name; 1068 const char *name;
1068 const char *id; /* for backward compatibility - can be NULL if not needed */ 1069 const char *id; /* for backward compatibility - can be NULL if not needed */
1069} emu_chip_details_t; 1070};
1070 1071
1071struct _snd_emu10k1 { 1072struct snd_emu10k1 {
1072 int irq; 1073 int irq;
1073 1074
1074 unsigned long port; /* I/O port number */ 1075 unsigned long port; /* I/O port number */
1075 unsigned int tos_link: 1, /* tos link detected */ 1076 unsigned int tos_link: 1, /* tos link detected */
1076 rear_ac97: 1; /* rear channels are on AC'97 */ 1077 rear_ac97: 1, /* rear channels are on AC'97 */
1077 const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ 1078 enable_ir: 1;
1079 /* Contains profile of card capabilities */
1080 const struct snd_emu_chip_details *card_capabilities;
1078 unsigned int audigy; /* is Audigy? */ 1081 unsigned int audigy; /* is Audigy? */
1079 unsigned int revision; /* chip revision */ 1082 unsigned int revision; /* chip revision */
1080 unsigned int serial; /* serial number */ 1083 unsigned int serial; /* serial number */
@@ -1088,8 +1091,8 @@ struct _snd_emu10k1 {
1088 struct snd_dma_device p16v_dma_dev; 1091 struct snd_dma_device p16v_dma_dev;
1089 struct snd_dma_buffer p16v_buffer; 1092 struct snd_dma_buffer p16v_buffer;
1090 1093
1091 snd_util_memhdr_t *memhdr; /* page allocation list */ 1094 struct snd_util_memhdr *memhdr; /* page allocation list */
1092 emu10k1_memblk_t *reserved_page; /* reserved page */ 1095 struct snd_emu10k1_memblk *reserved_page; /* reserved page */
1093 1096
1094 struct list_head mapped_link_head; 1097 struct list_head mapped_link_head;
1095 struct list_head mapped_order_link_head; 1098 struct list_head mapped_order_link_head;
@@ -1099,142 +1102,169 @@ struct _snd_emu10k1 {
1099 1102
1100 unsigned int spdif_bits[3]; /* s/pdif out setup */ 1103 unsigned int spdif_bits[3]; /* s/pdif out setup */
1101 1104
1102 snd_emu10k1_fx8010_t fx8010; /* FX8010 info */ 1105 struct snd_emu10k1_fx8010 fx8010; /* FX8010 info */
1103 int gpr_base; 1106 int gpr_base;
1104 1107
1105 ac97_t *ac97; 1108 struct snd_ac97 *ac97;
1106 1109
1107 struct pci_dev *pci; 1110 struct pci_dev *pci;
1108 snd_card_t *card; 1111 struct snd_card *card;
1109 snd_pcm_t *pcm; 1112 struct snd_pcm *pcm;
1110 snd_pcm_t *pcm_mic; 1113 struct snd_pcm *pcm_mic;
1111 snd_pcm_t *pcm_efx; 1114 struct snd_pcm *pcm_efx;
1112 snd_pcm_t *pcm_p16v; 1115 struct snd_pcm *pcm_multi;
1116 struct snd_pcm *pcm_p16v;
1113 1117
1114 spinlock_t synth_lock; 1118 spinlock_t synth_lock;
1115 void *synth; 1119 void *synth;
1116 int (*get_synth_voice)(emu10k1_t *emu); 1120 int (*get_synth_voice)(struct snd_emu10k1 *emu);
1117 1121
1118 spinlock_t reg_lock; 1122 spinlock_t reg_lock;
1119 spinlock_t emu_lock; 1123 spinlock_t emu_lock;
1120 spinlock_t voice_lock; 1124 spinlock_t voice_lock;
1121 struct semaphore ptb_lock; 1125 struct semaphore ptb_lock;
1122 1126
1123 emu10k1_voice_t voices[NUM_G]; 1127 struct snd_emu10k1_voice voices[NUM_G];
1124 emu10k1_voice_t p16v_voices[4]; 1128 struct snd_emu10k1_voice p16v_voices[4];
1125 emu10k1_voice_t p16v_capture_voice; 1129 struct snd_emu10k1_voice p16v_capture_voice;
1126 int p16v_device_offset; 1130 int p16v_device_offset;
1127 u32 p16v_capture_source; 1131 u32 p16v_capture_source;
1128 u32 p16v_capture_channel; 1132 u32 p16v_capture_channel;
1129 emu10k1_pcm_mixer_t pcm_mixer[32]; 1133 struct snd_emu10k1_pcm_mixer pcm_mixer[32];
1130 emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK]; 1134 struct snd_emu10k1_pcm_mixer efx_pcm_mixer[NUM_EFX_PLAYBACK];
1131 snd_kcontrol_t *ctl_send_routing; 1135 struct snd_kcontrol *ctl_send_routing;
1132 snd_kcontrol_t *ctl_send_volume; 1136 struct snd_kcontrol *ctl_send_volume;
1133 snd_kcontrol_t *ctl_attn; 1137 struct snd_kcontrol *ctl_attn;
1134 snd_kcontrol_t *ctl_efx_send_routing; 1138 struct snd_kcontrol *ctl_efx_send_routing;
1135 snd_kcontrol_t *ctl_efx_send_volume; 1139 struct snd_kcontrol *ctl_efx_send_volume;
1136 snd_kcontrol_t *ctl_efx_attn; 1140 struct snd_kcontrol *ctl_efx_attn;
1137 1141
1138 void (*hwvol_interrupt)(emu10k1_t *emu, unsigned int status); 1142 void (*hwvol_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1139 void (*capture_interrupt)(emu10k1_t *emu, unsigned int status); 1143 void (*capture_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1140 void (*capture_mic_interrupt)(emu10k1_t *emu, unsigned int status); 1144 void (*capture_mic_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1141 void (*capture_efx_interrupt)(emu10k1_t *emu, unsigned int status); 1145 void (*capture_efx_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1142 void (*spdif_interrupt)(emu10k1_t *emu, unsigned int status); 1146 void (*spdif_interrupt)(struct snd_emu10k1 *emu, unsigned int status);
1143 void (*dsp_interrupt)(emu10k1_t *emu); 1147 void (*dsp_interrupt)(struct snd_emu10k1 *emu);
1144 1148
1145 snd_pcm_substream_t *pcm_capture_substream; 1149 struct snd_pcm_substream *pcm_capture_substream;
1146 snd_pcm_substream_t *pcm_capture_mic_substream; 1150 struct snd_pcm_substream *pcm_capture_mic_substream;
1147 snd_pcm_substream_t *pcm_capture_efx_substream; 1151 struct snd_pcm_substream *pcm_capture_efx_substream;
1148 snd_pcm_substream_t *pcm_playback_efx_substream; 1152 struct snd_pcm_substream *pcm_playback_efx_substream;
1149 1153
1150 snd_timer_t *timer; 1154 struct snd_timer *timer;
1151 1155
1152 emu10k1_midi_t midi; 1156 struct snd_emu10k1_midi midi;
1153 emu10k1_midi_t midi2; /* for audigy */ 1157 struct snd_emu10k1_midi midi2; /* for audigy */
1154 1158
1155 unsigned int efx_voices_mask[2]; 1159 unsigned int efx_voices_mask[2];
1156 unsigned int next_free_voice; 1160 unsigned int next_free_voice;
1161
1162#ifdef CONFIG_PM
1163 unsigned int *saved_ptr;
1164 unsigned int *saved_gpr;
1165 unsigned int *tram_val_saved;
1166 unsigned int *tram_addr_saved;
1167 unsigned int *saved_icode;
1168 unsigned int *p16v_saved;
1169 unsigned int saved_a_iocfg, saved_hcfg;
1170#endif
1171
1157}; 1172};
1158 1173
1159int snd_emu10k1_create(snd_card_t * card, 1174int snd_emu10k1_create(struct snd_card *card,
1160 struct pci_dev *pci, 1175 struct pci_dev *pci,
1161 unsigned short extin_mask, 1176 unsigned short extin_mask,
1162 unsigned short extout_mask, 1177 unsigned short extout_mask,
1163 long max_cache_bytes, 1178 long max_cache_bytes,
1164 int enable_ir, 1179 int enable_ir,
1165 uint subsystem, 1180 uint subsystem,
1166 emu10k1_t ** remu); 1181 struct snd_emu10k1 ** remu);
1167 1182
1168int snd_emu10k1_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1183int snd_emu10k1_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
1169int snd_emu10k1_pcm_mic(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1184int snd_emu10k1_pcm_mic(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
1170int snd_emu10k1_pcm_efx(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1185int snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
1171int snd_p16v_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1186int snd_p16v_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
1172int snd_p16v_free(emu10k1_t * emu); 1187int snd_p16v_free(struct snd_emu10k1 * emu);
1173int snd_p16v_mixer(emu10k1_t * emu); 1188int snd_p16v_mixer(struct snd_emu10k1 * emu);
1174int snd_emu10k1_pcm_multi(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1189int snd_emu10k1_pcm_multi(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
1175int snd_emu10k1_fx8010_pcm(emu10k1_t * emu, int device, snd_pcm_t ** rpcm); 1190int snd_emu10k1_fx8010_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm);
1176int snd_emu10k1_mixer(emu10k1_t * emu, int pcm_device, int multi_device); 1191int snd_emu10k1_mixer(struct snd_emu10k1 * emu, int pcm_device, int multi_device);
1177int snd_emu10k1_timer(emu10k1_t * emu, int device); 1192int snd_emu10k1_timer(struct snd_emu10k1 * emu, int device);
1178int snd_emu10k1_fx8010_new(emu10k1_t *emu, int device, snd_hwdep_t ** rhwdep); 1193int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct snd_hwdep ** rhwdep);
1179 1194
1180irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs); 1195irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs);
1181 1196
1182/* initialization */ 1197void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int voice);
1183void snd_emu10k1_voice_init(emu10k1_t * emu, int voice); 1198int snd_emu10k1_init_efx(struct snd_emu10k1 *emu);
1184int snd_emu10k1_init_efx(emu10k1_t *emu); 1199void snd_emu10k1_free_efx(struct snd_emu10k1 *emu);
1185void snd_emu10k1_free_efx(emu10k1_t *emu); 1200int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size);
1186int snd_emu10k1_fx8010_tram_setup(emu10k1_t *emu, u32 size); 1201int snd_emu10k1_done(struct snd_emu10k1 * emu);
1187 1202
1188/* I/O functions */ 1203/* I/O functions */
1189unsigned int snd_emu10k1_ptr_read(emu10k1_t * emu, unsigned int reg, unsigned int chn); 1204unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
1190void snd_emu10k1_ptr_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data); 1205void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
1191unsigned int snd_emu10k1_ptr20_read(emu10k1_t * emu, unsigned int reg, unsigned int chn); 1206unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn);
1192void snd_emu10k1_ptr20_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data); 1207void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data);
1193unsigned int snd_emu10k1_efx_read(emu10k1_t *emu, unsigned int pc); 1208int snd_emu10k1_spi_write(struct snd_emu10k1 * emu, unsigned int data);
1194void snd_emu10k1_intr_enable(emu10k1_t *emu, unsigned int intrenb); 1209unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc);
1195void snd_emu10k1_intr_disable(emu10k1_t *emu, unsigned int intrenb); 1210void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb);
1196void snd_emu10k1_voice_intr_enable(emu10k1_t *emu, unsigned int voicenum); 1211void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb);
1197void snd_emu10k1_voice_intr_disable(emu10k1_t *emu, unsigned int voicenum); 1212void snd_emu10k1_voice_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum);
1198void snd_emu10k1_voice_intr_ack(emu10k1_t *emu, unsigned int voicenum); 1213void snd_emu10k1_voice_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum);
1199void snd_emu10k1_voice_half_loop_intr_enable(emu10k1_t *emu, unsigned int voicenum); 1214void snd_emu10k1_voice_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum);
1200void snd_emu10k1_voice_half_loop_intr_disable(emu10k1_t *emu, unsigned int voicenum); 1215void snd_emu10k1_voice_half_loop_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum);
1201void snd_emu10k1_voice_half_loop_intr_ack(emu10k1_t *emu, unsigned int voicenum); 1216void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum);
1202void snd_emu10k1_voice_set_loop_stop(emu10k1_t *emu, unsigned int voicenum); 1217void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum);
1203void snd_emu10k1_voice_clear_loop_stop(emu10k1_t *emu, unsigned int voicenum); 1218void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum);
1204void snd_emu10k1_wait(emu10k1_t *emu, unsigned int wait); 1219void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum);
1205static inline unsigned int snd_emu10k1_wc(emu10k1_t *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; } 1220void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait);
1206unsigned short snd_emu10k1_ac97_read(ac97_t *ac97, unsigned short reg); 1221static inline unsigned int snd_emu10k1_wc(struct snd_emu10k1 *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; }
1207void snd_emu10k1_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short data); 1222unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg);
1223void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data);
1208unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate); 1224unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate);
1209 1225
1226#ifdef CONFIG_PM
1227void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu);
1228void snd_emu10k1_resume_init(struct snd_emu10k1 *emu);
1229void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu);
1230int snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu);
1231void snd_emu10k1_efx_free_pm_buffer(struct snd_emu10k1 *emu);
1232void snd_emu10k1_efx_suspend(struct snd_emu10k1 *emu);
1233void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu);
1234int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu);
1235void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu);
1236void snd_p16v_suspend(struct snd_emu10k1 *emu);
1237void snd_p16v_resume(struct snd_emu10k1 *emu);
1238#endif
1239
1210/* memory allocation */ 1240/* memory allocation */
1211snd_util_memblk_t *snd_emu10k1_alloc_pages(emu10k1_t *emu, snd_pcm_substream_t *substream); 1241struct snd_util_memblk *snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream);
1212int snd_emu10k1_free_pages(emu10k1_t *emu, snd_util_memblk_t *blk); 1242int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
1213snd_util_memblk_t *snd_emu10k1_synth_alloc(emu10k1_t *emu, unsigned int size); 1243struct snd_util_memblk *snd_emu10k1_synth_alloc(struct snd_emu10k1 *emu, unsigned int size);
1214int snd_emu10k1_synth_free(emu10k1_t *emu, snd_util_memblk_t *blk); 1244int snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *blk);
1215int snd_emu10k1_synth_bzero(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, int size); 1245int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, int size);
1216int snd_emu10k1_synth_copy_from_user(emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char __user *data, int size); 1246int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, const char __user *data, int size);
1217int snd_emu10k1_memblk_map(emu10k1_t *emu, emu10k1_memblk_t *blk); 1247int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk);
1218 1248
1219/* voice allocation */ 1249/* voice allocation */
1220int snd_emu10k1_voice_alloc(emu10k1_t *emu, emu10k1_voice_type_t type, int pair, emu10k1_voice_t **rvoice); 1250int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int pair, struct snd_emu10k1_voice **rvoice);
1221int snd_emu10k1_voice_free(emu10k1_t *emu, emu10k1_voice_t *pvoice); 1251int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice);
1222 1252
1223/* MIDI uart */ 1253/* MIDI uart */
1224int snd_emu10k1_midi(emu10k1_t * emu); 1254int snd_emu10k1_midi(struct snd_emu10k1 * emu);
1225int snd_emu10k1_audigy_midi(emu10k1_t * emu); 1255int snd_emu10k1_audigy_midi(struct snd_emu10k1 * emu);
1226 1256
1227/* proc interface */ 1257/* proc interface */
1228int snd_emu10k1_proc_init(emu10k1_t * emu); 1258int snd_emu10k1_proc_init(struct snd_emu10k1 * emu);
1229 1259
1230/* fx8010 irq handler */ 1260/* fx8010 irq handler */
1231int snd_emu10k1_fx8010_register_irq_handler(emu10k1_t *emu, 1261int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
1232 snd_fx8010_irq_handler_t *handler, 1262 snd_fx8010_irq_handler_t *handler,
1233 unsigned char gpr_running, 1263 unsigned char gpr_running,
1234 void *private_data, 1264 void *private_data,
1235 snd_emu10k1_fx8010_irq_t **r_irq); 1265 struct snd_emu10k1_fx8010_irq **r_irq);
1236int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu, 1266int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
1237 snd_emu10k1_fx8010_irq_t *irq); 1267 struct snd_emu10k1_fx8010_irq *irq);
1238 1268
1239#endif /* __KERNEL__ */ 1269#endif /* __KERNEL__ */
1240 1270
@@ -1469,14 +1499,14 @@ int snd_emu10k1_fx8010_unregister_irq_handler(emu10k1_t *emu,
1469#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */ 1499#define TANKMEMADDRREG_READ 0x00100000 /* Read from tank memory */
1470#endif 1500#endif
1471 1501
1472typedef struct { 1502struct snd_emu10k1_fx8010_info {
1473 unsigned int internal_tram_size; /* in samples */ 1503 unsigned int internal_tram_size; /* in samples */
1474 unsigned int external_tram_size; /* in samples */ 1504 unsigned int external_tram_size; /* in samples */
1475 char fxbus_names[16][32]; /* names of FXBUSes */ 1505 char fxbus_names[16][32]; /* names of FXBUSes */
1476 char extin_names[16][32]; /* names of external inputs */ 1506 char extin_names[16][32]; /* names of external inputs */
1477 char extout_names[32][32]; /* names of external outputs */ 1507 char extout_names[32][32]; /* names of external outputs */
1478 unsigned int gpr_controls; /* count of GPR controls */ 1508 unsigned int gpr_controls; /* count of GPR controls */
1479} emu10k1_fx8010_info_t; 1509};
1480 1510
1481#define EMU10K1_GPR_TRANSLATION_NONE 0 1511#define EMU10K1_GPR_TRANSLATION_NONE 0
1482#define EMU10K1_GPR_TRANSLATION_TABLE100 1 1512#define EMU10K1_GPR_TRANSLATION_TABLE100 1
@@ -1484,8 +1514,8 @@ typedef struct {
1484#define EMU10K1_GPR_TRANSLATION_TREBLE 3 1514#define EMU10K1_GPR_TRANSLATION_TREBLE 3
1485#define EMU10K1_GPR_TRANSLATION_ONOFF 4 1515#define EMU10K1_GPR_TRANSLATION_ONOFF 4
1486 1516
1487typedef struct { 1517struct snd_emu10k1_fx8010_control_gpr {
1488 snd_ctl_elem_id_t id; /* full control ID definition */ 1518 struct snd_ctl_elem_id id; /* full control ID definition */
1489 unsigned int vcount; /* visible count */ 1519 unsigned int vcount; /* visible count */
1490 unsigned int count; /* count of GPR (1..16) */ 1520 unsigned int count; /* count of GPR (1..16) */
1491 unsigned short gpr[32]; /* GPR number(s) */ 1521 unsigned short gpr[32]; /* GPR number(s) */
@@ -1493,23 +1523,23 @@ typedef struct {
1493 unsigned int min; /* minimum range */ 1523 unsigned int min; /* minimum range */
1494 unsigned int max; /* maximum range */ 1524 unsigned int max; /* maximum range */
1495 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 1525 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */
1496} emu10k1_fx8010_control_gpr_t; 1526};
1497 1527
1498typedef struct { 1528struct snd_emu10k1_fx8010_code {
1499 char name[128]; 1529 char name[128];
1500 1530
1501 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ 1531 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */
1502 u_int32_t __user *gpr_map; /* initializers */ 1532 u_int32_t __user *gpr_map; /* initializers */
1503 1533
1504 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ 1534 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */
1505 emu10k1_fx8010_control_gpr_t __user *gpr_add_controls; /* GPR controls to add/replace */ 1535 struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */
1506 1536
1507 unsigned int gpr_del_control_count; /* count of GPR controls to remove */ 1537 unsigned int gpr_del_control_count; /* count of GPR controls to remove */
1508 snd_ctl_elem_id_t __user *gpr_del_controls; /* IDs of GPR controls to remove */ 1538 struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */
1509 1539
1510 unsigned int gpr_list_control_count; /* count of GPR controls to list */ 1540 unsigned int gpr_list_control_count; /* count of GPR controls to list */
1511 unsigned int gpr_list_control_total; /* total count of GPR controls */ 1541 unsigned int gpr_list_control_total; /* total count of GPR controls */
1512 emu10k1_fx8010_control_gpr_t __user *gpr_list_controls; /* listed GPR controls */ 1542 struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */
1513 1543
1514 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ 1544 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */
1515 u_int32_t __user *tram_data_map; /* data initializers */ 1545 u_int32_t __user *tram_data_map; /* data initializers */
@@ -1517,16 +1547,16 @@ typedef struct {
1517 1547
1518 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ 1548 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */
1519 u_int32_t __user *code; /* one instruction - 64 bits */ 1549 u_int32_t __user *code; /* one instruction - 64 bits */
1520} emu10k1_fx8010_code_t; 1550};
1521 1551
1522typedef struct { 1552struct snd_emu10k1_fx8010_tram {
1523 unsigned int address; /* 31.bit == 1 -> external TRAM */ 1553 unsigned int address; /* 31.bit == 1 -> external TRAM */
1524 unsigned int size; /* size in samples (4 bytes) */ 1554 unsigned int size; /* size in samples (4 bytes) */
1525 unsigned int *samples; /* pointer to samples (20-bit) */ 1555 unsigned int *samples; /* pointer to samples (20-bit) */
1526 /* NULL->clear memory */ 1556 /* NULL->clear memory */
1527} emu10k1_fx8010_tram_t; 1557};
1528 1558
1529typedef struct { 1559struct snd_emu10k1_fx8010_pcm_rec {
1530 unsigned int substream; /* substream number */ 1560 unsigned int substream; /* substream number */
1531 unsigned int res1; /* reserved */ 1561 unsigned int res1; /* reserved */
1532 unsigned int channels; /* 16-bit channels count, zero = remove this substream */ 1562 unsigned int channels; /* 16-bit channels count, zero = remove this substream */
@@ -1541,20 +1571,27 @@ typedef struct {
1541 unsigned char pad; /* reserved */ 1571 unsigned char pad; /* reserved */
1542 unsigned char etram[32]; /* external TRAM address & data (one per channel) */ 1572 unsigned char etram[32]; /* external TRAM address & data (one per channel) */
1543 unsigned int res2; /* reserved */ 1573 unsigned int res2; /* reserved */
1544} emu10k1_fx8010_pcm_t; 1574};
1545 1575
1546#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, emu10k1_fx8010_info_t) 1576#define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info)
1547#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, emu10k1_fx8010_code_t) 1577#define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code)
1548#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, emu10k1_fx8010_code_t) 1578#define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code)
1549#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) 1579#define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int)
1550#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, emu10k1_fx8010_tram_t) 1580#define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram)
1551#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, emu10k1_fx8010_tram_t) 1581#define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram)
1552#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, emu10k1_fx8010_pcm_t) 1582#define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec)
1553#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, emu10k1_fx8010_pcm_t) 1583#define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec)
1554#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) 1584#define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80)
1555#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) 1585#define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81)
1556#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82) 1586#define SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER _IO ('H', 0x82)
1557#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int) 1587#define SNDRV_EMU10K1_IOCTL_SINGLE_STEP _IOW ('H', 0x83, int)
1558#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) 1588#define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int)
1559 1589
1590/* typedefs for compatibility to user-space */
1591typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t;
1592typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t;
1593typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t;
1594typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t;
1595typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t;
1596
1560#endif /* __SOUND_EMU10K1_H */ 1597#endif /* __SOUND_EMU10K1_H */
diff --git a/include/sound/emu10k1_synth.h b/include/sound/emu10k1_synth.h
index df0df1d09552..6ef61c420935 100644
--- a/include/sound/emu10k1_synth.h
+++ b/include/sound/emu10k1_synth.h
@@ -27,12 +27,12 @@
27#define SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH "emu10k1-synth" 27#define SNDRV_SEQ_DEV_ID_EMU10K1_SYNTH "emu10k1-synth"
28 28
29/* argument for snd_seq_device_new */ 29/* argument for snd_seq_device_new */
30typedef struct snd_emu10k1_synth_arg { 30struct snd_emu10k1_synth_arg {
31 emu10k1_t *hwptr; /* chip */ 31 struct snd_emu10k1 *hwptr; /* chip */
32 int index; /* sequencer client index */ 32 int index; /* sequencer client index */
33 int seq_ports; /* number of sequencer ports to be created */ 33 int seq_ports; /* number of sequencer ports to be created */
34 int max_voices; /* maximum number of voices for wavetable */ 34 int max_voices; /* maximum number of voices for wavetable */
35} snd_emu10k1_synth_arg_t; 35};
36 36
37#define EMU10K1_MAX_MEMSIZE (32 * 1024 * 1024) /* 32MB */ 37#define EMU10K1_MAX_MEMSIZE (32 * 1024 * 1024) /* 32MB */
38 38
diff --git a/include/sound/emu8000.h b/include/sound/emu8000.h
index 4362c54e09d0..c8f66bde6d95 100644
--- a/include/sound/emu8000.h
+++ b/include/sound/emu8000.h
@@ -56,9 +56,9 @@ enum {
56 * some of the channels may be used for other things so max_channels is 56 * some of the channels may be used for other things so max_channels is
57 * the number in use for wave voices. 57 * the number in use for wave voices.
58 */ 58 */
59typedef struct snd_emu8000 { 59struct snd_emu8000 {
60 60
61 snd_emux_t *emu; 61 struct snd_emux *emu;
62 62
63 int index; /* sequencer client index */ 63 int index; /* sequencer client index */
64 int seq_ports; /* number of sequencer ports */ 64 int seq_ports; /* number of sequencer ports */
@@ -77,44 +77,45 @@ typedef struct snd_emu8000 {
77 77
78 int dram_checked; 78 int dram_checked;
79 79
80 snd_card_t *card; /* The card that this belongs to */ 80 struct snd_card *card; /* The card that this belongs to */
81 81
82 int chorus_mode; 82 int chorus_mode;
83 int reverb_mode; 83 int reverb_mode;
84 int bass_level; 84 int bass_level;
85 int treble_level; 85 int treble_level;
86 86
87 snd_util_memhdr_t *memhdr; 87 struct snd_util_memhdr *memhdr;
88 88
89 spinlock_t control_lock; 89 spinlock_t control_lock;
90 snd_kcontrol_t *controls[EMU8000_NUM_CONTROLS]; 90 struct snd_kcontrol *controls[EMU8000_NUM_CONTROLS];
91 91
92 snd_pcm_t *pcm; /* pcm on emu8000 wavetable */ 92 struct snd_pcm *pcm; /* pcm on emu8000 wavetable */
93 93
94} emu8000_t; 94};
95 95
96/* sequencer device id */ 96/* sequencer device id */
97#define SNDRV_SEQ_DEV_ID_EMU8000 "emu8000-synth" 97#define SNDRV_SEQ_DEV_ID_EMU8000 "emu8000-synth"
98 98
99 99
100/* exported functions */ 100/* exported functions */
101int snd_emu8000_new(snd_card_t *card, int device, long port, int seq_ports, snd_seq_device_t **ret); 101int snd_emu8000_new(struct snd_card *card, int device, long port, int seq_ports,
102void snd_emu8000_poke(emu8000_t *emu, unsigned int port, unsigned int reg, 102 struct snd_seq_device **ret);
103void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
103 unsigned int val); 104 unsigned int val);
104unsigned short snd_emu8000_peek(emu8000_t *emu, unsigned int port, 105unsigned short snd_emu8000_peek(struct snd_emu8000 *emu, unsigned int port,
105 unsigned int reg); 106 unsigned int reg);
106void snd_emu8000_poke_dw(emu8000_t *emu, unsigned int port, unsigned int reg, 107void snd_emu8000_poke_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg,
107 unsigned int val); 108 unsigned int val);
108unsigned int snd_emu8000_peek_dw(emu8000_t *emu, unsigned int port, 109unsigned int snd_emu8000_peek_dw(struct snd_emu8000 *emu, unsigned int port,
109 unsigned int reg); 110 unsigned int reg);
110void snd_emu8000_dma_chan(emu8000_t *emu, int ch, int mode); 111void snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode);
111 112
112void snd_emu8000_init_fm(emu8000_t *emu); 113void snd_emu8000_init_fm(struct snd_emu8000 *emu);
113 114
114void snd_emu8000_update_chorus_mode(emu8000_t *emu); 115void snd_emu8000_update_chorus_mode(struct snd_emu8000 *emu);
115void snd_emu8000_update_reverb_mode(emu8000_t *emu); 116void snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu);
116void snd_emu8000_update_equalizer(emu8000_t *emu); 117void snd_emu8000_update_equalizer(struct snd_emu8000 *emu);
117int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len); 118int snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
118int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len); 119int snd_emu8000_load_reverb_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len);
119 120
120#endif /* __SOUND_EMU8000_H */ 121#endif /* __SOUND_EMU8000_H */
diff --git a/include/sound/emux_synth.h b/include/sound/emux_synth.h
index c6970aac9bdc..b2d6b2acc7c7 100644
--- a/include/sound/emux_synth.h
+++ b/include/sound/emux_synth.h
@@ -36,39 +36,40 @@
36 */ 36 */
37#define SNDRV_EMUX_USE_RAW_EFFECT 37#define SNDRV_EMUX_USE_RAW_EFFECT
38 38
39 39struct snd_emux;
40/* 40struct snd_emux_port;
41 * typedefs 41struct snd_emux_voice;
42 */ 42struct snd_emux_effect_table;
43typedef struct snd_emux_effect_table snd_emux_effect_table_t;
44typedef struct snd_emux_port snd_emux_port_t;
45typedef struct snd_emux_voice snd_emux_voice_t;
46typedef struct snd_emux snd_emux_t;
47
48 43
49/* 44/*
50 * operators 45 * operators
51 */ 46 */
52typedef struct snd_emux_operators { 47struct snd_emux_operators {
53 struct module *owner; 48 struct module *owner;
54 snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port); 49 struct snd_emux_voice *(*get_voice)(struct snd_emux *emu,
55 int (*prepare)(snd_emux_voice_t *vp); 50 struct snd_emux_port *port);
56 void (*trigger)(snd_emux_voice_t *vp); 51 int (*prepare)(struct snd_emux_voice *vp);
57 void (*release)(snd_emux_voice_t *vp); 52 void (*trigger)(struct snd_emux_voice *vp);
58 void (*update)(snd_emux_voice_t *vp, int update); 53 void (*release)(struct snd_emux_voice *vp);
59 void (*terminate)(snd_emux_voice_t *vp); 54 void (*update)(struct snd_emux_voice *vp, int update);
60 void (*free_voice)(snd_emux_voice_t *vp); 55 void (*terminate)(struct snd_emux_voice *vp);
61 void (*reset)(snd_emux_t *emu, int ch); 56 void (*free_voice)(struct snd_emux_voice *vp);
62 /* the first parameters are snd_emux_t */ 57 void (*reset)(struct snd_emux *emu, int ch);
63 int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void __user *data, long count); 58 /* the first parameters are struct snd_emux */
64 int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr); 59 int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp,
65 void (*sample_reset)(snd_emux_t *emu); 60 struct snd_util_memhdr *hdr,
66 int (*load_fx)(snd_emux_t *emu, int type, int arg, const void __user *data, long count); 61 const void __user *data, long count);
67 void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 62 int (*sample_free)(struct snd_emux *emu, struct snd_sf_sample *sp,
63 struct snd_util_memhdr *hdr);
64 void (*sample_reset)(struct snd_emux *emu);
65 int (*load_fx)(struct snd_emux *emu, int type, int arg,
66 const void __user *data, long count);
67 void (*sysex)(struct snd_emux *emu, char *buf, int len, int parsed,
68 struct snd_midi_channel_set *chset);
68#ifdef CONFIG_SND_SEQUENCER_OSS 69#ifdef CONFIG_SND_SEQUENCER_OSS
69 int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2); 70 int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2);
70#endif 71#endif
71} snd_emux_operators_t; 72};
72 73
73 74
74/* 75/*
@@ -90,46 +91,46 @@ typedef struct snd_emux_operators {
90 */ 91 */
91struct snd_emux { 92struct snd_emux {
92 93
93 snd_card_t *card; /* assigned card */ 94 struct snd_card *card; /* assigned card */
94 95
95 /* following should be initialized before registration */ 96 /* following should be initialized before registration */
96 int max_voices; /* Number of voices */ 97 int max_voices; /* Number of voices */
97 int mem_size; /* memory size (in byte) */ 98 int mem_size; /* memory size (in byte) */
98 int num_ports; /* number of ports to be created */ 99 int num_ports; /* number of ports to be created */
99 int pitch_shift; /* pitch shift value (for Emu10k1) */ 100 int pitch_shift; /* pitch shift value (for Emu10k1) */
100 snd_emux_operators_t ops; /* operators */ 101 struct snd_emux_operators ops; /* operators */
101 void *hw; /* hardware */ 102 void *hw; /* hardware */
102 unsigned long flags; /* other conditions */ 103 unsigned long flags; /* other conditions */
103 int midi_ports; /* number of virtual midi devices */ 104 int midi_ports; /* number of virtual midi devices */
104 int midi_devidx; /* device offset of virtual midi */ 105 int midi_devidx; /* device offset of virtual midi */
105 unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */ 106 unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */
106 int hwdep_idx; /* hwdep device index */ 107 int hwdep_idx; /* hwdep device index */
107 snd_hwdep_t *hwdep; /* hwdep device */ 108 struct snd_hwdep *hwdep; /* hwdep device */
108 109
109 /* private */ 110 /* private */
110 int num_voices; /* current number of voices */ 111 int num_voices; /* current number of voices */
111 snd_sf_list_t *sflist; /* root of SoundFont list */ 112 struct snd_sf_list *sflist; /* root of SoundFont list */
112 snd_emux_voice_t *voices; /* Voices (EMU 'channel') */ 113 struct snd_emux_voice *voices; /* Voices (EMU 'channel') */
113 int use_time; /* allocation counter */ 114 int use_time; /* allocation counter */
114 spinlock_t voice_lock; /* Lock for voice access */ 115 spinlock_t voice_lock; /* Lock for voice access */
115 struct semaphore register_mutex; 116 struct semaphore register_mutex;
116 int client; /* For the sequencer client */ 117 int client; /* For the sequencer client */
117 int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */ 118 int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */
118 snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS]; 119 struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS];
119 int used; /* use counter */ 120 int used; /* use counter */
120 char *name; /* name of the device (internal) */ 121 char *name; /* name of the device (internal) */
121 snd_rawmidi_t **vmidi; 122 struct snd_rawmidi **vmidi;
122 struct timer_list tlist; /* for pending note-offs */ 123 struct timer_list tlist; /* for pending note-offs */
123 int timer_active; 124 int timer_active;
124 125
125 snd_util_memhdr_t *memhdr; /* memory chunk information */ 126 struct snd_util_memhdr *memhdr; /* memory chunk information */
126 127
127#ifdef CONFIG_PROC_FS 128#ifdef CONFIG_PROC_FS
128 snd_info_entry_t *proc; 129 struct snd_info_entry *proc;
129#endif 130#endif
130 131
131#ifdef CONFIG_SND_SEQUENCER_OSS 132#ifdef CONFIG_SND_SEQUENCER_OSS
132 snd_seq_device_t *oss_synth; 133 struct snd_seq_device *oss_synth;
133#endif 134#endif
134}; 135};
135 136
@@ -139,18 +140,18 @@ struct snd_emux {
139 */ 140 */
140struct snd_emux_port { 141struct snd_emux_port {
141 142
142 snd_midi_channel_set_t chset; 143 struct snd_midi_channel_set chset;
143 snd_emux_t *emu; 144 struct snd_emux *emu;
144 145
145 char port_mode; /* operation mode */ 146 char port_mode; /* operation mode */
146 int volume_atten; /* emuX raw attenuation */ 147 int volume_atten; /* emuX raw attenuation */
147 unsigned long drum_flags; /* drum bitmaps */ 148 unsigned long drum_flags; /* drum bitmaps */
148 int ctrls[EMUX_MD_END]; /* control parameters */ 149 int ctrls[EMUX_MD_END]; /* control parameters */
149#ifdef SNDRV_EMUX_USE_RAW_EFFECT 150#ifdef SNDRV_EMUX_USE_RAW_EFFECT
150 snd_emux_effect_table_t *effect; 151 struct snd_emux_effect_table *effect;
151#endif 152#endif
152#ifdef CONFIG_SND_SEQUENCER_OSS 153#ifdef CONFIG_SND_SEQUENCER_OSS
153 snd_seq_oss_arg_t *oss_arg; 154 struct snd_seq_oss_arg *oss_arg;
154#endif 155#endif
155}; 156};
156 157
@@ -179,16 +180,16 @@ struct snd_emux_voice {
179 unsigned char key; 180 unsigned char key;
180 unsigned char velocity; /* Velocity of current note */ 181 unsigned char velocity; /* Velocity of current note */
181 182
182 snd_sf_zone_t *zone; /* Zone assigned to this note */ 183 struct snd_sf_zone *zone; /* Zone assigned to this note */
183 void *block; /* sample block pointer (optional) */ 184 void *block; /* sample block pointer (optional) */
184 snd_midi_channel_t *chan; /* Midi channel for this note */ 185 struct snd_midi_channel *chan; /* Midi channel for this note */
185 snd_emux_port_t *port; /* associated port */ 186 struct snd_emux_port *port; /* associated port */
186 snd_emux_t *emu; /* assigned root info */ 187 struct snd_emux *emu; /* assigned root info */
187 void *hw; /* hardware pointer (emu8000_t or emu10k1_t) */ 188 void *hw; /* hardware pointer (emu8000 or emu10k1) */
188 unsigned long ontime; /* jiffies at note triggered */ 189 unsigned long ontime; /* jiffies at note triggered */
189 190
190 /* Emu8k/Emu10k1 registers */ 191 /* Emu8k/Emu10k1 registers */
191 soundfont_voice_info_t reg; 192 struct soundfont_voice_info reg;
192 193
193 /* additional registers */ 194 /* additional registers */
194 int avol; /* volume attenuation */ 195 int avol; /* volume attenuation */
@@ -229,15 +230,15 @@ struct snd_emux_effect_table {
229/* 230/*
230 * prototypes - interface to Emu10k1 and Emu8k routines 231 * prototypes - interface to Emu10k1 and Emu8k routines
231 */ 232 */
232int snd_emux_new(snd_emux_t **remu); 233int snd_emux_new(struct snd_emux **remu);
233int snd_emux_register(snd_emux_t *emu, snd_card_t *card, int index, char *name); 234int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name);
234int snd_emux_free(snd_emux_t *emu); 235int snd_emux_free(struct snd_emux *emu);
235 236
236/* 237/*
237 * exported functions 238 * exported functions
238 */ 239 */
239void snd_emux_terminate_all(snd_emux_t *emu); 240void snd_emux_terminate_all(struct snd_emux *emu);
240void snd_emux_lock_voice(snd_emux_t *emu, int voice); 241void snd_emux_lock_voice(struct snd_emux *emu, int voice);
241void snd_emux_unlock_voice(snd_emux_t *emu, int voice); 242void snd_emux_unlock_voice(struct snd_emux *emu, int voice);
242 243
243#endif /* __SOUND_EMUX_SYNTH_H */ 244#endif /* __SOUND_EMUX_SYNTH_H */
diff --git a/include/sound/es1688.h b/include/sound/es1688.h
index 604f495bc8b1..fc1c47dae3da 100644
--- a/include/sound/es1688.h
+++ b/include/sound/es1688.h
@@ -30,7 +30,7 @@
30#define ES1688_HW_688 0x0001 30#define ES1688_HW_688 0x0001
31#define ES1688_HW_1688 0x0002 31#define ES1688_HW_1688 0x0002
32 32
33struct _snd_es1688 { 33struct snd_es1688 {
34 unsigned long port; /* port of ESS chip */ 34 unsigned long port; /* port of ESS chip */
35 struct resource *res_port; 35 struct resource *res_port;
36 unsigned long mpu_port; /* MPU-401 port of ESS chip */ 36 unsigned long mpu_port; /* MPU-401 port of ESS chip */
@@ -44,17 +44,15 @@ struct _snd_es1688 {
44 unsigned char pad; 44 unsigned char pad;
45 unsigned int dma_size; 45 unsigned int dma_size;
46 46
47 snd_card_t *card; 47 struct snd_card *card;
48 snd_pcm_t *pcm; 48 struct snd_pcm *pcm;
49 snd_pcm_substream_t *playback_substream; 49 struct snd_pcm_substream *playback_substream;
50 snd_pcm_substream_t *capture_substream; 50 struct snd_pcm_substream *capture_substream;
51 51
52 spinlock_t reg_lock; 52 spinlock_t reg_lock;
53 spinlock_t mixer_lock; 53 spinlock_t mixer_lock;
54}; 54};
55 55
56typedef struct _snd_es1688 es1688_t;
57
58/* I/O ports */ 56/* I/O ports */
59 57
60#define ES1688P(codec, x) ((codec)->port + e_s_s_ESS1688##x) 58#define ES1688P(codec, x) ((codec)->port + e_s_s_ESS1688##x)
@@ -107,17 +105,17 @@ typedef struct _snd_es1688 es1688_t;
107 105
108 */ 106 */
109 107
110void snd_es1688_mixer_write(es1688_t *chip, unsigned char reg, unsigned char data); 108void snd_es1688_mixer_write(struct snd_es1688 *chip, unsigned char reg, unsigned char data);
111 109
112int snd_es1688_create(snd_card_t * card, 110int snd_es1688_create(struct snd_card *card,
113 unsigned long port, 111 unsigned long port,
114 unsigned long mpu_port, 112 unsigned long mpu_port,
115 int irq, 113 int irq,
116 int mpu_irq, 114 int mpu_irq,
117 int dma8, 115 int dma8,
118 unsigned short hardware, 116 unsigned short hardware,
119 es1688_t ** rchip); 117 struct snd_es1688 ** rchip);
120int snd_es1688_pcm(es1688_t *chip, int device, snd_pcm_t ** rpcm); 118int snd_es1688_pcm(struct snd_es1688 *chip, int device, struct snd_pcm ** rpcm);
121int snd_es1688_mixer(es1688_t *chip); 119int snd_es1688_mixer(struct snd_es1688 *chip);
122 120
123#endif /* __SOUND_ES1688_H */ 121#endif /* __SOUND_ES1688_H */
diff --git a/include/sound/gus.h b/include/sound/gus.h
index 7000d9d9199d..63da50fae773 100644
--- a/include/sound/gus.h
+++ b/include/sound/gus.h
@@ -49,32 +49,32 @@
49#define SNDRV_g_u_s_IRQSTAT (0x226-0x220) 49#define SNDRV_g_u_s_IRQSTAT (0x226-0x220)
50#define SNDRV_g_u_s_TIMERCNTRL (0x228-0x220) 50#define SNDRV_g_u_s_TIMERCNTRL (0x228-0x220)
51#define SNDRV_g_u_s_TIMERDATA (0x229-0x220) 51#define SNDRV_g_u_s_TIMERDATA (0x229-0x220)
52#define SNDRV_g_u_s_DRAM (0x327-0x220) 52#define SNDRV_g_u_s_DRAM (0x327-0x220)
53#define SNDRV_g_u_s_MIXCNTRLREG (0x220-0x220) 53#define SNDRV_g_u_s_MIXCNTRLREG (0x220-0x220)
54#define SNDRV_g_u_s_IRQDMACNTRLREG (0x22b-0x220) 54#define SNDRV_g_u_s_IRQDMACNTRLREG (0x22b-0x220)
55#define SNDRV_g_u_s_REGCNTRLS (0x22f-0x220) 55#define SNDRV_g_u_s_REGCNTRLS (0x22f-0x220)
56#define SNDRV_g_u_s_BOARDVERSION (0x726-0x220) 56#define SNDRV_g_u_s_BOARDVERSION (0x726-0x220)
57#define SNDRV_g_u_s_MIXCNTRLPORT (0x726-0x220) 57#define SNDRV_g_u_s_MIXCNTRLPORT (0x726-0x220)
58#define SNDRV_g_u_s_IVER (0x325-0x220) 58#define SNDRV_g_u_s_IVER (0x325-0x220)
59#define SNDRV_g_u_s_MIXDATAPORT (0x326-0x220) 59#define SNDRV_g_u_s_MIXDATAPORT (0x326-0x220)
60#define SNDRV_g_u_s_MAXCNTRLPORT (0x326-0x220) 60#define SNDRV_g_u_s_MAXCNTRLPORT (0x326-0x220)
61 61
62/* GF1 registers */ 62/* GF1 registers */
63 63
64/* global registers */ 64/* global registers */
65#define SNDRV_GF1_GB_ACTIVE_VOICES 0x0e 65#define SNDRV_GF1_GB_ACTIVE_VOICES 0x0e
66#define SNDRV_GF1_GB_VOICES_IRQ 0x0f 66#define SNDRV_GF1_GB_VOICES_IRQ 0x0f
67#define SNDRV_GF1_GB_GLOBAL_MODE 0x19 67#define SNDRV_GF1_GB_GLOBAL_MODE 0x19
68#define SNDRV_GF1_GW_LFO_BASE 0x1a 68#define SNDRV_GF1_GW_LFO_BASE 0x1a
69#define SNDRV_GF1_GB_VOICES_IRQ_READ 0x1f 69#define SNDRV_GF1_GB_VOICES_IRQ_READ 0x1f
70#define SNDRV_GF1_GB_DRAM_DMA_CONTROL 0x41 70#define SNDRV_GF1_GB_DRAM_DMA_CONTROL 0x41
71#define SNDRV_GF1_GW_DRAM_DMA_LOW 0x42 71#define SNDRV_GF1_GW_DRAM_DMA_LOW 0x42
72#define SNDRV_GF1_GW_DRAM_IO_LOW 0x43 72#define SNDRV_GF1_GW_DRAM_IO_LOW 0x43
73#define SNDRV_GF1_GB_DRAM_IO_HIGH 0x44 73#define SNDRV_GF1_GB_DRAM_IO_HIGH 0x44
74#define SNDRV_GF1_GB_SOUND_BLASTER_CONTROL 0x45 74#define SNDRV_GF1_GB_SOUND_BLASTER_CONTROL 0x45
75#define SNDRV_GF1_GB_ADLIB_TIMER_1 0x46 75#define SNDRV_GF1_GB_ADLIB_TIMER_1 0x46
76#define SNDRV_GF1_GB_ADLIB_TIMER_2 0x47 76#define SNDRV_GF1_GB_ADLIB_TIMER_2 0x47
77#define SNDRV_GF1_GB_RECORD_RATE 0x48 77#define SNDRV_GF1_GB_RECORD_RATE 0x48
78#define SNDRV_GF1_GB_REC_DMA_CONTROL 0x49 78#define SNDRV_GF1_GB_REC_DMA_CONTROL 0x49
79#define SNDRV_GF1_GB_JOYSTICK_DAC_LEVEL 0x4b 79#define SNDRV_GF1_GB_JOYSTICK_DAC_LEVEL 0x4b
80#define SNDRV_GF1_GB_RESET 0x4c 80#define SNDRV_GF1_GB_RESET 0x4c
@@ -83,7 +83,7 @@
83#define SNDRV_GF1_GW_MEMORY_CONFIG 0x52 83#define SNDRV_GF1_GW_MEMORY_CONFIG 0x52
84#define SNDRV_GF1_GB_MEMORY_CONTROL 0x53 84#define SNDRV_GF1_GB_MEMORY_CONTROL 0x53
85#define SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR 0x54 85#define SNDRV_GF1_GW_FIFO_RECORD_BASE_ADDR 0x54
86#define SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR 0x55 86#define SNDRV_GF1_GW_FIFO_PLAY_BASE_ADDR 0x55
87#define SNDRV_GF1_GW_FIFO_SIZE 0x56 87#define SNDRV_GF1_GW_FIFO_SIZE 0x56
88#define SNDRV_GF1_GW_INTERLEAVE 0x57 88#define SNDRV_GF1_GW_INTERLEAVE 0x57
89#define SNDRV_GF1_GB_COMPATIBILITY 0x59 89#define SNDRV_GF1_GB_COMPATIBILITY 0x59
@@ -100,39 +100,39 @@
100#define SNDRV_GF1_VA_START SNDRV_GF1_VW_START_HIGH 100#define SNDRV_GF1_VA_START SNDRV_GF1_VW_START_HIGH
101#define SNDRV_GF1_VW_END_HIGH 0x04 101#define SNDRV_GF1_VW_END_HIGH 0x04
102#define SNDRV_GF1_VW_END_LOW 0x05 102#define SNDRV_GF1_VW_END_LOW 0x05
103#define SNDRV_GF1_VA_END SNDRV_GF1_VW_END_HIGH 103#define SNDRV_GF1_VA_END SNDRV_GF1_VW_END_HIGH
104#define SNDRV_GF1_VB_VOLUME_RATE 0x06 104#define SNDRV_GF1_VB_VOLUME_RATE 0x06
105#define SNDRV_GF1_VB_VOLUME_START 0x07 105#define SNDRV_GF1_VB_VOLUME_START 0x07
106#define SNDRV_GF1_VB_VOLUME_END 0x08 106#define SNDRV_GF1_VB_VOLUME_END 0x08
107#define SNDRV_GF1_VW_VOLUME 0x09 107#define SNDRV_GF1_VW_VOLUME 0x09
108#define SNDRV_GF1_VW_CURRENT_HIGH 0x0a 108#define SNDRV_GF1_VW_CURRENT_HIGH 0x0a
109#define SNDRV_GF1_VW_CURRENT_LOW 0x0b 109#define SNDRV_GF1_VW_CURRENT_LOW 0x0b
110#define SNDRV_GF1_VA_CURRENT SNDRV_GF1_VW_CURRENT_HIGH 110#define SNDRV_GF1_VA_CURRENT SNDRV_GF1_VW_CURRENT_HIGH
111#define SNDRV_GF1_VB_PAN 0x0c 111#define SNDRV_GF1_VB_PAN 0x0c
112#define SNDRV_GF1_VW_OFFSET_RIGHT 0x0c 112#define SNDRV_GF1_VW_OFFSET_RIGHT 0x0c
113#define SNDRV_GF1_VB_VOLUME_CONTROL 0x0d 113#define SNDRV_GF1_VB_VOLUME_CONTROL 0x0d
114#define SNDRV_GF1_VB_UPPER_ADDRESS 0x10 114#define SNDRV_GF1_VB_UPPER_ADDRESS 0x10
115#define SNDRV_GF1_VW_EFFECT_HIGH 0x11 115#define SNDRV_GF1_VW_EFFECT_HIGH 0x11
116#define SNDRV_GF1_VW_EFFECT_LOW 0x12 116#define SNDRV_GF1_VW_EFFECT_LOW 0x12
117#define SNDRV_GF1_VA_EFFECT SNDRV_GF1_VW_EFFECT_HIGH 117#define SNDRV_GF1_VA_EFFECT SNDRV_GF1_VW_EFFECT_HIGH
118#define SNDRV_GF1_VW_OFFSET_LEFT 0x13 118#define SNDRV_GF1_VW_OFFSET_LEFT 0x13
119#define SNDRV_GF1_VB_ACCUMULATOR 0x14 119#define SNDRV_GF1_VB_ACCUMULATOR 0x14
120#define SNDRV_GF1_VB_MODE 0x15 120#define SNDRV_GF1_VB_MODE 0x15
121#define SNDRV_GF1_VW_EFFECT_VOLUME 0x16 121#define SNDRV_GF1_VW_EFFECT_VOLUME 0x16
122#define SNDRV_GF1_VB_FREQUENCY_LFO 0x17 122#define SNDRV_GF1_VB_FREQUENCY_LFO 0x17
123#define SNDRV_GF1_VB_VOLUME_LFO 0x18 123#define SNDRV_GF1_VB_VOLUME_LFO 0x18
124#define SNDRV_GF1_VW_OFFSET_RIGHT_FINAL 0x1b 124#define SNDRV_GF1_VW_OFFSET_RIGHT_FINAL 0x1b
125#define SNDRV_GF1_VW_OFFSET_LEFT_FINAL 0x1c 125#define SNDRV_GF1_VW_OFFSET_LEFT_FINAL 0x1c
126#define SNDRV_GF1_VW_EFFECT_VOLUME_FINAL 0x1d 126#define SNDRV_GF1_VW_EFFECT_VOLUME_FINAL 0x1d
127 127
128/* ICS registers */ 128/* ICS registers */
129 129
130#define SNDRV_ICS_MIC_DEV 0 130#define SNDRV_ICS_MIC_DEV 0
131#define SNDRV_ICS_LINE_DEV 1 131#define SNDRV_ICS_LINE_DEV 1
132#define SNDRV_ICS_CD_DEV 2 132#define SNDRV_ICS_CD_DEV 2
133#define SNDRV_ICS_GF1_DEV 3 133#define SNDRV_ICS_GF1_DEV 3
134#define SNDRV_ICS_NONE_DEV 4 134#define SNDRV_ICS_NONE_DEV 4
135#define SNDRV_ICS_MASTER_DEV 5 135#define SNDRV_ICS_MASTER_DEV 5
136 136
137/* LFO */ 137/* LFO */
138 138
@@ -143,7 +143,7 @@
143 143
144#define SNDRV_GF1_DMA_UNSIGNED 0x80 144#define SNDRV_GF1_DMA_UNSIGNED 0x80
145#define SNDRV_GF1_DMA_16BIT 0x40 145#define SNDRV_GF1_DMA_16BIT 0x40
146#define SNDRV_GF1_DMA_IRQ 0x20 146#define SNDRV_GF1_DMA_IRQ 0x20
147#define SNDRV_GF1_DMA_WIDTH16 0x04 147#define SNDRV_GF1_DMA_WIDTH16 0x04
148#define SNDRV_GF1_DMA_READ 0x02 /* read from GUS's DRAM */ 148#define SNDRV_GF1_DMA_READ 0x02 /* read from GUS's DRAM */
149#define SNDRV_GF1_DMA_ENABLE 0x01 149#define SNDRV_GF1_DMA_ENABLE 0x01
@@ -159,7 +159,7 @@
159 159
160/* defines for memory manager */ 160/* defines for memory manager */
161 161
162#define SNDRV_GF1_MEM_BLOCK_16BIT 0x0001 162#define SNDRV_GF1_MEM_BLOCK_16BIT 0x0001
163 163
164#define SNDRV_GF1_MEM_OWNER_DRIVER 0x0001 164#define SNDRV_GF1_MEM_OWNER_DRIVER 0x0001
165#define SNDRV_GF1_MEM_OWNER_WAVE_SIMPLE 0x0002 165#define SNDRV_GF1_MEM_OWNER_WAVE_SIMPLE 0x0002
@@ -169,9 +169,9 @@
169/* constants for interrupt handlers */ 169/* constants for interrupt handlers */
170 170
171#define SNDRV_GF1_HANDLER_MIDI_OUT 0x00010000 171#define SNDRV_GF1_HANDLER_MIDI_OUT 0x00010000
172#define SNDRV_GF1_HANDLER_MIDI_IN 0x00020000 172#define SNDRV_GF1_HANDLER_MIDI_IN 0x00020000
173#define SNDRV_GF1_HANDLER_TIMER1 0x00040000 173#define SNDRV_GF1_HANDLER_TIMER1 0x00040000
174#define SNDRV_GF1_HANDLER_TIMER2 0x00080000 174#define SNDRV_GF1_HANDLER_TIMER2 0x00080000
175#define SNDRV_GF1_HANDLER_VOICE 0x00100000 175#define SNDRV_GF1_HANDLER_VOICE 0x00100000
176#define SNDRV_GF1_HANDLER_DMA_WRITE 0x00200000 176#define SNDRV_GF1_HANDLER_DMA_WRITE 0x00200000
177#define SNDRV_GF1_HANDLER_DMA_READ 0x00400000 177#define SNDRV_GF1_HANDLER_DMA_READ 0x00400000
@@ -183,17 +183,16 @@
183 183
184/* --- */ 184/* --- */
185 185
186struct _snd_gus_card; 186struct snd_gus_card;
187typedef struct _snd_gus_card snd_gus_card_t;
188 187
189/* GF1 specific structure */ 188/* GF1 specific structure */
190 189
191typedef struct _snd_gf1_bank_info { 190struct snd_gf1_bank_info {
192 unsigned int address; 191 unsigned int address;
193 unsigned int size; 192 unsigned int size;
194} snd_gf1_bank_info_t; 193};
195 194
196typedef struct _snd_gf1_mem_block { 195struct snd_gf1_mem_block {
197 unsigned short flags; /* flags - SNDRV_GF1_MEM_BLOCK_XXXX */ 196 unsigned short flags; /* flags - SNDRV_GF1_MEM_BLOCK_XXXX */
198 unsigned short owner; /* owner - SNDRV_GF1_MEM_OWNER_XXXX */ 197 unsigned short owner; /* owner - SNDRV_GF1_MEM_OWNER_XXXX */
199 unsigned int share; /* share count */ 198 unsigned int share; /* share count */
@@ -201,68 +200,68 @@ typedef struct _snd_gf1_mem_block {
201 unsigned int ptr; 200 unsigned int ptr;
202 unsigned int size; 201 unsigned int size;
203 char *name; 202 char *name;
204 struct _snd_gf1_mem_block *next; 203 struct snd_gf1_mem_block *next;
205 struct _snd_gf1_mem_block *prev; 204 struct snd_gf1_mem_block *prev;
206} snd_gf1_mem_block_t; 205};
207 206
208typedef struct _snd_gf1_mem { 207struct snd_gf1_mem {
209 snd_gf1_bank_info_t banks_8[4]; 208 struct snd_gf1_bank_info banks_8[4];
210 snd_gf1_bank_info_t banks_16[4]; 209 struct snd_gf1_bank_info banks_16[4];
211 snd_gf1_mem_block_t *first; 210 struct snd_gf1_mem_block *first;
212 snd_gf1_mem_block_t *last; 211 struct snd_gf1_mem_block *last;
213 struct semaphore memory_mutex; 212 struct semaphore memory_mutex;
214} snd_gf1_mem_t; 213};
215 214
216typedef struct snd_gf1_dma_block { 215struct snd_gf1_dma_block {
217 void *buffer; /* buffer in computer's RAM */ 216 void *buffer; /* buffer in computer's RAM */
218 unsigned long buf_addr; /* buffer address */ 217 unsigned long buf_addr; /* buffer address */
219 unsigned int addr; /* address in onboard memory */ 218 unsigned int addr; /* address in onboard memory */
220 unsigned int count; /* count in bytes */ 219 unsigned int count; /* count in bytes */
221 unsigned int cmd; /* DMA command (format) */ 220 unsigned int cmd; /* DMA command (format) */
222 void (*ack)(snd_gus_card_t * gus, void *private_data); 221 void (*ack)(struct snd_gus_card * gus, void *private_data);
223 void *private_data; 222 void *private_data;
224 struct snd_gf1_dma_block *next; 223 struct snd_gf1_dma_block *next;
225} snd_gf1_dma_block_t; 224};
226 225
227typedef struct { 226struct snd_gus_port {
228 snd_midi_channel_set_t * chset; 227 struct snd_midi_channel_set * chset;
229 snd_gus_card_t * gus; 228 struct snd_gus_card * gus;
230 int mode; /* operation mode */ 229 int mode; /* operation mode */
231 int client; /* sequencer client number */ 230 int client; /* sequencer client number */
232 int port; /* sequencer port number */ 231 int port; /* sequencer port number */
233 unsigned int midi_has_voices: 1; 232 unsigned int midi_has_voices: 1;
234} snd_gus_port_t; 233};
235 234
236typedef struct _snd_gus_voice snd_gus_voice_t; 235struct snd_gus_voice;
237 236
238typedef struct { 237struct snd_gus_sample_ops {
239 void (*sample_start)(snd_gus_card_t *gus, snd_gus_voice_t *voice, snd_seq_position_t position); 238 void (*sample_start)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_position_t position);
240 void (*sample_stop)(snd_gus_card_t *gus, snd_gus_voice_t *voice, snd_seq_stop_mode_t mode); 239 void (*sample_stop)(struct snd_gus_card *gus, struct snd_gus_voice *voice, int mode);
241 void (*sample_freq)(snd_gus_card_t *gus, snd_gus_voice_t *voice, snd_seq_frequency_t freq); 240 void (*sample_freq)(struct snd_gus_card *gus, struct snd_gus_voice *voice, snd_seq_frequency_t freq);
242 void (*sample_volume)(snd_gus_card_t *gus, snd_gus_voice_t *voice, snd_seq_ev_volume_t *volume); 241 void (*sample_volume)(struct snd_gus_card *gus, struct snd_gus_voice *voice, struct snd_seq_ev_volume *volume);
243 void (*sample_loop)(snd_gus_card_t *card, snd_gus_voice_t *voice, snd_seq_ev_loop_t *loop); 242 void (*sample_loop)(struct snd_gus_card *card, struct snd_gus_voice *voice, struct snd_seq_ev_loop *loop);
244 void (*sample_pos)(snd_gus_card_t *card, snd_gus_voice_t *voice, snd_seq_position_t position); 243 void (*sample_pos)(struct snd_gus_card *card, struct snd_gus_voice *voice, snd_seq_position_t position);
245 void (*sample_private1)(snd_gus_card_t *card, snd_gus_voice_t *voice, unsigned char *data); 244 void (*sample_private1)(struct snd_gus_card *card, struct snd_gus_voice *voice, unsigned char *data);
246} snd_gus_sample_ops_t; 245};
247 246
248#define SNDRV_GF1_VOICE_TYPE_PCM 0 247#define SNDRV_GF1_VOICE_TYPE_PCM 0
249#define SNDRV_GF1_VOICE_TYPE_SYNTH 1 248#define SNDRV_GF1_VOICE_TYPE_SYNTH 1
250#define SNDRV_GF1_VOICE_TYPE_MIDI 2 249#define SNDRV_GF1_VOICE_TYPE_MIDI 2
251 250
252#define SNDRV_GF1_VFLG_RUNNING (1<<0) 251#define SNDRV_GF1_VFLG_RUNNING (1<<0)
253#define SNDRV_GF1_VFLG_EFFECT_TIMER1 (1<<1) 252#define SNDRV_GF1_VFLG_EFFECT_TIMER1 (1<<1)
254#define SNDRV_GF1_VFLG_PAN (1<<2) 253#define SNDRV_GF1_VFLG_PAN (1<<2)
255 254
256typedef enum { 255enum snd_gus_volume_state {
257 VENV_BEFORE, 256 VENV_BEFORE,
258 VENV_ATTACK, 257 VENV_ATTACK,
259 VENV_SUSTAIN, 258 VENV_SUSTAIN,
260 VENV_RELEASE, 259 VENV_RELEASE,
261 VENV_DONE, 260 VENV_DONE,
262 VENV_VOLUME 261 VENV_VOLUME
263} snd_gus_volume_state_t; 262};
264 263
265struct _snd_gus_voice { 264struct snd_gus_voice {
266 int number; 265 int number;
267 unsigned int use: 1, 266 unsigned int use: 1,
268 pcm: 1, 267 pcm: 1,
@@ -278,18 +277,18 @@ struct _snd_gus_voice {
278 unsigned int interrupt_stat_wave; 277 unsigned int interrupt_stat_wave;
279 unsigned int interrupt_stat_volume; 278 unsigned int interrupt_stat_volume;
280#endif 279#endif
281 void (*handler_wave) (snd_gus_card_t * gus, snd_gus_voice_t * voice); 280 void (*handler_wave) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
282 void (*handler_volume) (snd_gus_card_t * gus, snd_gus_voice_t * voice); 281 void (*handler_volume) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
283 void (*handler_effect) (snd_gus_card_t * gus, snd_gus_voice_t * voice); 282 void (*handler_effect) (struct snd_gus_card * gus, struct snd_gus_voice * voice);
284 void (*volume_change) (snd_gus_card_t * gus); 283 void (*volume_change) (struct snd_gus_card * gus);
285 284
286 snd_gus_sample_ops_t *sample_ops; 285 struct snd_gus_sample_ops *sample_ops;
287 286
288 snd_seq_instr_t instr; 287 struct snd_seq_instr instr;
289 288
290 /* running status / registers */ 289 /* running status / registers */
291 290
292 snd_seq_ev_volume_t sample_volume; 291 struct snd_seq_ev_volume sample_volume;
293 292
294 unsigned short fc_register; 293 unsigned short fc_register;
295 unsigned short fc_lfo; 294 unsigned short fc_lfo;
@@ -300,8 +299,8 @@ struct _snd_gus_voice {
300 unsigned char effect_accumulator; 299 unsigned char effect_accumulator;
301 unsigned char volume_control; 300 unsigned char volume_control;
302 unsigned char venv_value_next; 301 unsigned char venv_value_next;
303 snd_gus_volume_state_t venv_state; 302 enum snd_gus_volume_state venv_state;
304 snd_gus_volume_state_t venv_state_prev; 303 enum snd_gus_volume_state venv_state_prev;
305 unsigned short vlo; 304 unsigned short vlo;
306 unsigned short vro; 305 unsigned short vro;
307 unsigned short gf1_effect_volume; 306 unsigned short gf1_effect_volume;
@@ -309,10 +308,10 @@ struct _snd_gus_voice {
309 /* --- */ 308 /* --- */
310 309
311 void *private_data; 310 void *private_data;
312 void (*private_free)(snd_gus_voice_t *voice); 311 void (*private_free)(struct snd_gus_voice *voice);
313}; 312};
314 313
315struct _snd_gf1 { 314struct snd_gf1 {
316 315
317 unsigned int enh_mode:1, /* enhanced mode (GFA1) */ 316 unsigned int enh_mode:1, /* enhanced mode (GFA1) */
318 hw_lfo:1, /* use hardware LFO */ 317 hw_lfo:1, /* use hardware LFO */
@@ -330,7 +329,7 @@ struct _snd_gf1 {
330 unsigned int rom_present; /* bitmask */ 329 unsigned int rom_present; /* bitmask */
331 unsigned int rom_banks; /* GUS's ROM banks */ 330 unsigned int rom_banks; /* GUS's ROM banks */
332 331
333 snd_gf1_mem_t mem_alloc; 332 struct snd_gf1_mem mem_alloc;
334 333
335 /* registers */ 334 /* registers */
336 unsigned short reg_page; 335 unsigned short reg_page;
@@ -347,7 +346,7 @@ struct _snd_gf1 {
347 unsigned char active_voices; /* active voices */ 346 unsigned char active_voices; /* active voices */
348 unsigned char active_voice; /* selected voice (GF1PAGE register) */ 347 unsigned char active_voice; /* selected voice (GF1PAGE register) */
349 348
350 snd_gus_voice_t voices[32]; /* GF1 voices */ 349 struct snd_gus_voice voices[32]; /* GF1 voices */
351 350
352 unsigned int default_voice_address; 351 unsigned int default_voice_address;
353 352
@@ -362,12 +361,12 @@ struct _snd_gf1 {
362 361
363 /* interrupt handlers */ 362 /* interrupt handlers */
364 363
365 void (*interrupt_handler_midi_out) (snd_gus_card_t * gus); 364 void (*interrupt_handler_midi_out) (struct snd_gus_card * gus);
366 void (*interrupt_handler_midi_in) (snd_gus_card_t * gus); 365 void (*interrupt_handler_midi_in) (struct snd_gus_card * gus);
367 void (*interrupt_handler_timer1) (snd_gus_card_t * gus); 366 void (*interrupt_handler_timer1) (struct snd_gus_card * gus);
368 void (*interrupt_handler_timer2) (snd_gus_card_t * gus); 367 void (*interrupt_handler_timer2) (struct snd_gus_card * gus);
369 void (*interrupt_handler_dma_write) (snd_gus_card_t * gus); 368 void (*interrupt_handler_dma_write) (struct snd_gus_card * gus);
370 void (*interrupt_handler_dma_read) (snd_gus_card_t * gus); 369 void (*interrupt_handler_dma_read) (struct snd_gus_card * gus);
371 370
372#ifdef CONFIG_SND_DEBUG 371#ifdef CONFIG_SND_DEBUG
373 unsigned int interrupt_stat_midi_out; 372 unsigned int interrupt_stat_midi_out;
@@ -382,17 +381,17 @@ struct _snd_gf1 {
382 /* synthesizer */ 381 /* synthesizer */
383 382
384 int seq_client; 383 int seq_client;
385 snd_gus_port_t seq_ports[4]; 384 struct snd_gus_port seq_ports[4];
386 snd_seq_kinstr_list_t *ilist; 385 struct snd_seq_kinstr_list *ilist;
387 snd_iwffff_ops_t iwffff_ops; 386 struct snd_iwffff_ops iwffff_ops;
388 snd_gf1_ops_t gf1_ops; 387 struct snd_gf1_ops gf1_ops;
389 snd_simple_ops_t simple_ops; 388 struct snd_simple_ops simple_ops;
390 389
391 /* timer */ 390 /* timer */
392 391
393 unsigned short timer_enabled; 392 unsigned short timer_enabled;
394 snd_timer_t *timer1; 393 struct snd_timer *timer1;
395 snd_timer_t *timer2; 394 struct snd_timer *timer2;
396 395
397 /* midi */ 396 /* midi */
398 397
@@ -404,11 +403,11 @@ struct _snd_gf1 {
404 403
405 unsigned int dma_flags; 404 unsigned int dma_flags;
406 unsigned int dma_shared; 405 unsigned int dma_shared;
407 snd_gf1_dma_block_t *dma_data_pcm; 406 struct snd_gf1_dma_block *dma_data_pcm;
408 snd_gf1_dma_block_t *dma_data_pcm_last; 407 struct snd_gf1_dma_block *dma_data_pcm_last;
409 snd_gf1_dma_block_t *dma_data_synth; 408 struct snd_gf1_dma_block *dma_data_synth;
410 snd_gf1_dma_block_t *dma_data_synth_last; 409 struct snd_gf1_dma_block *dma_data_synth_last;
411 void (*dma_ack)(snd_gus_card_t * gus, void *private_data); 410 void (*dma_ack)(struct snd_gus_card * gus, void *private_data);
412 void *dma_private_data; 411 void *dma_private_data;
413 412
414 /* pcm */ 413 /* pcm */
@@ -425,8 +424,8 @@ struct _snd_gf1 {
425 424
426/* main structure for GUS card */ 425/* main structure for GUS card */
427 426
428struct _snd_gus_card { 427struct snd_gus_card {
429 snd_card_t *card; 428 struct snd_card *card;
430 429
431 unsigned int 430 unsigned int
432 initialized: 1, /* resources were initialized */ 431 initialized: 1, /* resources were initialized */
@@ -448,18 +447,18 @@ struct _snd_gus_card {
448 unsigned short joystick_dac; /* joystick DAC level */ 447 unsigned short joystick_dac; /* joystick DAC level */
449 int timer_dev; /* timer device */ 448 int timer_dev; /* timer device */
450 449
451 struct _snd_gf1 gf1; /* gf1 specific variables */ 450 struct snd_gf1 gf1; /* gf1 specific variables */
452 snd_pcm_t *pcm; 451 struct snd_pcm *pcm;
453 snd_pcm_substream_t *pcm_cap_substream; 452 struct snd_pcm_substream *pcm_cap_substream;
454 unsigned int c_dma_size; 453 unsigned int c_dma_size;
455 unsigned int c_period_size; 454 unsigned int c_period_size;
456 unsigned int c_pos; 455 unsigned int c_pos;
457 456
458 snd_rawmidi_t *midi_uart; 457 struct snd_rawmidi *midi_uart;
459 snd_rawmidi_substream_t *midi_substream_output; 458 struct snd_rawmidi_substream *midi_substream_output;
460 snd_rawmidi_substream_t *midi_substream_input; 459 struct snd_rawmidi_substream *midi_substream_input;
461 460
462 snd_seq_device_t *seq_dev; 461 struct snd_seq_device *seq_dev;
463 462
464 spinlock_t reg_lock; 463 spinlock_t reg_lock;
465 spinlock_t voice_alloc; 464 spinlock_t voice_alloc;
@@ -474,7 +473,7 @@ struct _snd_gus_card {
474 473
475/* I/O functions for GF1/InterWave chip - gus_io.c */ 474/* I/O functions for GF1/InterWave chip - gus_io.c */
476 475
477static inline void snd_gf1_select_voice(snd_gus_card_t * gus, int voice) 476static inline void snd_gf1_select_voice(struct snd_gus_card * gus, int voice)
478{ 477{
479 unsigned long flags; 478 unsigned long flags;
480 479
@@ -486,63 +485,63 @@ static inline void snd_gf1_select_voice(snd_gus_card_t * gus, int voice)
486 spin_unlock_irqrestore(&gus->active_voice_lock, flags); 485 spin_unlock_irqrestore(&gus->active_voice_lock, flags);
487} 486}
488 487
489static inline void snd_gf1_uart_cmd(snd_gus_card_t * gus, unsigned char b) 488static inline void snd_gf1_uart_cmd(struct snd_gus_card * gus, unsigned char b)
490{ 489{
491 outb(gus->gf1.uart_cmd = b, GUSP(gus, MIDICTRL)); 490 outb(gus->gf1.uart_cmd = b, GUSP(gus, MIDICTRL));
492} 491}
493 492
494static inline unsigned char snd_gf1_uart_stat(snd_gus_card_t * gus) 493static inline unsigned char snd_gf1_uart_stat(struct snd_gus_card * gus)
495{ 494{
496 return inb(GUSP(gus, MIDISTAT)); 495 return inb(GUSP(gus, MIDISTAT));
497} 496}
498 497
499static inline void snd_gf1_uart_put(snd_gus_card_t * gus, unsigned char b) 498static inline void snd_gf1_uart_put(struct snd_gus_card * gus, unsigned char b)
500{ 499{
501 outb(b, GUSP(gus, MIDIDATA)); 500 outb(b, GUSP(gus, MIDIDATA));
502} 501}
503 502
504static inline unsigned char snd_gf1_uart_get(snd_gus_card_t * gus) 503static inline unsigned char snd_gf1_uart_get(struct snd_gus_card * gus)
505{ 504{
506 return inb(GUSP(gus, MIDIDATA)); 505 return inb(GUSP(gus, MIDIDATA));
507} 506}
508 507
509extern void snd_gf1_delay(snd_gus_card_t * gus); 508extern void snd_gf1_delay(struct snd_gus_card * gus);
510 509
511extern void snd_gf1_ctrl_stop(snd_gus_card_t * gus, unsigned char reg); 510extern void snd_gf1_ctrl_stop(struct snd_gus_card * gus, unsigned char reg);
512 511
513extern void snd_gf1_write8(snd_gus_card_t * gus, unsigned char reg, unsigned char data); 512extern void snd_gf1_write8(struct snd_gus_card * gus, unsigned char reg, unsigned char data);
514extern unsigned char snd_gf1_look8(snd_gus_card_t * gus, unsigned char reg); 513extern unsigned char snd_gf1_look8(struct snd_gus_card * gus, unsigned char reg);
515static inline unsigned char snd_gf1_read8(snd_gus_card_t * gus, unsigned char reg) 514static inline unsigned char snd_gf1_read8(struct snd_gus_card * gus, unsigned char reg)
516{ 515{
517 return snd_gf1_look8(gus, reg | 0x80); 516 return snd_gf1_look8(gus, reg | 0x80);
518} 517}
519extern void snd_gf1_write16(snd_gus_card_t * gus, unsigned char reg, unsigned int data); 518extern void snd_gf1_write16(struct snd_gus_card * gus, unsigned char reg, unsigned int data);
520extern unsigned short snd_gf1_look16(snd_gus_card_t * gus, unsigned char reg); 519extern unsigned short snd_gf1_look16(struct snd_gus_card * gus, unsigned char reg);
521static inline unsigned short snd_gf1_read16(snd_gus_card_t * gus, unsigned char reg) 520static inline unsigned short snd_gf1_read16(struct snd_gus_card * gus, unsigned char reg)
522{ 521{
523 return snd_gf1_look16(gus, reg | 0x80); 522 return snd_gf1_look16(gus, reg | 0x80);
524} 523}
525extern void snd_gf1_adlib_write(snd_gus_card_t * gus, unsigned char reg, unsigned char data); 524extern void snd_gf1_adlib_write(struct snd_gus_card * gus, unsigned char reg, unsigned char data);
526extern void snd_gf1_dram_addr(snd_gus_card_t * gus, unsigned int addr); 525extern void snd_gf1_dram_addr(struct snd_gus_card * gus, unsigned int addr);
527extern void snd_gf1_poke(snd_gus_card_t * gus, unsigned int addr, unsigned char data); 526extern void snd_gf1_poke(struct snd_gus_card * gus, unsigned int addr, unsigned char data);
528extern unsigned char snd_gf1_peek(snd_gus_card_t * gus, unsigned int addr); 527extern unsigned char snd_gf1_peek(struct snd_gus_card * gus, unsigned int addr);
529extern void snd_gf1_write_addr(snd_gus_card_t * gus, unsigned char reg, unsigned int addr, short w_16bit); 528extern void snd_gf1_write_addr(struct snd_gus_card * gus, unsigned char reg, unsigned int addr, short w_16bit);
530extern unsigned int snd_gf1_read_addr(snd_gus_card_t * gus, unsigned char reg, short w_16bit); 529extern unsigned int snd_gf1_read_addr(struct snd_gus_card * gus, unsigned char reg, short w_16bit);
531extern void snd_gf1_i_ctrl_stop(snd_gus_card_t * gus, unsigned char reg); 530extern void snd_gf1_i_ctrl_stop(struct snd_gus_card * gus, unsigned char reg);
532extern void snd_gf1_i_write8(snd_gus_card_t * gus, unsigned char reg, unsigned char data); 531extern void snd_gf1_i_write8(struct snd_gus_card * gus, unsigned char reg, unsigned char data);
533extern unsigned char snd_gf1_i_look8(snd_gus_card_t * gus, unsigned char reg); 532extern unsigned char snd_gf1_i_look8(struct snd_gus_card * gus, unsigned char reg);
534extern void snd_gf1_i_write16(snd_gus_card_t * gus, unsigned char reg, unsigned int data); 533extern void snd_gf1_i_write16(struct snd_gus_card * gus, unsigned char reg, unsigned int data);
535static inline unsigned char snd_gf1_i_read8(snd_gus_card_t * gus, unsigned char reg) 534static inline unsigned char snd_gf1_i_read8(struct snd_gus_card * gus, unsigned char reg)
536{ 535{
537 return snd_gf1_i_look8(gus, reg | 0x80); 536 return snd_gf1_i_look8(gus, reg | 0x80);
538} 537}
539extern unsigned short snd_gf1_i_look16(snd_gus_card_t * gus, unsigned char reg); 538extern unsigned short snd_gf1_i_look16(struct snd_gus_card * gus, unsigned char reg);
540static inline unsigned short snd_gf1_i_read16(snd_gus_card_t * gus, unsigned char reg) 539static inline unsigned short snd_gf1_i_read16(struct snd_gus_card * gus, unsigned char reg)
541{ 540{
542 return snd_gf1_i_look16(gus, reg | 0x80); 541 return snd_gf1_i_look16(gus, reg | 0x80);
543} 542}
544 543
545extern void snd_gf1_select_active_voices(snd_gus_card_t * gus); 544extern void snd_gf1_select_active_voices(struct snd_gus_card * gus);
546 545
547/* gus_lfo.c */ 546/* gus_lfo.c */
548 547
@@ -555,98 +554,98 @@ struct _SND_IW_LFO_PROGRAM {
555}; 554};
556 555
557#if 0 556#if 0
558extern irqreturn_t snd_gf1_lfo_effect_interrupt(snd_gus_card_t * gus, snd_gf1_voice_t * voice); 557extern irqreturn_t snd_gf1_lfo_effect_interrupt(struct snd_gus_card * gus, snd_gf1_voice_t * voice);
559#endif 558#endif
560extern void snd_gf1_lfo_init(snd_gus_card_t * gus); 559extern void snd_gf1_lfo_init(struct snd_gus_card * gus);
561extern void snd_gf1_lfo_done(snd_gus_card_t * gus); 560extern void snd_gf1_lfo_done(struct snd_gus_card * gus);
562extern void snd_gf1_lfo_program(snd_gus_card_t * gus, int voice, int lfo_type, struct _SND_IW_LFO_PROGRAM *program); 561extern void snd_gf1_lfo_program(struct snd_gus_card * gus, int voice, int lfo_type, struct _SND_IW_LFO_PROGRAM *program);
563extern void snd_gf1_lfo_enable(snd_gus_card_t * gus, int voice, int lfo_type); 562extern void snd_gf1_lfo_enable(struct snd_gus_card * gus, int voice, int lfo_type);
564extern void snd_gf1_lfo_disable(snd_gus_card_t * gus, int voice, int lfo_type); 563extern void snd_gf1_lfo_disable(struct snd_gus_card * gus, int voice, int lfo_type);
565extern void snd_gf1_lfo_change_freq(snd_gus_card_t * gus, int voice, int lfo_type, int freq); 564extern void snd_gf1_lfo_change_freq(struct snd_gus_card * gus, int voice, int lfo_type, int freq);
566extern void snd_gf1_lfo_change_depth(snd_gus_card_t * gus, int voice, int lfo_type, int depth); 565extern void snd_gf1_lfo_change_depth(struct snd_gus_card * gus, int voice, int lfo_type, int depth);
567extern void snd_gf1_lfo_setup(snd_gus_card_t * gus, int voice, int lfo_type, int freq, int current_depth, int depth, int sweep, int shape); 566extern void snd_gf1_lfo_setup(struct snd_gus_card * gus, int voice, int lfo_type, int freq, int current_depth, int depth, int sweep, int shape);
568extern void snd_gf1_lfo_shutdown(snd_gus_card_t * gus, int voice, int lfo_type); 567extern void snd_gf1_lfo_shutdown(struct snd_gus_card * gus, int voice, int lfo_type);
569#if 0 568#if 0
570extern void snd_gf1_lfo_command(snd_gus_card_t * gus, int voice, unsigned char *command); 569extern void snd_gf1_lfo_command(struct snd_gus_card * gus, int voice, unsigned char *command);
571#endif 570#endif
572 571
573/* gus_mem.c */ 572/* gus_mem.c */
574 573
575void snd_gf1_mem_lock(snd_gf1_mem_t * alloc, int xup); 574void snd_gf1_mem_lock(struct snd_gf1_mem * alloc, int xup);
576int snd_gf1_mem_xfree(snd_gf1_mem_t * alloc, snd_gf1_mem_block_t * block); 575int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block);
577snd_gf1_mem_block_t *snd_gf1_mem_alloc(snd_gf1_mem_t * alloc, int owner, 576struct snd_gf1_mem_block *snd_gf1_mem_alloc(struct snd_gf1_mem * alloc, int owner,
578 char *name, int size, int w_16, 577 char *name, int size, int w_16,
579 int align, unsigned int *share_id); 578 int align, unsigned int *share_id);
580int snd_gf1_mem_free(snd_gf1_mem_t * alloc, unsigned int address); 579int snd_gf1_mem_free(struct snd_gf1_mem * alloc, unsigned int address);
581int snd_gf1_mem_free_owner(snd_gf1_mem_t * alloc, int owner); 580int snd_gf1_mem_free_owner(struct snd_gf1_mem * alloc, int owner);
582int snd_gf1_mem_init(snd_gus_card_t * gus); 581int snd_gf1_mem_init(struct snd_gus_card * gus);
583int snd_gf1_mem_done(snd_gus_card_t * gus); 582int snd_gf1_mem_done(struct snd_gus_card * gus);
584 583
585/* gus_mem_proc.c */ 584/* gus_mem_proc.c */
586 585
587int snd_gf1_mem_proc_init(snd_gus_card_t * gus); 586int snd_gf1_mem_proc_init(struct snd_gus_card * gus);
588 587
589/* gus_dma.c */ 588/* gus_dma.c */
590 589
591int snd_gf1_dma_init(snd_gus_card_t * gus); 590int snd_gf1_dma_init(struct snd_gus_card * gus);
592int snd_gf1_dma_done(snd_gus_card_t * gus); 591int snd_gf1_dma_done(struct snd_gus_card * gus);
593int snd_gf1_dma_transfer_block(snd_gus_card_t * gus, 592int snd_gf1_dma_transfer_block(struct snd_gus_card * gus,
594 snd_gf1_dma_block_t * block, 593 struct snd_gf1_dma_block * block,
595 int atomic, 594 int atomic,
596 int synth); 595 int synth);
597 596
598/* gus_volume.c */ 597/* gus_volume.c */
599 598
600unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol); 599unsigned short snd_gf1_lvol_to_gvol_raw(unsigned int vol);
601unsigned short snd_gf1_translate_freq(snd_gus_card_t * gus, unsigned int freq2); 600unsigned short snd_gf1_translate_freq(struct snd_gus_card * gus, unsigned int freq2);
602 601
603/* gus_reset.c */ 602/* gus_reset.c */
604 603
605void snd_gf1_set_default_handlers(snd_gus_card_t * gus, unsigned int what); 604void snd_gf1_set_default_handlers(struct snd_gus_card * gus, unsigned int what);
606void snd_gf1_smart_stop_voice(snd_gus_card_t * gus, unsigned short voice); 605void snd_gf1_smart_stop_voice(struct snd_gus_card * gus, unsigned short voice);
607void snd_gf1_stop_voice(snd_gus_card_t * gus, unsigned short voice); 606void snd_gf1_stop_voice(struct snd_gus_card * gus, unsigned short voice);
608void snd_gf1_stop_voices(snd_gus_card_t * gus, unsigned short v_min, unsigned short v_max); 607void snd_gf1_stop_voices(struct snd_gus_card * gus, unsigned short v_min, unsigned short v_max);
609snd_gus_voice_t *snd_gf1_alloc_voice(snd_gus_card_t * gus, int type, int client, int port); 608struct snd_gus_voice *snd_gf1_alloc_voice(struct snd_gus_card * gus, int type, int client, int port);
610void snd_gf1_free_voice(snd_gus_card_t * gus, snd_gus_voice_t *voice); 609void snd_gf1_free_voice(struct snd_gus_card * gus, struct snd_gus_voice *voice);
611int snd_gf1_start(snd_gus_card_t * gus); 610int snd_gf1_start(struct snd_gus_card * gus);
612int snd_gf1_stop(snd_gus_card_t * gus); 611int snd_gf1_stop(struct snd_gus_card * gus);
613 612
614/* gus_mixer.c */ 613/* gus_mixer.c */
615 614
616int snd_gf1_new_mixer(snd_gus_card_t * gus); 615int snd_gf1_new_mixer(struct snd_gus_card * gus);
617 616
618/* gus_pcm.c */ 617/* gus_pcm.c */
619 618
620int snd_gf1_pcm_new(snd_gus_card_t * gus, int pcm_dev, int control_index, snd_pcm_t ** rpcm); 619int snd_gf1_pcm_new(struct snd_gus_card * gus, int pcm_dev, int control_index, struct snd_pcm ** rpcm);
621 620
622#ifdef CONFIG_SND_DEBUG 621#ifdef CONFIG_SND_DEBUG
623extern void snd_gf1_print_voice_registers(snd_gus_card_t * gus); 622extern void snd_gf1_print_voice_registers(struct snd_gus_card * gus);
624#endif 623#endif
625 624
626/* gus.c */ 625/* gus.c */
627 626
628int snd_gus_use_inc(snd_gus_card_t * gus); 627int snd_gus_use_inc(struct snd_gus_card * gus);
629void snd_gus_use_dec(snd_gus_card_t * gus); 628void snd_gus_use_dec(struct snd_gus_card * gus);
630int snd_gus_create(snd_card_t * card, 629int snd_gus_create(struct snd_card *card,
631 unsigned long port, 630 unsigned long port,
632 int irq, int dma1, int dma2, 631 int irq, int dma1, int dma2,
633 int timer_dev, 632 int timer_dev,
634 int voices, 633 int voices,
635 int pcm_channels, 634 int pcm_channels,
636 int effect, 635 int effect,
637 snd_gus_card_t ** rgus); 636 struct snd_gus_card ** rgus);
638int snd_gus_initialize(snd_gus_card_t * gus); 637int snd_gus_initialize(struct snd_gus_card * gus);
639 638
640/* gus_irq.c */ 639/* gus_irq.c */
641 640
642irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs); 641irqreturn_t snd_gus_interrupt(int irq, void *dev_id, struct pt_regs *regs);
643#ifdef CONFIG_SND_DEBUG 642#ifdef CONFIG_SND_DEBUG
644void snd_gus_irq_profile_init(snd_gus_card_t *gus); 643void snd_gus_irq_profile_init(struct snd_gus_card *gus);
645#endif 644#endif
646 645
647/* gus_uart.c */ 646/* gus_uart.c */
648 647
649int snd_gf1_rawmidi_new(snd_gus_card_t * gus, int device, snd_rawmidi_t **rrawmidi); 648int snd_gf1_rawmidi_new(struct snd_gus_card * gus, int device, struct snd_rawmidi **rrawmidi);
650 649
651#if 0 650#if 0
652extern void snd_engine_instrument_register(unsigned short mode, 651extern void snd_engine_instrument_register(unsigned short mode,
@@ -657,37 +656,37 @@ extern int snd_engine_instrument_register_ask(unsigned short mode);
657#endif 656#endif
658 657
659/* gus_dram.c */ 658/* gus_dram.c */
660int snd_gus_dram_write(snd_gus_card_t *gus, char __user *ptr, 659int snd_gus_dram_write(struct snd_gus_card *gus, char __user *ptr,
661 unsigned int addr, unsigned int size); 660 unsigned int addr, unsigned int size);
662int snd_gus_dram_read(snd_gus_card_t *gus, char __user *ptr, 661int snd_gus_dram_read(struct snd_gus_card *gus, char __user *ptr,
663 unsigned int addr, unsigned int size, int rom); 662 unsigned int addr, unsigned int size, int rom);
664 663
665#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 664#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
666 665
667/* gus_sample.c */ 666/* gus_sample.c */
668void snd_gus_sample_event(snd_seq_event_t *ev, snd_gus_port_t *p); 667void snd_gus_sample_event(struct snd_seq_event *ev, struct snd_gus_port *p);
669 668
670/* gus_simple.c */ 669/* gus_simple.c */
671void snd_gf1_simple_init(snd_gus_voice_t *voice); 670void snd_gf1_simple_init(struct snd_gus_voice *voice);
672 671
673/* gus_instr.c */ 672/* gus_instr.c */
674int snd_gus_iwffff_put_sample(void *private_data, iwffff_wave_t *wave, 673int snd_gus_iwffff_put_sample(void *private_data, struct iwffff_wave *wave,
675 char __user *data, long len, int atomic); 674 char __user *data, long len, int atomic);
676int snd_gus_iwffff_get_sample(void *private_data, iwffff_wave_t *wave, 675int snd_gus_iwffff_get_sample(void *private_data, struct iwffff_wave *wave,
677 char __user *data, long len, int atomic); 676 char __user *data, long len, int atomic);
678int snd_gus_iwffff_remove_sample(void *private_data, iwffff_wave_t *wave, 677int snd_gus_iwffff_remove_sample(void *private_data, struct iwffff_wave *wave,
679 int atomic); 678 int atomic);
680int snd_gus_gf1_put_sample(void *private_data, gf1_wave_t *wave, 679int snd_gus_gf1_put_sample(void *private_data, struct gf1_wave *wave,
681 char __user *data, long len, int atomic); 680 char __user *data, long len, int atomic);
682int snd_gus_gf1_get_sample(void *private_data, gf1_wave_t *wave, 681int snd_gus_gf1_get_sample(void *private_data, struct gf1_wave *wave,
683 char __user *data, long len, int atomic); 682 char __user *data, long len, int atomic);
684int snd_gus_gf1_remove_sample(void *private_data, gf1_wave_t *wave, 683int snd_gus_gf1_remove_sample(void *private_data, struct gf1_wave *wave,
685 int atomic); 684 int atomic);
686int snd_gus_simple_put_sample(void *private_data, simple_instrument_t *instr, 685int snd_gus_simple_put_sample(void *private_data, struct simple_instrument *instr,
687 char __user *data, long len, int atomic); 686 char __user *data, long len, int atomic);
688int snd_gus_simple_get_sample(void *private_data, simple_instrument_t *instr, 687int snd_gus_simple_get_sample(void *private_data, struct simple_instrument *instr,
689 char __user *data, long len, int atomic); 688 char __user *data, long len, int atomic);
690int snd_gus_simple_remove_sample(void *private_data, simple_instrument_t *instr, 689int snd_gus_simple_remove_sample(void *private_data, struct simple_instrument *instr,
691 int atomic); 690 int atomic);
692 691
693#endif /* CONFIG_SND_SEQUENCER */ 692#endif /* CONFIG_SND_SEQUENCER */
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
index 7ce3aa67e5d6..25e1951a9955 100644
--- a/include/sound/hdsp.h
+++ b/include/sound/hdsp.h
@@ -21,17 +21,15 @@
21 21
22#define HDSP_MATRIX_MIXER_SIZE 2048 22#define HDSP_MATRIX_MIXER_SIZE 2048
23 23
24typedef enum { 24enum HDSP_IO_Type {
25 Digiface, 25 Digiface,
26 Multiface, 26 Multiface,
27 H9652, 27 H9652,
28 H9632, 28 H9632,
29 Undefined, 29 Undefined,
30} HDSP_IO_Type; 30};
31
32typedef struct _snd_hdsp_peak_rms hdsp_peak_rms_t;
33 31
34struct _snd_hdsp_peak_rms { 32struct hdsp_peak_rms {
35 u32 input_peaks[26]; 33 u32 input_peaks[26];
36 u32 playback_peaks[26]; 34 u32 playback_peaks[26];
37 u32 output_peaks[28]; 35 u32 output_peaks[28];
@@ -41,11 +39,9 @@ struct _snd_hdsp_peak_rms {
41 u64 output_rms[26]; 39 u64 output_rms[26];
42}; 40};
43 41
44#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, hdsp_peak_rms_t) 42#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdsp_peak_rms)
45 43
46typedef struct _snd_hdsp_config_info hdsp_config_info_t; 44struct hdsp_config_info {
47
48struct _snd_hdsp_config_info {
49 unsigned char pref_sync_ref; 45 unsigned char pref_sync_ref;
50 unsigned char wordclock_sync_check; 46 unsigned char wordclock_sync_check;
51 unsigned char spdif_sync_check; 47 unsigned char spdif_sync_check;
@@ -71,40 +67,41 @@ struct _snd_hdsp_config_info {
71 unsigned char analog_extension_board; 67 unsigned char analog_extension_board;
72}; 68};
73 69
74#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdsp_config_info_t) 70#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdsp_config_info)
75
76typedef struct _snd_hdsp_firmware hdsp_firmware_t;
77 71
78struct _snd_hdsp_firmware { 72struct hdsp_firmware {
79 void __user *firmware_data; /* 24413 x 4 bytes */ 73 void __user *firmware_data; /* 24413 x 4 bytes */
80}; 74};
81 75
82#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, hdsp_firmware_t) 76#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, struct hdsp_firmware)
83 77
84typedef struct _snd_hdsp_version hdsp_version_t; 78struct hdsp_version {
85 79 enum HDSP_IO_Type io_type;
86struct _snd_hdsp_version {
87 HDSP_IO_Type io_type;
88 unsigned short firmware_rev; 80 unsigned short firmware_rev;
89}; 81};
90 82
91#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, hdsp_version_t) 83#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdsp_version)
92
93typedef struct _snd_hdsp_mixer hdsp_mixer_t;
94 84
95struct _snd_hdsp_mixer { 85struct hdsp_mixer {
96 unsigned short matrix[HDSP_MATRIX_MIXER_SIZE]; 86 unsigned short matrix[HDSP_MATRIX_MIXER_SIZE];
97}; 87};
98 88
99#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, hdsp_mixer_t) 89#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdsp_mixer)
100 90
101typedef struct _snd_hdsp_9632_aeb hdsp_9632_aeb_t; 91struct hdsp_9632_aeb {
102
103struct _snd_hdsp_9632_aeb {
104 int aebi; 92 int aebi;
105 int aebo; 93 int aebo;
106}; 94};
107 95
108#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, hdsp_9632_aeb_t) 96#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, struct hdsp_9632_aeb)
97
98/* typedefs for compatibility to user-space */
99typedef enum HDSP_IO_Type HDSP_IO_Type;
100typedef struct hdsp_peak_rms hdsp_peak_rms_t;
101typedef struct hdsp_config_info hdsp_config_info_t;
102typedef struct hdsp_firmware hdsp_firmware_t;
103typedef struct hdsp_version hdsp_version_t;
104typedef struct hdsp_mixer hdsp_mixer_t;
105typedef struct hdsp_9632_aeb hdsp_9632_aeb_t;
109 106
110#endif /* __SOUND_HDSP_H */ 107#endif /* __SOUND_HDSP_H */
diff --git a/include/sound/hdspm.h b/include/sound/hdspm.h
index c34427ccd0b3..c3c854d99c28 100644
--- a/include/sound/hdspm.h
+++ b/include/sound/hdspm.h
@@ -25,8 +25,6 @@
25 25
26/* -------------------- IOCTL Peak/RMS Meters -------------------- */ 26/* -------------------- IOCTL Peak/RMS Meters -------------------- */
27 27
28typedef struct _snd_hdspm_peak_rms hdspm_peak_rms_t;
29
30/* peam rms level structure like we get from hardware 28/* peam rms level structure like we get from hardware
31 29
32 maybe in future we can memory map it so I just copy it 30 maybe in future we can memory map it so I just copy it
@@ -36,7 +34,7 @@ typedef struct _snd_hdspm_peak_rms hdspm_peak_rms_t;
36 (i asume so from the code) 34 (i asume so from the code)
37*/ 35*/
38 36
39struct _snd_hdspm_peak_rms { 37struct hdspm_peak_rms {
40 38
41 unsigned int level_offset[1024]; 39 unsigned int level_offset[1024];
42 40
@@ -58,18 +56,16 @@ struct _snd_hdspm_peak_rms {
58 unsigned int xxx_rms_h[64]; /* not used */ 56 unsigned int xxx_rms_h[64]; /* not used */
59}; 57};
60 58
61struct sndrv_hdspm_peak_rms_ioctl { 59struct hdspm_peak_rms_ioctl {
62 hdspm_peak_rms_t *peak; 60 struct hdspm_peak_rms *peak;
63}; 61};
64 62
65/* use indirect access due to the limit of ioctl bit size */ 63/* use indirect access due to the limit of ioctl bit size */
66#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct sndrv_hdspm_peak_rms_ioctl) 64#define SNDRV_HDSPM_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, struct hdspm_peak_rms_ioctl)
67 65
68/* ------------ CONFIG block IOCTL ---------------------- */ 66/* ------------ CONFIG block IOCTL ---------------------- */
69 67
70typedef struct _snd_hdspm_config_info hdspm_config_info_t; 68struct hdspm_config_info {
71
72struct _snd_hdspm_config_info {
73 unsigned char pref_sync_ref; 69 unsigned char pref_sync_ref;
74 unsigned char wordclock_sync_check; 70 unsigned char wordclock_sync_check;
75 unsigned char madi_sync_check; 71 unsigned char madi_sync_check;
@@ -83,18 +79,16 @@ struct _snd_hdspm_config_info {
83 unsigned int analog_out; 79 unsigned int analog_out;
84}; 80};
85 81
86#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdspm_config_info_t) 82#define SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, struct hdspm_config_info)
87 83
88 84
89/* get Soundcard Version */ 85/* get Soundcard Version */
90 86
91typedef struct _snd_hdspm_version hdspm_version_t; 87struct hdspm_version {
92
93struct _snd_hdspm_version {
94 unsigned short firmware_rev; 88 unsigned short firmware_rev;
95}; 89};
96 90
97#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, hdspm_version_t) 91#define SNDRV_HDSPM_IOCTL_GET_VERSION _IOR('H', 0x43, struct hdspm_version)
98 92
99 93
100/* ------------- get Matrix Mixer IOCTL --------------- */ 94/* ------------- get Matrix Mixer IOCTL --------------- */
@@ -108,24 +102,27 @@ struct _snd_hdspm_version {
108 102
109#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS 103#define HDSPM_MIXER_CHANNELS HDSPM_MAX_CHANNELS
110 104
111typedef struct _snd_hdspm_channelfader snd_hdspm_channelfader_t; 105struct hdspm_channelfader {
112
113struct _snd_hdspm_channelfader {
114 unsigned int in[HDSPM_MIXER_CHANNELS]; 106 unsigned int in[HDSPM_MIXER_CHANNELS];
115 unsigned int pb[HDSPM_MIXER_CHANNELS]; 107 unsigned int pb[HDSPM_MIXER_CHANNELS];
116}; 108};
117 109
118typedef struct _snd_hdspm_mixer hdspm_mixer_t; 110struct hdspm_mixer {
119 111 struct hdspm_channelfader ch[HDSPM_MIXER_CHANNELS];
120struct _snd_hdspm_mixer {
121 snd_hdspm_channelfader_t ch[HDSPM_MIXER_CHANNELS];
122}; 112};
123 113
124struct sndrv_hdspm_mixer_ioctl { 114struct hdspm_mixer_ioctl {
125 hdspm_mixer_t *mixer; 115 struct hdspm_mixer *mixer;
126}; 116};
127 117
128/* use indirect access due to the limit of ioctl bit size */ 118/* use indirect access due to the limit of ioctl bit size */
129#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct sndrv_hdspm_mixer_ioctl) 119#define SNDRV_HDSPM_IOCTL_GET_MIXER _IOR('H', 0x44, struct hdspm_mixer_ioctl)
120
121/* typedefs for compatibility to user-space */
122typedef struct hdspm_peak_rms hdspm_peak_rms_t;
123typedef struct hdspm_config_info hdspm_config_info_t;
124typedef struct hdspm_version hdspm_version_t;
125typedef struct hdspm_channelfader snd_hdspm_channelfader_t;
126typedef struct hdspm_mixer hdspm_mixer_t;
130 127
131#endif /* __SOUND_HDSPM_H */ 128#endif /* __SOUND_HDSPM_H */
diff --git a/include/sound/hwdep.h b/include/sound/hwdep.h
index 043876348fa1..c679e5b31111 100644
--- a/include/sound/hwdep.h
+++ b/include/sound/hwdep.h
@@ -25,27 +25,25 @@
25#include <sound/asound.h> 25#include <sound/asound.h>
26#include <linux/poll.h> 26#include <linux/poll.h>
27 27
28typedef enum sndrv_hwdep_iface snd_hwdep_iface_t; 28struct snd_hwdep;
29typedef struct sndrv_hwdep_info snd_hwdep_info_t;
30typedef struct sndrv_hwdep_dsp_status snd_hwdep_dsp_status_t;
31typedef struct sndrv_hwdep_dsp_image snd_hwdep_dsp_image_t;
32 29
33typedef struct _snd_hwdep_ops { 30struct snd_hwdep_ops {
34 long long (*llseek) (snd_hwdep_t *hw, struct file * file, long long offset, int orig); 31 long long (*llseek) (struct snd_hwdep *hw, struct file * file, long long offset, int orig);
35 long (*read) (snd_hwdep_t * hw, char __user *buf, long count, loff_t *offset); 32 long (*read) (struct snd_hwdep *hw, char __user *buf, long count, loff_t *offset);
36 long (*write) (snd_hwdep_t * hw, const char __user *buf, long count, loff_t *offset); 33 long (*write) (struct snd_hwdep *hw, const char __user *buf, long count, loff_t *offset);
37 int (*open) (snd_hwdep_t * hw, struct file * file); 34 int (*open) (struct snd_hwdep * hw, struct file * file);
38 int (*release) (snd_hwdep_t * hw, struct file * file); 35 int (*release) (struct snd_hwdep *hw, struct file * file);
39 unsigned int (*poll) (snd_hwdep_t * hw, struct file * file, poll_table * wait); 36 unsigned int (*poll) (struct snd_hwdep *hw, struct file * file, poll_table * wait);
40 int (*ioctl) (snd_hwdep_t * hw, struct file * file, unsigned int cmd, unsigned long arg); 37 int (*ioctl) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg);
41 int (*ioctl_compat) (snd_hwdep_t * hw, struct file * file, unsigned int cmd, unsigned long arg); 38 int (*ioctl_compat) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg);
42 int (*mmap) (snd_hwdep_t * hw, struct file * file, struct vm_area_struct * vma); 39 int (*mmap) (struct snd_hwdep *hw, struct file * file, struct vm_area_struct * vma);
43 int (*dsp_status) (snd_hwdep_t * hw, snd_hwdep_dsp_status_t * status); 40 int (*dsp_status) (struct snd_hwdep *hw, struct snd_hwdep_dsp_status *status);
44 int (*dsp_load) (snd_hwdep_t * hw, snd_hwdep_dsp_image_t * image); 41 int (*dsp_load) (struct snd_hwdep *hw, struct snd_hwdep_dsp_image *image);
45} snd_hwdep_ops_t; 42};
46 43
47struct _snd_hwdep { 44struct snd_hwdep {
48 snd_card_t *card; 45 struct snd_card *card;
46 struct list_head list;
49 int device; 47 int device;
50 char id[32]; 48 char id[32];
51 char name[80]; 49 char name[80];
@@ -57,10 +55,10 @@ struct _snd_hwdep {
57 int ossreg; 55 int ossreg;
58#endif 56#endif
59 57
60 snd_hwdep_ops_t ops; 58 struct snd_hwdep_ops ops;
61 wait_queue_head_t open_wait; 59 wait_queue_head_t open_wait;
62 void *private_data; 60 void *private_data;
63 void (*private_free) (snd_hwdep_t *hwdep); 61 void (*private_free) (struct snd_hwdep *hwdep);
64 62
65 struct semaphore open_mutex; 63 struct semaphore open_mutex;
66 int used; 64 int used;
@@ -68,6 +66,7 @@ struct _snd_hwdep {
68 unsigned int exclusive: 1; 66 unsigned int exclusive: 1;
69}; 67};
70 68
71extern int snd_hwdep_new(snd_card_t * card, char *id, int device, snd_hwdep_t ** rhwdep); 69extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
70 struct snd_hwdep **rhwdep);
72 71
73#endif /* __SOUND_HWDEP_H */ 72#endif /* __SOUND_HWDEP_H */
diff --git a/include/sound/i2c.h b/include/sound/i2c.h
index a665ddf9c146..81eb23ed761f 100644
--- a/include/sound/i2c.h
+++ b/include/sound/i2c.h
@@ -21,82 +21,84 @@
21 * 21 *
22 */ 22 */
23 23
24typedef struct _snd_i2c_device snd_i2c_device_t;
25typedef struct _snd_i2c_bus snd_i2c_bus_t;
26
27#define SND_I2C_DEVICE_ADDRTEN (1<<0) /* 10-bit I2C address */ 24#define SND_I2C_DEVICE_ADDRTEN (1<<0) /* 10-bit I2C address */
28 25
29struct _snd_i2c_device { 26struct snd_i2c_device {
30 struct list_head list; 27 struct list_head list;
31 snd_i2c_bus_t *bus; /* I2C bus */ 28 struct snd_i2c_bus *bus; /* I2C bus */
32 char name[32]; /* some useful device name */ 29 char name[32]; /* some useful device name */
33 unsigned short flags; /* device flags */ 30 unsigned short flags; /* device flags */
34 unsigned short addr; /* device address (might be 10-bit) */ 31 unsigned short addr; /* device address (might be 10-bit) */
35 unsigned long private_value; 32 unsigned long private_value;
36 void *private_data; 33 void *private_data;
37 void (*private_free)(snd_i2c_device_t *device); 34 void (*private_free)(struct snd_i2c_device *device);
35};
36
37#define snd_i2c_device(n) list_entry(n, struct snd_i2c_device, list)
38
39struct snd_i2c_bit_ops {
40 void (*start)(struct snd_i2c_bus *bus); /* transfer start */
41 void (*stop)(struct snd_i2c_bus *bus); /* transfer stop */
42 void (*direction)(struct snd_i2c_bus *bus, int clock, int data); /* set line direction (0 = write, 1 = read) */
43 void (*setlines)(struct snd_i2c_bus *bus, int clock, int data);
44 int (*getclock)(struct snd_i2c_bus *bus);
45 int (*getdata)(struct snd_i2c_bus *bus, int ack);
38}; 46};
39 47
40#define snd_i2c_device(n) list_entry(n, snd_i2c_device_t, list) 48struct snd_i2c_ops {
41 49 int (*sendbytes)(struct snd_i2c_device *device, unsigned char *bytes, int count);
42typedef struct _snd_i2c_bit_ops { 50 int (*readbytes)(struct snd_i2c_device *device, unsigned char *bytes, int count);
43 void (*start)(snd_i2c_bus_t *bus); /* transfer start */ 51 int (*probeaddr)(struct snd_i2c_bus *bus, unsigned short addr);
44 void (*stop)(snd_i2c_bus_t *bus); /* transfer stop */ 52};
45 void (*direction)(snd_i2c_bus_t *bus, int clock, int data); /* set line direction (0 = write, 1 = read) */ 53
46 void (*setlines)(snd_i2c_bus_t *bus, int clock, int data); 54struct snd_i2c_bus {
47 int (*getclock)(snd_i2c_bus_t *bus); 55 struct snd_card *card; /* card which I2C belongs to */
48 int (*getdata)(snd_i2c_bus_t *bus, int ack);
49} snd_i2c_bit_ops_t;
50
51typedef struct _snd_i2c_ops {
52 int (*sendbytes)(snd_i2c_device_t *device, unsigned char *bytes, int count);
53 int (*readbytes)(snd_i2c_device_t *device, unsigned char *bytes, int count);
54 int (*probeaddr)(snd_i2c_bus_t *bus, unsigned short addr);
55} snd_i2c_ops_t;
56
57struct _snd_i2c_bus {
58 snd_card_t *card; /* card which I2C belongs to */
59 char name[32]; /* some useful label */ 56 char name[32]; /* some useful label */
60 57
61 struct semaphore lock_mutex; 58 struct semaphore lock_mutex;
62 59
63 snd_i2c_bus_t *master; /* master bus when SCK/SCL is shared */ 60 struct snd_i2c_bus *master; /* master bus when SCK/SCL is shared */
64 struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */ 61 struct list_head buses; /* master: slave buses sharing SCK/SCL, slave: link list */
65 62
66 struct list_head devices; /* attached devices to this bus */ 63 struct list_head devices; /* attached devices to this bus */
67 64
68 union { 65 union {
69 snd_i2c_bit_ops_t *bit; 66 struct snd_i2c_bit_ops *bit;
70 void *ops; 67 void *ops;
71 } hw_ops; /* lowlevel operations */ 68 } hw_ops; /* lowlevel operations */
72 snd_i2c_ops_t *ops; /* midlevel operations */ 69 struct snd_i2c_ops *ops; /* midlevel operations */
73 70
74 unsigned long private_value; 71 unsigned long private_value;
75 void *private_data; 72 void *private_data;
76 void (*private_free)(snd_i2c_bus_t *bus); 73 void (*private_free)(struct snd_i2c_bus *bus);
77}; 74};
78 75
79#define snd_i2c_slave_bus(n) list_entry(n, snd_i2c_bus_t, buses) 76#define snd_i2c_slave_bus(n) list_entry(n, struct snd_i2c_bus, buses)
80 77
81int snd_i2c_bus_create(snd_card_t *card, const char *name, snd_i2c_bus_t *master, snd_i2c_bus_t **ri2c); 78int snd_i2c_bus_create(struct snd_card *card, const char *name,
82int snd_i2c_device_create(snd_i2c_bus_t *bus, const char *name, unsigned char addr, snd_i2c_device_t **rdevice); 79 struct snd_i2c_bus *master, struct snd_i2c_bus **ri2c);
83int snd_i2c_device_free(snd_i2c_device_t *device); 80int snd_i2c_device_create(struct snd_i2c_bus *bus, const char *name,
81 unsigned char addr, struct snd_i2c_device **rdevice);
82int snd_i2c_device_free(struct snd_i2c_device *device);
84 83
85static inline void snd_i2c_lock(snd_i2c_bus_t *bus) { 84static inline void snd_i2c_lock(struct snd_i2c_bus *bus)
85{
86 if (bus->master) 86 if (bus->master)
87 down(&bus->master->lock_mutex); 87 down(&bus->master->lock_mutex);
88 else 88 else
89 down(&bus->lock_mutex); 89 down(&bus->lock_mutex);
90} 90}
91static inline void snd_i2c_unlock(snd_i2c_bus_t *bus) { 91
92static inline void snd_i2c_unlock(struct snd_i2c_bus *bus)
93{
92 if (bus->master) 94 if (bus->master)
93 up(&bus->master->lock_mutex); 95 up(&bus->master->lock_mutex);
94 else 96 else
95 up(&bus->lock_mutex); 97 up(&bus->lock_mutex);
96} 98}
97 99
98int snd_i2c_sendbytes(snd_i2c_device_t *device, unsigned char *bytes, int count); 100int snd_i2c_sendbytes(struct snd_i2c_device *device, unsigned char *bytes, int count);
99int snd_i2c_readbytes(snd_i2c_device_t *device, unsigned char *bytes, int count); 101int snd_i2c_readbytes(struct snd_i2c_device *device, unsigned char *bytes, int count);
100int snd_i2c_probeaddr(snd_i2c_bus_t *bus, unsigned short addr); 102int snd_i2c_probeaddr(struct snd_i2c_bus *bus, unsigned short addr);
101 103
102#endif /* __SOUND_I2C_H */ 104#endif /* __SOUND_I2C_H */
diff --git a/include/sound/info.h b/include/sound/info.h
index 1d76bf3cb05e..8ea5c7497c03 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -34,8 +34,6 @@ struct snd_info_buffer {
34 int error; /* error code */ 34 int error; /* error code */
35}; 35};
36 36
37typedef struct snd_info_buffer snd_info_buffer_t;
38
39#define SNDRV_INFO_CONTENT_TEXT 0 37#define SNDRV_INFO_CONTENT_TEXT 0
40#define SNDRV_INFO_CONTENT_DATA 1 38#define SNDRV_INFO_CONTENT_DATA 1
41 39
@@ -44,28 +42,28 @@ struct snd_info_entry;
44struct snd_info_entry_text { 42struct snd_info_entry_text {
45 unsigned long read_size; 43 unsigned long read_size;
46 unsigned long write_size; 44 unsigned long write_size;
47 void (*read) (snd_info_entry_t *entry, snd_info_buffer_t * buffer); 45 void (*read) (struct snd_info_entry *entry, struct snd_info_buffer *buffer);
48 void (*write) (snd_info_entry_t *entry, snd_info_buffer_t * buffer); 46 void (*write) (struct snd_info_entry *entry, struct snd_info_buffer *buffer);
49}; 47};
50 48
51struct snd_info_entry_ops { 49struct snd_info_entry_ops {
52 int (*open) (snd_info_entry_t *entry, 50 int (*open) (struct snd_info_entry *entry,
53 unsigned short mode, void **file_private_data); 51 unsigned short mode, void **file_private_data);
54 int (*release) (snd_info_entry_t * entry, 52 int (*release) (struct snd_info_entry * entry,
55 unsigned short mode, void *file_private_data); 53 unsigned short mode, void *file_private_data);
56 long (*read) (snd_info_entry_t *entry, void *file_private_data, 54 long (*read) (struct snd_info_entry *entry, void *file_private_data,
57 struct file * file, char __user *buf, 55 struct file * file, char __user *buf,
58 unsigned long count, unsigned long pos); 56 unsigned long count, unsigned long pos);
59 long (*write) (snd_info_entry_t *entry, void *file_private_data, 57 long (*write) (struct snd_info_entry *entry, void *file_private_data,
60 struct file * file, const char __user *buf, 58 struct file * file, const char __user *buf,
61 unsigned long count, unsigned long pos); 59 unsigned long count, unsigned long pos);
62 long long (*llseek) (snd_info_entry_t *entry, void *file_private_data, 60 long long (*llseek) (struct snd_info_entry *entry, void *file_private_data,
63 struct file * file, long long offset, int orig); 61 struct file * file, long long offset, int orig);
64 unsigned int (*poll) (snd_info_entry_t *entry, void *file_private_data, 62 unsigned int (*poll) (struct snd_info_entry *entry, void *file_private_data,
65 struct file * file, poll_table * wait); 63 struct file * file, poll_table * wait);
66 int (*ioctl) (snd_info_entry_t *entry, void *file_private_data, 64 int (*ioctl) (struct snd_info_entry *entry, void *file_private_data,
67 struct file * file, unsigned int cmd, unsigned long arg); 65 struct file * file, unsigned int cmd, unsigned long arg);
68 int (*mmap) (snd_info_entry_t *entry, void *file_private_data, 66 int (*mmap) (struct snd_info_entry *entry, void *file_private_data,
69 struct inode * inode, struct file * file, 67 struct inode * inode, struct file * file,
70 struct vm_area_struct * vma); 68 struct vm_area_struct * vma);
71}; 69};
@@ -80,20 +78,18 @@ struct snd_info_entry {
80 struct snd_info_entry_text text; 78 struct snd_info_entry_text text;
81 struct snd_info_entry_ops *ops; 79 struct snd_info_entry_ops *ops;
82 } c; 80 } c;
83 snd_info_entry_t *parent; 81 struct snd_info_entry *parent;
84 snd_card_t *card; 82 struct snd_card *card;
85 struct module *module; 83 struct module *module;
86 void *private_data; 84 void *private_data;
87 void (*private_free)(snd_info_entry_t *entry); 85 void (*private_free)(struct snd_info_entry *entry);
88 struct proc_dir_entry *p; 86 struct proc_dir_entry *p;
89 struct semaphore access; 87 struct semaphore access;
90}; 88};
91 89
92extern int snd_info_check_reserved_words(const char *str);
93
94#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS) 90#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
95extern int snd_info_minor_register(void); 91int snd_info_minor_register(void);
96extern int snd_info_minor_unregister(void); 92int snd_info_minor_unregister(void);
97#else 93#else
98#define snd_info_minor_register() /* NOP */ 94#define snd_info_minor_register() /* NOP */
99#define snd_info_minor_unregister() /* NOP */ 95#define snd_info_minor_unregister() /* NOP */
@@ -102,72 +98,79 @@ extern int snd_info_minor_unregister(void);
102 98
103#ifdef CONFIG_PROC_FS 99#ifdef CONFIG_PROC_FS
104 100
105extern snd_info_entry_t *snd_seq_root; 101extern struct snd_info_entry *snd_seq_root;
106#ifdef CONFIG_SND_OSSEMUL 102#ifdef CONFIG_SND_OSSEMUL
107extern snd_info_entry_t *snd_oss_root; 103extern struct snd_info_entry *snd_oss_root;
108#else 104#else
109#define snd_oss_root NULL 105#define snd_oss_root NULL
110#endif 106#endif
111 107
112int snd_iprintf(snd_info_buffer_t * buffer, char *fmt,...) __attribute__ ((format (printf, 2, 3))); 108int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...) __attribute__ ((format (printf, 2, 3)));
113int snd_info_init(void); 109int snd_info_init(void);
114int snd_info_done(void); 110int snd_info_done(void);
115 111
116int snd_info_get_line(snd_info_buffer_t * buffer, char *line, int len); 112int snd_info_get_line(struct snd_info_buffer * buffer, char *line, int len);
117char *snd_info_get_str(char *dest, char *src, int len); 113char *snd_info_get_str(char *dest, char *src, int len);
118snd_info_entry_t *snd_info_create_module_entry(struct module * module, 114struct snd_info_entry *snd_info_create_module_entry(struct module * module,
119 const char *name, 115 const char *name,
120 snd_info_entry_t * parent); 116 struct snd_info_entry * parent);
121snd_info_entry_t *snd_info_create_card_entry(snd_card_t * card, 117struct snd_info_entry *snd_info_create_card_entry(struct snd_card * card,
122 const char *name, 118 const char *name,
123 snd_info_entry_t * parent); 119 struct snd_info_entry * parent);
124void snd_info_free_entry(snd_info_entry_t * entry); 120void snd_info_free_entry(struct snd_info_entry * entry);
125int snd_info_store_text(snd_info_entry_t * entry); 121int snd_info_store_text(struct snd_info_entry * entry);
126int snd_info_restore_text(snd_info_entry_t * entry); 122int snd_info_restore_text(struct snd_info_entry * entry);
127 123
128int snd_info_card_create(snd_card_t * card); 124int snd_info_card_create(struct snd_card * card);
129int snd_info_card_register(snd_card_t * card); 125int snd_info_card_register(struct snd_card * card);
130int snd_info_card_free(snd_card_t * card); 126int snd_info_card_free(struct snd_card * card);
131int snd_info_register(snd_info_entry_t * entry); 127int snd_info_register(struct snd_info_entry * entry);
132int snd_info_unregister(snd_info_entry_t * entry); 128int snd_info_unregister(struct snd_info_entry * entry);
133 129
134/* for card drivers */ 130/* for card drivers */
135int snd_card_proc_new(snd_card_t *card, const char *name, snd_info_entry_t **entryp); 131int snd_card_proc_new(struct snd_card *card, const char *name, struct snd_info_entry **entryp);
136 132
137static inline void snd_info_set_text_ops(snd_info_entry_t *entry, 133static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
138 void *private_data, 134 void *private_data,
139 long read_size, 135 long read_size,
140 void (*read)(snd_info_entry_t *, snd_info_buffer_t *)) 136 void (*read)(struct snd_info_entry *, struct snd_info_buffer *))
141{ 137{
142 entry->private_data = private_data; 138 entry->private_data = private_data;
143 entry->c.text.read_size = read_size; 139 entry->c.text.read_size = read_size;
144 entry->c.text.read = read; 140 entry->c.text.read = read;
145} 141}
146 142
143int snd_info_check_reserved_words(const char *str);
147 144
148#else 145#else
149 146
150#define snd_seq_root NULL 147#define snd_seq_root NULL
151#define snd_oss_root NULL 148#define snd_oss_root NULL
152 149
153static inline int snd_iprintf(snd_info_buffer_t * buffer, char *fmt,...) { return 0; } 150static inline int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...) { return 0; }
154static inline int snd_info_init(void) { return 0; } 151static inline int snd_info_init(void) { return 0; }
155static inline int snd_info_done(void) { return 0; } 152static inline int snd_info_done(void) { return 0; }
156 153
157static inline int snd_info_get_line(snd_info_buffer_t * buffer, char *line, int len) { return 0; } 154static inline int snd_info_get_line(struct snd_info_buffer * buffer, char *line, int len) { return 0; }
158static inline char *snd_info_get_str(char *dest, char *src, int len) { return NULL; } 155static inline char *snd_info_get_str(char *dest, char *src, int len) { return NULL; }
159static inline snd_info_entry_t *snd_info_create_module_entry(struct module * module, const char *name, snd_info_entry_t * parent) { return NULL; } 156static inline struct snd_info_entry *snd_info_create_module_entry(struct module * module, const char *name, struct snd_info_entry * parent) { return NULL; }
160static inline snd_info_entry_t *snd_info_create_card_entry(snd_card_t * card, const char *name, snd_info_entry_t * parent) { return NULL; } 157static inline struct snd_info_entry *snd_info_create_card_entry(struct snd_card * card, const char *name, struct snd_info_entry * parent) { return NULL; }
161static inline void snd_info_free_entry(snd_info_entry_t * entry) { ; } 158static inline void snd_info_free_entry(struct snd_info_entry * entry) { ; }
162 159
163static inline int snd_info_card_create(snd_card_t * card) { return 0; } 160static inline int snd_info_card_create(struct snd_card * card) { return 0; }
164static inline int snd_info_card_register(snd_card_t * card) { return 0; } 161static inline int snd_info_card_register(struct snd_card * card) { return 0; }
165static inline int snd_info_card_free(snd_card_t * card) { return 0; } 162static inline int snd_info_card_free(struct snd_card * card) { return 0; }
166static inline int snd_info_register(snd_info_entry_t * entry) { return 0; } 163static inline int snd_info_register(struct snd_info_entry * entry) { return 0; }
167static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; } 164static inline int snd_info_unregister(struct snd_info_entry * entry) { return 0; }
165
166static inline int snd_card_proc_new(struct snd_card *card, const char *name,
167 struct snd_info_entry **entryp) { return -EINVAL; }
168static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),
169 void *private_data,
170 long read_size,
171 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {}
168 172
169#define snd_card_proc_new(card,name,entryp) 0 /* always success */ 173static inline int snd_info_check_reserved_words(const char *str) { return 1; }
170#define snd_info_set_text_ops(entry,private_data,read_size,read) /*NOP*/
171 174
172#endif 175#endif
173 176
@@ -185,7 +188,7 @@ static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; }
185 188
186#define SNDRV_OSS_INFO_DEV_COUNT 6 189#define SNDRV_OSS_INFO_DEV_COUNT 6
187 190
188extern int snd_oss_info_register(int dev, int num, char *string); 191int snd_oss_info_register(int dev, int num, char *string);
189#define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL) 192#define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL)
190 193
191#endif /* CONFIG_SND_OSSEMUL && CONFIG_PROC_FS */ 194#endif /* CONFIG_SND_OSSEMUL && CONFIG_PROC_FS */
diff --git a/include/sound/initval.h b/include/sound/initval.h
index 2bf1508825a4..d29e3d31d149 100644
--- a/include/sound/initval.h
+++ b/include/sound/initval.h
@@ -50,20 +50,6 @@
50#define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE } 50#define SNDRV_DEFAULT_DMA_SIZE { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
51#define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR 51#define SNDRV_DEFAULT_PTR SNDRV_DEFAULT_STR
52 52
53#ifdef SNDRV_LEGACY_AUTO_PROBE
54static int snd_legacy_auto_probe(unsigned long *ports, int (*probe)(unsigned long port))
55{
56 int result = 0; /* number of detected cards */
57
58 while ((signed long)*ports != -1) {
59 if (probe(*ports) >= 0)
60 result++;
61 ports++;
62 }
63 return result;
64}
65#endif
66
67#ifdef SNDRV_LEGACY_FIND_FREE_IRQ 53#ifdef SNDRV_LEGACY_FIND_FREE_IRQ
68#include <linux/interrupt.h> 54#include <linux/interrupt.h>
69 55
diff --git a/include/sound/minors.h b/include/sound/minors.h
index a17b5c9961bb..46bcd2023ed8 100644
--- a/include/sound/minors.h
+++ b/include/sound/minors.h
@@ -26,18 +26,20 @@
26#define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f) 26#define SNDRV_MINOR_DEVICE(minor) ((minor) & 0x001f)
27#define SNDRV_MINOR(card, dev) (((card) << 5) | (dev)) 27#define SNDRV_MINOR(card, dev) (((card) << 5) | (dev))
28 28
29#define SNDRV_MINOR_CONTROL 0 /* 0 - 0 */ 29/* these minors can still be used for autoloading devices (/dev/aload*) */
30#define SNDRV_MINOR_CONTROL 0 /* 0 */
30#define SNDRV_MINOR_GLOBAL 1 /* 1 */ 31#define SNDRV_MINOR_GLOBAL 1 /* 1 */
31#define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32) 32#define SNDRV_MINOR_SEQUENCER (SNDRV_MINOR_GLOBAL + 0 * 32)
32#define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32) 33#define SNDRV_MINOR_TIMER (SNDRV_MINOR_GLOBAL + 1 * 32)
34
35#ifndef CONFIG_SND_DYNAMIC_MINORS
36 /* 2 - 3 (reserved) */
33#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */ 37#define SNDRV_MINOR_HWDEP 4 /* 4 - 7 */
34#define SNDRV_MINOR_HWDEPS 4
35#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */ 38#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 15 */
36#define SNDRV_MINOR_RAWMIDIS 8
37#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */ 39#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */
38#define SNDRV_MINOR_PCM_CAPTURE 24 /* 24 - 31 */ 40#define SNDRV_MINOR_PCM_CAPTURE 24 /* 24 - 31 */
39#define SNDRV_MINOR_PCMS 8
40 41
42/* same as first respective minor number to make minor allocation easier */
41#define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL 43#define SNDRV_DEVICE_TYPE_CONTROL SNDRV_MINOR_CONTROL
42#define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP 44#define SNDRV_DEVICE_TYPE_HWDEP SNDRV_MINOR_HWDEP
43#define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI 45#define SNDRV_DEVICE_TYPE_RAWMIDI SNDRV_MINOR_RAWMIDI
@@ -46,6 +48,25 @@
46#define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER 48#define SNDRV_DEVICE_TYPE_SEQUENCER SNDRV_MINOR_SEQUENCER
47#define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER 49#define SNDRV_DEVICE_TYPE_TIMER SNDRV_MINOR_TIMER
48 50
51#else /* CONFIG_SND_DYNAMIC_MINORS */
52
53enum {
54 SNDRV_DEVICE_TYPE_CONTROL,
55 SNDRV_DEVICE_TYPE_SEQUENCER,
56 SNDRV_DEVICE_TYPE_TIMER,
57 SNDRV_DEVICE_TYPE_HWDEP,
58 SNDRV_DEVICE_TYPE_RAWMIDI,
59 SNDRV_DEVICE_TYPE_PCM_PLAYBACK,
60 SNDRV_DEVICE_TYPE_PCM_CAPTURE,
61};
62
63#endif /* CONFIG_SND_DYNAMIC_MINORS */
64
65#define SNDRV_MINOR_HWDEPS 4
66#define SNDRV_MINOR_RAWMIDIS 8
67#define SNDRV_MINOR_PCMS 8
68
69
49#ifdef CONFIG_SND_OSSEMUL 70#ifdef CONFIG_SND_OSSEMUL
50 71
51#define SNDRV_MINOR_OSS_DEVICES 16 72#define SNDRV_MINOR_OSS_DEVICES 16
diff --git a/include/sound/mixer_oss.h b/include/sound/mixer_oss.h
index ed75b2fb00ab..ca5b4822b62c 100644
--- a/include/sound/mixer_oss.h
+++ b/include/sound/mixer_oss.h
@@ -24,51 +24,53 @@
24 24
25#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE) 25#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
26 26
27typedef struct _snd_oss_mixer_slot snd_mixer_oss_slot_t;
28typedef struct _snd_oss_file snd_mixer_oss_file_t;
29
30typedef int (*snd_mixer_oss_get_volume_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int *left, int *right);
31typedef int (*snd_mixer_oss_put_volume_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int left, int right);
32typedef int (*snd_mixer_oss_get_recsrc_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int *active);
33typedef int (*snd_mixer_oss_put_recsrc_t)(snd_mixer_oss_file_t *fmixer, snd_mixer_oss_slot_t *chn, int active);
34typedef int (*snd_mixer_oss_get_recsrce_t)(snd_mixer_oss_file_t *fmixer, unsigned int *active_index);
35typedef int (*snd_mixer_oss_put_recsrce_t)(snd_mixer_oss_file_t *fmixer, unsigned int active_index);
36
37#define SNDRV_OSS_MAX_MIXERS 32 27#define SNDRV_OSS_MAX_MIXERS 32
38 28
39struct _snd_oss_mixer_slot { 29struct snd_mixer_oss_file;
30
31struct snd_mixer_oss_slot {
40 int number; 32 int number;
41 unsigned int stereo: 1; 33 unsigned int stereo: 1;
42 snd_mixer_oss_get_volume_t get_volume; 34 int (*get_volume)(struct snd_mixer_oss_file *fmixer,
43 snd_mixer_oss_put_volume_t put_volume; 35 struct snd_mixer_oss_slot *chn,
44 snd_mixer_oss_get_recsrc_t get_recsrc; 36 int *left, int *right);
45 snd_mixer_oss_put_recsrc_t put_recsrc; 37 int (*put_volume)(struct snd_mixer_oss_file *fmixer,
38 struct snd_mixer_oss_slot *chn,
39 int left, int right);
40 int (*get_recsrc)(struct snd_mixer_oss_file *fmixer,
41 struct snd_mixer_oss_slot *chn,
42 int *active);
43 int (*put_recsrc)(struct snd_mixer_oss_file *fmixer,
44 struct snd_mixer_oss_slot *chn,
45 int active);
46 unsigned long private_value; 46 unsigned long private_value;
47 void *private_data; 47 void *private_data;
48 void (*private_free)(snd_mixer_oss_slot_t *slot); 48 void (*private_free)(struct snd_mixer_oss_slot *slot);
49 int volume[2]; 49 int volume[2];
50}; 50};
51 51
52struct _snd_oss_mixer { 52struct snd_mixer_oss {
53 snd_card_t *card; 53 struct snd_card *card;
54 char id[16]; 54 char id[16];
55 char name[32]; 55 char name[32];
56 snd_mixer_oss_slot_t slots[SNDRV_OSS_MAX_MIXERS]; /* OSS mixer slots */ 56 struct snd_mixer_oss_slot slots[SNDRV_OSS_MAX_MIXERS]; /* OSS mixer slots */
57 unsigned int mask_recsrc; /* exclusive recsrc mask */ 57 unsigned int mask_recsrc; /* exclusive recsrc mask */
58 snd_mixer_oss_get_recsrce_t get_recsrc; 58 int (*get_recsrc)(struct snd_mixer_oss_file *fmixer,
59 snd_mixer_oss_put_recsrce_t put_recsrc; 59 unsigned int *active_index);
60 int (*put_recsrc)(struct snd_mixer_oss_file *fmixer,
61 unsigned int active_index);
60 void *private_data_recsrc; 62 void *private_data_recsrc;
61 void (*private_free_recsrc)(snd_mixer_oss_t *mixer); 63 void (*private_free_recsrc)(struct snd_mixer_oss *mixer);
62 struct semaphore reg_mutex; 64 struct semaphore reg_mutex;
63 snd_info_entry_t *proc_entry; 65 struct snd_info_entry *proc_entry;
64 int oss_dev_alloc; 66 int oss_dev_alloc;
65 /* --- */ 67 /* --- */
66 int oss_recsrc; 68 int oss_recsrc;
67}; 69};
68 70
69struct _snd_oss_file { 71struct snd_mixer_oss_file {
70 snd_card_t *card; 72 struct snd_card *card;
71 snd_mixer_oss_t *mixer; 73 struct snd_mixer_oss *mixer;
72}; 74};
73 75
74#endif /* CONFIG_SND_MIXER_OSS */ 76#endif /* CONFIG_SND_MIXER_OSS */
diff --git a/include/sound/mpu401.h b/include/sound/mpu401.h
index ae39e38bf996..8e97ace78f16 100644
--- a/include/sound/mpu401.h
+++ b/include/sound/mpu401.h
@@ -58,10 +58,8 @@
58#define MPU401_MODE_INPUT_TIMER (1<<0) 58#define MPU401_MODE_INPUT_TIMER (1<<0)
59#define MPU401_MODE_OUTPUT_TIMER (1<<1) 59#define MPU401_MODE_OUTPUT_TIMER (1<<1)
60 60
61typedef struct _snd_mpu401 mpu401_t; 61struct snd_mpu401 {
62 62 struct snd_rawmidi *rmidi;
63struct _snd_mpu401 {
64 snd_rawmidi_t *rmidi;
65 63
66 unsigned short hardware; /* MPU401_HW_XXXX */ 64 unsigned short hardware; /* MPU401_HW_XXXX */
67 unsigned long port; /* base port of MPU-401 chip */ 65 unsigned long port; /* base port of MPU-401 chip */
@@ -73,14 +71,14 @@ struct _snd_mpu401 {
73 unsigned long mode; /* MPU401_MODE_XXXX */ 71 unsigned long mode; /* MPU401_MODE_XXXX */
74 int timer_invoked; 72 int timer_invoked;
75 73
76 int (*open_input) (mpu401_t * mpu); 74 int (*open_input) (struct snd_mpu401 * mpu);
77 void (*close_input) (mpu401_t * mpu); 75 void (*close_input) (struct snd_mpu401 * mpu);
78 int (*open_output) (mpu401_t * mpu); 76 int (*open_output) (struct snd_mpu401 * mpu);
79 void (*close_output) (mpu401_t * mpu); 77 void (*close_output) (struct snd_mpu401 * mpu);
80 void *private_data; 78 void *private_data;
81 79
82 snd_rawmidi_substream_t *substream_input; 80 struct snd_rawmidi_substream *substream_input;
83 snd_rawmidi_substream_t *substream_output; 81 struct snd_rawmidi_substream *substream_output;
84 82
85 spinlock_t input_lock; 83 spinlock_t input_lock;
86 spinlock_t output_lock; 84 spinlock_t output_lock;
@@ -88,8 +86,8 @@ struct _snd_mpu401 {
88 86
89 struct timer_list timer; 87 struct timer_list timer;
90 88
91 void (*write) (mpu401_t * mpu, unsigned char data, unsigned long addr); 89 void (*write) (struct snd_mpu401 * mpu, unsigned char data, unsigned long addr);
92 unsigned char (*read) (mpu401_t * mpu, unsigned long addr); 90 unsigned char (*read) (struct snd_mpu401 *mpu, unsigned long addr);
93}; 91};
94 92
95/* I/O ports */ 93/* I/O ports */
@@ -103,13 +101,13 @@ struct _snd_mpu401 {
103 101
104irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs); 102irqreturn_t snd_mpu401_uart_interrupt(int irq, void *dev_id, struct pt_regs *regs);
105 103
106int snd_mpu401_uart_new(snd_card_t * card, 104int snd_mpu401_uart_new(struct snd_card *card,
107 int device, 105 int device,
108 unsigned short hardware, 106 unsigned short hardware,
109 unsigned long port, 107 unsigned long port,
110 int integrated, 108 int integrated,
111 int irq, 109 int irq,
112 int irq_flags, 110 int irq_flags,
113 snd_rawmidi_t ** rrawmidi); 111 struct snd_rawmidi ** rrawmidi);
114 112
115#endif /* __SOUND_MPU401_H */ 113#endif /* __SOUND_MPU401_H */
diff --git a/include/sound/opl3.h b/include/sound/opl3.h
index 19f657d4fc06..83392641cb47 100644
--- a/include/sound/opl3.h
+++ b/include/sound/opl3.h
@@ -237,12 +237,12 @@
237#define MAX_OPL2_VOICES 9 237#define MAX_OPL2_VOICES 9
238#define MAX_OPL3_VOICES 18 238#define MAX_OPL3_VOICES 18
239 239
240typedef struct snd_opl3 opl3_t; 240struct snd_opl3;
241 241
242/* 242/*
243 * A structure to keep track of each hardware voice 243 * A structure to keep track of each hardware voice
244 */ 244 */
245typedef struct snd_opl3_voice { 245struct snd_opl3_voice {
246 int state; /* status */ 246 int state; /* status */
247#define SNDRV_OPL3_ST_OFF 0 /* Not playing */ 247#define SNDRV_OPL3_ST_OFF 0 /* Not playing */
248#define SNDRV_OPL3_ST_ON_2OP 1 /* 2op voice is allocated */ 248#define SNDRV_OPL3_ST_ON_2OP 1 /* 2op voice is allocated */
@@ -257,8 +257,8 @@ typedef struct snd_opl3_voice {
257 257
258 unsigned char keyon_reg; /* KON register shadow */ 258 unsigned char keyon_reg; /* KON register shadow */
259 259
260 snd_midi_channel_t *chan; /* Midi channel for this note */ 260 struct snd_midi_channel *chan; /* Midi channel for this note */
261} snd_opl3_voice_t; 261};
262 262
263struct snd_opl3 { 263struct snd_opl3 {
264 unsigned long l_port; 264 unsigned long l_port;
@@ -267,18 +267,18 @@ struct snd_opl3 {
267 struct resource *res_r_port; 267 struct resource *res_r_port;
268 unsigned short hardware; 268 unsigned short hardware;
269 /* hardware access */ 269 /* hardware access */
270 void (*command) (opl3_t * opl3, unsigned short cmd, unsigned char val); 270 void (*command) (struct snd_opl3 * opl3, unsigned short cmd, unsigned char val);
271 unsigned short timer_enable; 271 unsigned short timer_enable;
272 int seq_dev_num; /* sequencer device number */ 272 int seq_dev_num; /* sequencer device number */
273 snd_timer_t *timer1; 273 struct snd_timer *timer1;
274 snd_timer_t *timer2; 274 struct snd_timer *timer2;
275 spinlock_t timer_lock; 275 spinlock_t timer_lock;
276 276
277 void *private_data; 277 void *private_data;
278 void (*private_free)(opl3_t *); 278 void (*private_free)(struct snd_opl3 *);
279 279
280 spinlock_t reg_lock; 280 spinlock_t reg_lock;
281 snd_card_t *card; /* The card that this belongs to */ 281 struct snd_card *card; /* The card that this belongs to */
282 int used; /* usage flag - exclusive */ 282 int used; /* usage flag - exclusive */
283 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */ 283 unsigned char fm_mode; /* OPL mode, see SNDRV_DM_FM_MODE_XXX */
284 unsigned char rhythm; /* percussion mode flag */ 284 unsigned char rhythm; /* percussion mode flag */
@@ -289,18 +289,18 @@ struct snd_opl3 {
289 int synth_mode; /* synth mode */ 289 int synth_mode; /* synth mode */
290 int seq_client; 290 int seq_client;
291 291
292 snd_seq_device_t *seq_dev; /* sequencer device */ 292 struct snd_seq_device *seq_dev; /* sequencer device */
293 snd_midi_channel_set_t * chset; 293 struct snd_midi_channel_set * chset;
294 294
295#ifdef CONFIG_SND_SEQUENCER_OSS 295#ifdef CONFIG_SND_SEQUENCER_OSS
296 snd_seq_device_t *oss_seq_dev; /* OSS sequencer device */ 296 struct snd_seq_device *oss_seq_dev; /* OSS sequencer device */
297 snd_midi_channel_set_t * oss_chset; 297 struct snd_midi_channel_set * oss_chset;
298#endif 298#endif
299 299
300 snd_seq_kinstr_ops_t fm_ops; 300 struct snd_seq_kinstr_ops fm_ops;
301 snd_seq_kinstr_list_t *ilist; 301 struct snd_seq_kinstr_list *ilist;
302 302
303 snd_opl3_voice_t voices[MAX_OPL3_VOICES]; /* Voices (OPL3 'channel') */ 303 struct snd_opl3_voice voices[MAX_OPL3_VOICES]; /* Voices (OPL3 'channel') */
304 int use_time; /* allocation counter */ 304 int use_time; /* allocation counter */
305 305
306 unsigned short connection_reg; /* connection reg shadow */ 306 unsigned short connection_reg; /* connection reg shadow */
@@ -316,24 +316,25 @@ struct snd_opl3 {
316}; 316};
317 317
318/* opl3.c */ 318/* opl3.c */
319void snd_opl3_interrupt(snd_hwdep_t * hw); 319void snd_opl3_interrupt(struct snd_hwdep * hw);
320int snd_opl3_new(snd_card_t *card, unsigned short hardware, opl3_t **ropl3); 320int snd_opl3_new(struct snd_card *card, unsigned short hardware,
321int snd_opl3_init(opl3_t *opl3); 321 struct snd_opl3 **ropl3);
322int snd_opl3_create(snd_card_t * card, 322int snd_opl3_init(struct snd_opl3 *opl3);
323int snd_opl3_create(struct snd_card *card,
323 unsigned long l_port, unsigned long r_port, 324 unsigned long l_port, unsigned long r_port,
324 unsigned short hardware, 325 unsigned short hardware,
325 int integrated, 326 int integrated,
326 opl3_t ** opl3); 327 struct snd_opl3 ** opl3);
327int snd_opl3_timer_new(opl3_t * opl3, int timer1_dev, int timer2_dev); 328int snd_opl3_timer_new(struct snd_opl3 * opl3, int timer1_dev, int timer2_dev);
328int snd_opl3_hwdep_new(opl3_t * opl3, int device, int seq_device, 329int snd_opl3_hwdep_new(struct snd_opl3 * opl3, int device, int seq_device,
329 snd_hwdep_t ** rhwdep); 330 struct snd_hwdep ** rhwdep);
330 331
331/* opl3_synth */ 332/* opl3_synth */
332int snd_opl3_open(snd_hwdep_t * hw, struct file *file); 333int snd_opl3_open(struct snd_hwdep * hw, struct file *file);
333int snd_opl3_ioctl(snd_hwdep_t * hw, struct file *file, 334int snd_opl3_ioctl(struct snd_hwdep * hw, struct file *file,
334 unsigned int cmd, unsigned long arg); 335 unsigned int cmd, unsigned long arg);
335int snd_opl3_release(snd_hwdep_t * hw, struct file *file); 336int snd_opl3_release(struct snd_hwdep * hw, struct file *file);
336 337
337void snd_opl3_reset(opl3_t * opl3); 338void snd_opl3_reset(struct snd_opl3 * opl3);
338 339
339#endif /* __SOUND_OPL3_H */ 340#endif /* __SOUND_OPL3_H */
diff --git a/include/sound/opl4.h b/include/sound/opl4.h
index 20c04428b139..60ae8454b3ce 100644
--- a/include/sound/opl4.h
+++ b/include/sound/opl4.h
@@ -22,11 +22,11 @@
22 22
23#include <sound/opl3.h> 23#include <sound/opl3.h>
24 24
25typedef struct opl4 opl4_t; 25struct snd_opl4;
26 26
27extern int snd_opl4_create(snd_card_t *card, 27extern int snd_opl4_create(struct snd_card *card,
28 unsigned long fm_port, unsigned long pcm_port, 28 unsigned long fm_port, unsigned long pcm_port,
29 int seq_device, 29 int seq_device,
30 opl3_t **opl3, opl4_t **opl4); 30 struct snd_opl3 **opl3, struct snd_opl4 **opl4);
31 31
32#endif /* __SOUND_OPL4_H */ 32#endif /* __SOUND_OPL4_H */
diff --git a/include/sound/pcm-indirect.h b/include/sound/pcm-indirect.h
index 31fa7a54508a..7003d7702e26 100644
--- a/include/sound/pcm-indirect.h
+++ b/include/sound/pcm-indirect.h
@@ -24,7 +24,7 @@
24 24
25#include <sound/pcm.h> 25#include <sound/pcm.h>
26 26
27typedef struct sndrv_pcm_indirect { 27struct snd_pcm_indirect {
28 unsigned int hw_buffer_size; /* Byte size of hardware buffer */ 28 unsigned int hw_buffer_size; /* Byte size of hardware buffer */
29 unsigned int hw_queue_size; /* Max queue size of hw buffer (0 = buffer size) */ 29 unsigned int hw_queue_size; /* Max queue size of hw buffer (0 = buffer size) */
30 unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */ 30 unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */
@@ -35,20 +35,20 @@ typedef struct sndrv_pcm_indirect {
35 unsigned int sw_io; /* Current software pointer in bytes */ 35 unsigned int sw_io; /* Current software pointer in bytes */
36 int sw_ready; /* Bytes ready to be transferred to/from hw */ 36 int sw_ready; /* Bytes ready to be transferred to/from hw */
37 snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */ 37 snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */
38} snd_pcm_indirect_t; 38};
39 39
40typedef void (*snd_pcm_indirect_copy_t)(snd_pcm_substream_t *substream, 40typedef void (*snd_pcm_indirect_copy_t)(struct snd_pcm_substream *substream,
41 snd_pcm_indirect_t *rec, size_t bytes); 41 struct snd_pcm_indirect *rec, size_t bytes);
42 42
43/* 43/*
44 * helper function for playback ack callback 44 * helper function for playback ack callback
45 */ 45 */
46static inline void 46static inline void
47snd_pcm_indirect_playback_transfer(snd_pcm_substream_t *substream, 47snd_pcm_indirect_playback_transfer(struct snd_pcm_substream *substream,
48 snd_pcm_indirect_t *rec, 48 struct snd_pcm_indirect *rec,
49 snd_pcm_indirect_copy_t copy) 49 snd_pcm_indirect_copy_t copy)
50{ 50{
51 snd_pcm_runtime_t *runtime = substream->runtime; 51 struct snd_pcm_runtime *runtime = substream->runtime;
52 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; 52 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
53 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; 53 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;
54 int qsize; 54 int qsize;
@@ -89,8 +89,8 @@ snd_pcm_indirect_playback_transfer(snd_pcm_substream_t *substream,
89 * ptr = current byte pointer 89 * ptr = current byte pointer
90 */ 90 */
91static inline snd_pcm_uframes_t 91static inline snd_pcm_uframes_t
92snd_pcm_indirect_playback_pointer(snd_pcm_substream_t *substream, 92snd_pcm_indirect_playback_pointer(struct snd_pcm_substream *substream,
93 snd_pcm_indirect_t *rec, unsigned int ptr) 93 struct snd_pcm_indirect *rec, unsigned int ptr)
94{ 94{
95 int bytes = ptr - rec->hw_io; 95 int bytes = ptr - rec->hw_io;
96 if (bytes < 0) 96 if (bytes < 0)
@@ -110,11 +110,11 @@ snd_pcm_indirect_playback_pointer(snd_pcm_substream_t *substream,
110 * helper function for capture ack callback 110 * helper function for capture ack callback
111 */ 111 */
112static inline void 112static inline void
113snd_pcm_indirect_capture_transfer(snd_pcm_substream_t *substream, 113snd_pcm_indirect_capture_transfer(struct snd_pcm_substream *substream,
114 snd_pcm_indirect_t *rec, 114 struct snd_pcm_indirect *rec,
115 snd_pcm_indirect_copy_t copy) 115 snd_pcm_indirect_copy_t copy)
116{ 116{
117 snd_pcm_runtime_t *runtime = substream->runtime; 117 struct snd_pcm_runtime *runtime = substream->runtime;
118 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; 118 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;
119 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; 119 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;
120 120
@@ -154,8 +154,8 @@ snd_pcm_indirect_capture_transfer(snd_pcm_substream_t *substream,
154 * ptr = current byte pointer 154 * ptr = current byte pointer
155 */ 155 */
156static inline snd_pcm_uframes_t 156static inline snd_pcm_uframes_t
157snd_pcm_indirect_capture_pointer(snd_pcm_substream_t *substream, 157snd_pcm_indirect_capture_pointer(struct snd_pcm_substream *substream,
158 snd_pcm_indirect_t *rec, unsigned int ptr) 158 struct snd_pcm_indirect *rec, unsigned int ptr)
159{ 159{
160 int qsize; 160 int qsize;
161 int bytes = ptr - rec->hw_io; 161 int bytes = ptr - rec->hw_io;
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index acc4fa9d5abe..314268a11048 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -28,36 +28,9 @@
28#include <linux/poll.h> 28#include <linux/poll.h>
29#include <linux/bitops.h> 29#include <linux/bitops.h>
30 30
31typedef sndrv_pcm_uframes_t snd_pcm_uframes_t;
32typedef sndrv_pcm_sframes_t snd_pcm_sframes_t;
33typedef enum sndrv_pcm_class snd_pcm_class_t;
34typedef enum sndrv_pcm_subclass snd_pcm_subclass_t;
35typedef enum sndrv_pcm_stream snd_pcm_stream_t;
36typedef enum sndrv_pcm_access snd_pcm_access_t;
37typedef enum sndrv_pcm_format snd_pcm_format_t;
38typedef enum sndrv_pcm_subformat snd_pcm_subformat_t;
39typedef enum sndrv_pcm_state snd_pcm_state_t;
40typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t;
41typedef struct sndrv_pcm_info snd_pcm_info_t;
42typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t;
43typedef struct sndrv_pcm_hw_params snd_pcm_hw_params_t;
44typedef enum sndrv_pcm_start snd_pcm_start_t;
45typedef enum sndrv_pcm_xrun snd_pcm_xrun_t;
46typedef enum sndrv_pcm_tstamp snd_pcm_tstamp_t;
47typedef struct sndrv_pcm_sw_params snd_pcm_sw_params_t;
48typedef struct sndrv_pcm_channel_info snd_pcm_channel_info_t;
49typedef struct sndrv_pcm_status snd_pcm_status_t;
50typedef struct sndrv_pcm_mmap_status snd_pcm_mmap_status_t;
51typedef struct sndrv_pcm_mmap_control snd_pcm_mmap_control_t;
52typedef struct sndrv_mask snd_mask_t;
53typedef struct snd_sg_buf snd_pcm_sgbuf_t;
54
55#define snd_pcm_substream_chip(substream) ((substream)->private_data) 31#define snd_pcm_substream_chip(substream) ((substream)->private_data)
56#define snd_pcm_chip(pcm) ((pcm)->private_data) 32#define snd_pcm_chip(pcm) ((pcm)->private_data)
57 33
58typedef struct _snd_pcm_file snd_pcm_file_t;
59typedef struct _snd_pcm_runtime snd_pcm_runtime_t;
60
61#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 34#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
62#include "pcm_oss.h" 35#include "pcm_oss.h"
63#endif 36#endif
@@ -66,7 +39,7 @@ typedef struct _snd_pcm_runtime snd_pcm_runtime_t;
66 * Hardware (lowlevel) section 39 * Hardware (lowlevel) section
67 */ 40 */
68 41
69typedef struct _snd_pcm_hardware { 42struct snd_pcm_hardware {
70 unsigned int info; /* SNDRV_PCM_INFO_* */ 43 unsigned int info; /* SNDRV_PCM_INFO_* */
71 u64 formats; /* SNDRV_PCM_FMTBIT_* */ 44 u64 formats; /* SNDRV_PCM_FMTBIT_* */
72 unsigned int rates; /* SNDRV_PCM_RATE_* */ 45 unsigned int rates; /* SNDRV_PCM_RATE_* */
@@ -80,26 +53,29 @@ typedef struct _snd_pcm_hardware {
80 unsigned int periods_min; /* min # of periods */ 53 unsigned int periods_min; /* min # of periods */
81 unsigned int periods_max; /* max # of periods */ 54 unsigned int periods_max; /* max # of periods */
82 size_t fifo_size; /* fifo size in bytes */ 55 size_t fifo_size; /* fifo size in bytes */
83} snd_pcm_hardware_t; 56};
84 57
85typedef struct _snd_pcm_ops { 58struct snd_pcm_ops {
86 int (*open)(snd_pcm_substream_t *substream); 59 int (*open)(struct snd_pcm_substream *substream);
87 int (*close)(snd_pcm_substream_t *substream); 60 int (*close)(struct snd_pcm_substream *substream);
88 int (*ioctl)(snd_pcm_substream_t * substream, 61 int (*ioctl)(struct snd_pcm_substream * substream,
89 unsigned int cmd, void *arg); 62 unsigned int cmd, void *arg);
90 int (*hw_params)(snd_pcm_substream_t * substream, snd_pcm_hw_params_t * params); 63 int (*hw_params)(struct snd_pcm_substream *substream,
91 int (*hw_free)(snd_pcm_substream_t *substream); 64 struct snd_pcm_hw_params *params);
92 int (*prepare)(snd_pcm_substream_t * substream); 65 int (*hw_free)(struct snd_pcm_substream *substream);
93 int (*trigger)(snd_pcm_substream_t * substream, int cmd); 66 int (*prepare)(struct snd_pcm_substream *substream);
94 snd_pcm_uframes_t (*pointer)(snd_pcm_substream_t * substream); 67 int (*trigger)(struct snd_pcm_substream *substream, int cmd);
95 int (*copy)(snd_pcm_substream_t *substream, int channel, snd_pcm_uframes_t pos, 68 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
69 int (*copy)(struct snd_pcm_substream *substream, int channel,
70 snd_pcm_uframes_t pos,
96 void __user *buf, snd_pcm_uframes_t count); 71 void __user *buf, snd_pcm_uframes_t count);
97 int (*silence)(snd_pcm_substream_t *substream, int channel, 72 int (*silence)(struct snd_pcm_substream *substream, int channel,
98 snd_pcm_uframes_t pos, snd_pcm_uframes_t count); 73 snd_pcm_uframes_t pos, snd_pcm_uframes_t count);
99 struct page *(*page)(snd_pcm_substream_t *substream, unsigned long offset); 74 struct page *(*page)(struct snd_pcm_substream *substream,
100 int (*mmap)(snd_pcm_substream_t *substream, struct vm_area_struct *vma); 75 unsigned long offset);
101 int (*ack)(snd_pcm_substream_t *substream); 76 int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
102} snd_pcm_ops_t; 77 int (*ack)(struct snd_pcm_substream *substream);
78};
103 79
104/* 80/*
105 * 81 *
@@ -212,17 +188,16 @@ typedef struct _snd_pcm_ops {
212#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE 188#define SNDRV_PCM_FMTBIT_IEC958_SUBFRAME SNDRV_PCM_FMTBIT_IEC958_SUBFRAME_BE
213#endif 189#endif
214 190
215struct _snd_pcm_file { 191struct snd_pcm_file {
216 snd_pcm_substream_t * substream; 192 struct snd_pcm_substream *substream;
217 struct _snd_pcm_file * next; 193 struct snd_pcm_file *next;
218}; 194};
219 195
220typedef struct _snd_pcm_hw_rule snd_pcm_hw_rule_t; 196struct snd_pcm_hw_rule;
197typedef int (*snd_pcm_hw_rule_func_t)(struct snd_pcm_hw_params *params,
198 struct snd_pcm_hw_rule *rule);
221 199
222typedef int (*snd_pcm_hw_rule_func_t)(snd_pcm_hw_params_t *params, 200struct snd_pcm_hw_rule {
223 snd_pcm_hw_rule_t *rule);
224
225struct _snd_pcm_hw_rule {
226 unsigned int cond; 201 unsigned int cond;
227 snd_pcm_hw_rule_func_t func; 202 snd_pcm_hw_rule_func_t func;
228 int var; 203 int var;
@@ -230,57 +205,57 @@ struct _snd_pcm_hw_rule {
230 void *private; 205 void *private;
231}; 206};
232 207
233typedef struct _snd_pcm_hw_constraints { 208struct snd_pcm_hw_constraints {
234 snd_mask_t masks[SNDRV_PCM_HW_PARAM_LAST_MASK - 209 struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK -
235 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; 210 SNDRV_PCM_HW_PARAM_FIRST_MASK + 1];
236 snd_interval_t intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - 211 struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL -
237 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1]; 212 SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
238 unsigned int rules_num; 213 unsigned int rules_num;
239 unsigned int rules_all; 214 unsigned int rules_all;
240 snd_pcm_hw_rule_t *rules; 215 struct snd_pcm_hw_rule *rules;
241} snd_pcm_hw_constraints_t; 216};
242 217
243static inline snd_mask_t *constrs_mask(snd_pcm_hw_constraints_t *constrs, 218static inline struct snd_mask *constrs_mask(struct snd_pcm_hw_constraints *constrs,
244 snd_pcm_hw_param_t var) 219 snd_pcm_hw_param_t var)
245{ 220{
246 return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; 221 return &constrs->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
247} 222}
248 223
249static inline snd_interval_t *constrs_interval(snd_pcm_hw_constraints_t *constrs, 224static inline struct snd_interval *constrs_interval(struct snd_pcm_hw_constraints *constrs,
250 snd_pcm_hw_param_t var) 225 snd_pcm_hw_param_t var)
251{ 226{
252 return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 227 return &constrs->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
253} 228}
254 229
255typedef struct { 230struct snd_ratnum {
256 unsigned int num; 231 unsigned int num;
257 unsigned int den_min, den_max, den_step; 232 unsigned int den_min, den_max, den_step;
258} ratnum_t; 233};
259 234
260typedef struct { 235struct snd_ratden {
261 unsigned int num_min, num_max, num_step; 236 unsigned int num_min, num_max, num_step;
262 unsigned int den; 237 unsigned int den;
263} ratden_t; 238};
264 239
265typedef struct { 240struct snd_pcm_hw_constraint_ratnums {
266 int nrats; 241 int nrats;
267 ratnum_t *rats; 242 struct snd_ratnum *rats;
268} snd_pcm_hw_constraint_ratnums_t; 243};
269 244
270typedef struct { 245struct snd_pcm_hw_constraint_ratdens {
271 int nrats; 246 int nrats;
272 ratden_t *rats; 247 struct snd_ratden *rats;
273} snd_pcm_hw_constraint_ratdens_t; 248};
274 249
275typedef struct { 250struct snd_pcm_hw_constraint_list {
276 unsigned int count; 251 unsigned int count;
277 unsigned int *list; 252 unsigned int *list;
278 unsigned int mask; 253 unsigned int mask;
279} snd_pcm_hw_constraint_list_t; 254};
280 255
281struct _snd_pcm_runtime { 256struct snd_pcm_runtime {
282 /* -- Status -- */ 257 /* -- Status -- */
283 snd_pcm_substream_t *trigger_master; 258 struct snd_pcm_substream *trigger_master;
284 struct timespec trigger_tstamp; /* trigger timestamp */ 259 struct timespec trigger_tstamp; /* trigger timestamp */
285 int overrange; 260 int overrange;
286 snd_pcm_uframes_t avail_max; 261 snd_pcm_uframes_t avail_max;
@@ -306,7 +281,7 @@ struct _snd_pcm_runtime {
306 unsigned int rate_den; 281 unsigned int rate_den;
307 282
308 /* -- SW params -- */ 283 /* -- SW params -- */
309 snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */ 284 int tstamp_mode; /* mmap timestamp is updated */
310 unsigned int period_step; 285 unsigned int period_step;
311 unsigned int sleep_min; /* min ticks to sleep */ 286 unsigned int sleep_min; /* min ticks to sleep */
312 snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */ 287 snd_pcm_uframes_t xfer_align; /* xfer size need to be a multiple */
@@ -320,11 +295,11 @@ struct _snd_pcm_runtime {
320 snd_pcm_uframes_t silence_start; /* starting pointer to silence area */ 295 snd_pcm_uframes_t silence_start; /* starting pointer to silence area */
321 snd_pcm_uframes_t silence_filled; /* size filled with silence */ 296 snd_pcm_uframes_t silence_filled; /* size filled with silence */
322 297
323 snd_pcm_sync_id_t sync; /* hardware synchronization ID */ 298 union snd_pcm_sync_id sync; /* hardware synchronization ID */
324 299
325 /* -- mmap -- */ 300 /* -- mmap -- */
326 volatile snd_pcm_mmap_status_t *status; 301 volatile struct snd_pcm_mmap_status *status;
327 volatile snd_pcm_mmap_control_t *control; 302 volatile struct snd_pcm_mmap_control *control;
328 atomic_t mmap_count; 303 atomic_t mmap_count;
329 304
330 /* -- locking / scheduling -- */ 305 /* -- locking / scheduling -- */
@@ -334,15 +309,15 @@ struct _snd_pcm_runtime {
334 309
335 /* -- private section -- */ 310 /* -- private section -- */
336 void *private_data; 311 void *private_data;
337 void (*private_free)(snd_pcm_runtime_t *runtime); 312 void (*private_free)(struct snd_pcm_runtime *runtime);
338 313
339 /* -- hardware description -- */ 314 /* -- hardware description -- */
340 snd_pcm_hardware_t hw; 315 struct snd_pcm_hardware hw;
341 snd_pcm_hw_constraints_t hw_constraints; 316 struct snd_pcm_hw_constraints hw_constraints;
342 317
343 /* -- interrupt callbacks -- */ 318 /* -- interrupt callbacks -- */
344 void (*transfer_ack_begin)(snd_pcm_substream_t *substream); 319 void (*transfer_ack_begin)(struct snd_pcm_substream *substream);
345 void (*transfer_ack_end)(snd_pcm_substream_t *substream); 320 void (*transfer_ack_end)(struct snd_pcm_substream *substream);
346 321
347 /* -- timer -- */ 322 /* -- timer -- */
348 unsigned int timer_resolution; /* timer resolution */ 323 unsigned int timer_resolution; /* timer resolution */
@@ -356,19 +331,19 @@ struct _snd_pcm_runtime {
356 331
357#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 332#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
358 /* -- OSS things -- */ 333 /* -- OSS things -- */
359 snd_pcm_oss_runtime_t oss; 334 struct snd_pcm_oss_runtime oss;
360#endif 335#endif
361}; 336};
362 337
363typedef struct _snd_pcm_group { /* keep linked substreams */ 338struct snd_pcm_group { /* keep linked substreams */
364 spinlock_t lock; 339 spinlock_t lock;
365 struct list_head substreams; 340 struct list_head substreams;
366 int count; 341 int count;
367} snd_pcm_group_t; 342};
368 343
369struct _snd_pcm_substream { 344struct snd_pcm_substream {
370 snd_pcm_t *pcm; 345 struct snd_pcm *pcm;
371 snd_pcm_str_t *pstr; 346 struct snd_pcm_str *pstr;
372 void *private_data; /* copied from pcm->private_data */ 347 void *private_data; /* copied from pcm->private_data */
373 int number; 348 int number;
374 char name[32]; /* substream name */ 349 char name[32]; /* substream name */
@@ -378,32 +353,32 @@ struct _snd_pcm_substream {
378 unsigned int dma_buf_id; 353 unsigned int dma_buf_id;
379 size_t dma_max; 354 size_t dma_max;
380 /* -- hardware operations -- */ 355 /* -- hardware operations -- */
381 snd_pcm_ops_t *ops; 356 struct snd_pcm_ops *ops;
382 /* -- runtime information -- */ 357 /* -- runtime information -- */
383 snd_pcm_runtime_t *runtime; 358 struct snd_pcm_runtime *runtime;
384 /* -- timer section -- */ 359 /* -- timer section -- */
385 snd_timer_t *timer; /* timer */ 360 struct snd_timer *timer; /* timer */
386 unsigned timer_running: 1; /* time is running */ 361 unsigned timer_running: 1; /* time is running */
387 spinlock_t timer_lock; 362 spinlock_t timer_lock;
388 /* -- next substream -- */ 363 /* -- next substream -- */
389 snd_pcm_substream_t *next; 364 struct snd_pcm_substream *next;
390 /* -- linked substreams -- */ 365 /* -- linked substreams -- */
391 struct list_head link_list; /* linked list member */ 366 struct list_head link_list; /* linked list member */
392 snd_pcm_group_t self_group; /* fake group for non linked substream (with substream lock inside) */ 367 struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */
393 snd_pcm_group_t *group; /* pointer to current group */ 368 struct snd_pcm_group *group; /* pointer to current group */
394 /* -- assigned files -- */ 369 /* -- assigned files -- */
395 snd_pcm_file_t *file; 370 struct snd_pcm_file *file;
396 struct file *ffile; 371 struct file *ffile;
397#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 372#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
398 /* -- OSS things -- */ 373 /* -- OSS things -- */
399 snd_pcm_oss_substream_t oss; 374 struct snd_pcm_oss_substream oss;
400#endif 375#endif
401 snd_info_entry_t *proc_root; 376 struct snd_info_entry *proc_root;
402 snd_info_entry_t *proc_info_entry; 377 struct snd_info_entry *proc_info_entry;
403 snd_info_entry_t *proc_hw_params_entry; 378 struct snd_info_entry *proc_hw_params_entry;
404 snd_info_entry_t *proc_sw_params_entry; 379 struct snd_info_entry *proc_sw_params_entry;
405 snd_info_entry_t *proc_status_entry; 380 struct snd_info_entry *proc_status_entry;
406 snd_info_entry_t *proc_prealloc_entry; 381 struct snd_info_entry *proc_prealloc_entry;
407 /* misc flags */ 382 /* misc flags */
408 unsigned int no_mmap_ctrl: 1; 383 unsigned int no_mmap_ctrl: 1;
409}; 384};
@@ -415,65 +390,64 @@ struct _snd_pcm_substream {
415#endif 390#endif
416 391
417 392
418struct _snd_pcm_str { 393struct snd_pcm_str {
419 int stream; /* stream (direction) */ 394 int stream; /* stream (direction) */
420 snd_pcm_t *pcm; 395 struct snd_pcm *pcm;
421 /* -- substreams -- */ 396 /* -- substreams -- */
422 unsigned int substream_count; 397 unsigned int substream_count;
423 unsigned int substream_opened; 398 unsigned int substream_opened;
424 snd_pcm_substream_t *substream; 399 struct snd_pcm_substream *substream;
425#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 400#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
426 /* -- OSS things -- */ 401 /* -- OSS things -- */
427 snd_pcm_oss_stream_t oss; 402 struct snd_pcm_oss_stream oss;
428#endif 403#endif
429 snd_pcm_file_t *files; 404 struct snd_pcm_file *files;
430 snd_minor_t *reg; 405 struct snd_info_entry *proc_root;
431 snd_info_entry_t *proc_root; 406 struct snd_info_entry *proc_info_entry;
432 snd_info_entry_t *proc_info_entry;
433#ifdef CONFIG_SND_DEBUG 407#ifdef CONFIG_SND_DEBUG
434 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */ 408 unsigned int xrun_debug; /* 0 = disabled, 1 = verbose, 2 = stacktrace */
435 snd_info_entry_t *proc_xrun_debug_entry; 409 struct snd_info_entry *proc_xrun_debug_entry;
436#endif 410#endif
437}; 411};
438 412
439struct _snd_pcm { 413struct snd_pcm {
440 snd_card_t *card; 414 struct snd_card *card;
415 struct list_head list;
441 unsigned int device; /* device number */ 416 unsigned int device; /* device number */
442 unsigned int info_flags; 417 unsigned int info_flags;
443 unsigned short dev_class; 418 unsigned short dev_class;
444 unsigned short dev_subclass; 419 unsigned short dev_subclass;
445 char id[64]; 420 char id[64];
446 char name[80]; 421 char name[80];
447 snd_pcm_str_t streams[2]; 422 struct snd_pcm_str streams[2];
448 struct semaphore open_mutex; 423 struct semaphore open_mutex;
449 wait_queue_head_t open_wait; 424 wait_queue_head_t open_wait;
450 void *private_data; 425 void *private_data;
451 void (*private_free) (snd_pcm_t *pcm); 426 void (*private_free) (struct snd_pcm *pcm);
452#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 427#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
453 snd_pcm_oss_t oss; 428 struct snd_pcm_oss oss;
454#endif 429#endif
455}; 430};
456 431
457typedef struct _snd_pcm_notify { 432struct snd_pcm_notify {
458 int (*n_register) (snd_pcm_t * pcm); 433 int (*n_register) (struct snd_pcm * pcm);
459 int (*n_disconnect) (snd_pcm_t * pcm); 434 int (*n_disconnect) (struct snd_pcm * pcm);
460 int (*n_unregister) (snd_pcm_t * pcm); 435 int (*n_unregister) (struct snd_pcm * pcm);
461 struct list_head list; 436 struct list_head list;
462} snd_pcm_notify_t; 437};
463 438
464/* 439/*
465 * Registering 440 * Registering
466 */ 441 */
467 442
468extern snd_pcm_t *snd_pcm_devices[]; 443extern struct file_operations snd_pcm_f_ops[2];
469extern snd_minor_t snd_pcm_reg[2];
470 444
471int snd_pcm_new(snd_card_t * card, char *id, int device, 445int snd_pcm_new(struct snd_card *card, char *id, int device,
472 int playback_count, int capture_count, 446 int playback_count, int capture_count,
473 snd_pcm_t **rpcm); 447 struct snd_pcm **rpcm);
474int snd_pcm_new_stream(snd_pcm_t *pcm, int stream, int substream_count); 448int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count);
475 449
476int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree); 450int snd_pcm_notify(struct snd_pcm_notify *notify, int nfree);
477 451
478/* 452/*
479 * Native I/O 453 * Native I/O
@@ -481,24 +455,26 @@ int snd_pcm_notify(snd_pcm_notify_t *notify, int nfree);
481 455
482extern rwlock_t snd_pcm_link_rwlock; 456extern rwlock_t snd_pcm_link_rwlock;
483 457
484int snd_pcm_info(snd_pcm_substream_t * substream, snd_pcm_info_t *info); 458int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
485int snd_pcm_info_user(snd_pcm_substream_t * substream, snd_pcm_info_t __user *info); 459int snd_pcm_info_user(struct snd_pcm_substream *substream,
486int snd_pcm_status(snd_pcm_substream_t * substream, snd_pcm_status_t *status); 460 struct snd_pcm_info __user *info);
487int snd_pcm_prepare(snd_pcm_substream_t *substream); 461int snd_pcm_status(struct snd_pcm_substream *substream,
488int snd_pcm_start(snd_pcm_substream_t *substream); 462 struct snd_pcm_status *status);
489int snd_pcm_stop(snd_pcm_substream_t *substream, int status); 463int snd_pcm_prepare(struct snd_pcm_substream *substream);
490int snd_pcm_drain_done(snd_pcm_substream_t *substream); 464int snd_pcm_start(struct snd_pcm_substream *substream);
465int snd_pcm_stop(struct snd_pcm_substream *substream, int status);
466int snd_pcm_drain_done(struct snd_pcm_substream *substream);
491#ifdef CONFIG_PM 467#ifdef CONFIG_PM
492int snd_pcm_suspend(snd_pcm_substream_t *substream); 468int snd_pcm_suspend(struct snd_pcm_substream *substream);
493int snd_pcm_suspend_all(snd_pcm_t *pcm); 469int snd_pcm_suspend_all(struct snd_pcm *pcm);
494#endif 470#endif
495int snd_pcm_kernel_playback_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); 471int snd_pcm_kernel_playback_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
496int snd_pcm_kernel_capture_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); 472int snd_pcm_kernel_capture_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
497int snd_pcm_kernel_ioctl(snd_pcm_substream_t *substream, unsigned int cmd, void *arg); 473int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
498int snd_pcm_open_substream(snd_pcm_t *pcm, int stream, snd_pcm_substream_t **rsubstream); 474int snd_pcm_open_substream(struct snd_pcm *pcm, int stream, struct snd_pcm_substream **rsubstream);
499void snd_pcm_release_substream(snd_pcm_substream_t *substream); 475void snd_pcm_release_substream(struct snd_pcm_substream *substream);
500void snd_pcm_vma_notify_data(void *client, void *data); 476void snd_pcm_vma_notify_data(void *client, void *data);
501int snd_pcm_mmap_data(snd_pcm_substream_t *substream, struct file *file, struct vm_area_struct *area); 477int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
502 478
503#if BITS_PER_LONG >= 64 479#if BITS_PER_LONG >= 64
504 480
@@ -578,30 +554,30 @@ static inline void div64_32(u_int64_t *n, u_int32_t div, u_int32_t *rem)
578 * PCM library 554 * PCM library
579 */ 555 */
580 556
581static inline int snd_pcm_stream_linked(snd_pcm_substream_t *substream) 557static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
582{ 558{
583 return substream->group != &substream->self_group; 559 return substream->group != &substream->self_group;
584} 560}
585 561
586static inline void snd_pcm_stream_lock(snd_pcm_substream_t *substream) 562static inline void snd_pcm_stream_lock(struct snd_pcm_substream *substream)
587{ 563{
588 read_lock(&snd_pcm_link_rwlock); 564 read_lock(&snd_pcm_link_rwlock);
589 spin_lock(&substream->self_group.lock); 565 spin_lock(&substream->self_group.lock);
590} 566}
591 567
592static inline void snd_pcm_stream_unlock(snd_pcm_substream_t *substream) 568static inline void snd_pcm_stream_unlock(struct snd_pcm_substream *substream)
593{ 569{
594 spin_unlock(&substream->self_group.lock); 570 spin_unlock(&substream->self_group.lock);
595 read_unlock(&snd_pcm_link_rwlock); 571 read_unlock(&snd_pcm_link_rwlock);
596} 572}
597 573
598static inline void snd_pcm_stream_lock_irq(snd_pcm_substream_t *substream) 574static inline void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream)
599{ 575{
600 read_lock_irq(&snd_pcm_link_rwlock); 576 read_lock_irq(&snd_pcm_link_rwlock);
601 spin_lock(&substream->self_group.lock); 577 spin_lock(&substream->self_group.lock);
602} 578}
603 579
604static inline void snd_pcm_stream_unlock_irq(snd_pcm_substream_t *substream) 580static inline void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream)
605{ 581{
606 spin_unlock(&substream->self_group.lock); 582 spin_unlock(&substream->self_group.lock);
607 read_unlock_irq(&snd_pcm_link_rwlock); 583 read_unlock_irq(&snd_pcm_link_rwlock);
@@ -623,56 +599,56 @@ do { \
623 list_for_each(pos, &substream->group->substreams) 599 list_for_each(pos, &substream->group->substreams)
624 600
625#define snd_pcm_group_substream_entry(pos) \ 601#define snd_pcm_group_substream_entry(pos) \
626 list_entry(pos, snd_pcm_substream_t, link_list) 602 list_entry(pos, struct snd_pcm_substream, link_list)
627 603
628static inline int snd_pcm_running(snd_pcm_substream_t *substream) 604static inline int snd_pcm_running(struct snd_pcm_substream *substream)
629{ 605{
630 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING || 606 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
631 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING && 607 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
632 substream->stream == SNDRV_PCM_STREAM_PLAYBACK)); 608 substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
633} 609}
634 610
635static inline ssize_t bytes_to_samples(snd_pcm_runtime_t *runtime, ssize_t size) 611static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size)
636{ 612{
637 return size * 8 / runtime->sample_bits; 613 return size * 8 / runtime->sample_bits;
638} 614}
639 615
640static inline snd_pcm_sframes_t bytes_to_frames(snd_pcm_runtime_t *runtime, ssize_t size) 616static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size)
641{ 617{
642 return size * 8 / runtime->frame_bits; 618 return size * 8 / runtime->frame_bits;
643} 619}
644 620
645static inline ssize_t samples_to_bytes(snd_pcm_runtime_t *runtime, ssize_t size) 621static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size)
646{ 622{
647 return size * runtime->sample_bits / 8; 623 return size * runtime->sample_bits / 8;
648} 624}
649 625
650static inline ssize_t frames_to_bytes(snd_pcm_runtime_t *runtime, snd_pcm_sframes_t size) 626static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size)
651{ 627{
652 return size * runtime->frame_bits / 8; 628 return size * runtime->frame_bits / 8;
653} 629}
654 630
655static inline int frame_aligned(snd_pcm_runtime_t *runtime, ssize_t bytes) 631static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes)
656{ 632{
657 return bytes % runtime->byte_align == 0; 633 return bytes % runtime->byte_align == 0;
658} 634}
659 635
660static inline size_t snd_pcm_lib_buffer_bytes(snd_pcm_substream_t *substream) 636static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream)
661{ 637{
662 snd_pcm_runtime_t *runtime = substream->runtime; 638 struct snd_pcm_runtime *runtime = substream->runtime;
663 return frames_to_bytes(runtime, runtime->buffer_size); 639 return frames_to_bytes(runtime, runtime->buffer_size);
664} 640}
665 641
666static inline size_t snd_pcm_lib_period_bytes(snd_pcm_substream_t *substream) 642static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream)
667{ 643{
668 snd_pcm_runtime_t *runtime = substream->runtime; 644 struct snd_pcm_runtime *runtime = substream->runtime;
669 return frames_to_bytes(runtime, runtime->period_size); 645 return frames_to_bytes(runtime, runtime->period_size);
670} 646}
671 647
672/* 648/*
673 * result is: 0 ... (boundary - 1) 649 * result is: 0 ... (boundary - 1)
674 */ 650 */
675static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtime) 651static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime)
676{ 652{
677 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr; 653 snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_ptr;
678 if (avail < 0) 654 if (avail < 0)
@@ -685,7 +661,7 @@ static inline snd_pcm_uframes_t snd_pcm_playback_avail(snd_pcm_runtime_t *runtim
685/* 661/*
686 * result is: 0 ... (boundary - 1) 662 * result is: 0 ... (boundary - 1)
687 */ 663 */
688static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime) 664static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime)
689{ 665{
690 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; 666 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr;
691 if (avail < 0) 667 if (avail < 0)
@@ -693,12 +669,12 @@ static inline snd_pcm_uframes_t snd_pcm_capture_avail(snd_pcm_runtime_t *runtime
693 return avail; 669 return avail;
694} 670}
695 671
696static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(snd_pcm_runtime_t *runtime) 672static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime)
697{ 673{
698 return runtime->buffer_size - snd_pcm_playback_avail(runtime); 674 return runtime->buffer_size - snd_pcm_playback_avail(runtime);
699} 675}
700 676
701static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runtime) 677static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime)
702{ 678{
703 return runtime->buffer_size - snd_pcm_capture_avail(runtime); 679 return runtime->buffer_size - snd_pcm_capture_avail(runtime);
704} 680}
@@ -711,9 +687,9 @@ static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(snd_pcm_runtime_t *runt
711 * 687 *
712 * Returns non-zero if available, or zero if not. 688 * Returns non-zero if available, or zero if not.
713 */ 689 */
714static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream) 690static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream)
715{ 691{
716 snd_pcm_runtime_t *runtime = substream->runtime; 692 struct snd_pcm_runtime *runtime = substream->runtime;
717 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; 693 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min;
718} 694}
719 695
@@ -725,9 +701,9 @@ static inline int snd_pcm_playback_ready(snd_pcm_substream_t *substream)
725 * 701 *
726 * Returns non-zero if available, or zero if not. 702 * Returns non-zero if available, or zero if not.
727 */ 703 */
728static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream) 704static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream)
729{ 705{
730 snd_pcm_runtime_t *runtime = substream->runtime; 706 struct snd_pcm_runtime *runtime = substream->runtime;
731 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; 707 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min;
732} 708}
733 709
@@ -740,9 +716,9 @@ static inline int snd_pcm_capture_ready(snd_pcm_substream_t *substream)
740 * 716 *
741 * Returns non-zero if exists, or zero if not. 717 * Returns non-zero if exists, or zero if not.
742 */ 718 */
743static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream) 719static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream)
744{ 720{
745 snd_pcm_runtime_t *runtime = substream->runtime; 721 struct snd_pcm_runtime *runtime = substream->runtime;
746 722
747 if (runtime->stop_threshold >= runtime->boundary) 723 if (runtime->stop_threshold >= runtime->boundary)
748 return 1; 724 return 1;
@@ -757,9 +733,9 @@ static inline int snd_pcm_playback_data(snd_pcm_substream_t *substream)
757 * 733 *
758 * Returns non-zero if empty, or zero if not. 734 * Returns non-zero if empty, or zero if not.
759 */ 735 */
760static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream) 736static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream)
761{ 737{
762 snd_pcm_runtime_t *runtime = substream->runtime; 738 struct snd_pcm_runtime *runtime = substream->runtime;
763 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; 739 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size;
764} 740}
765 741
@@ -771,14 +747,14 @@ static inline int snd_pcm_playback_empty(snd_pcm_substream_t *substream)
771 * 747 *
772 * Returns non-zero if empty, or zero if not. 748 * Returns non-zero if empty, or zero if not.
773 */ 749 */
774static inline int snd_pcm_capture_empty(snd_pcm_substream_t *substream) 750static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream)
775{ 751{
776 snd_pcm_runtime_t *runtime = substream->runtime; 752 struct snd_pcm_runtime *runtime = substream->runtime;
777 return snd_pcm_capture_avail(runtime) == 0; 753 return snd_pcm_capture_avail(runtime) == 0;
778} 754}
779 755
780static inline void snd_pcm_trigger_done(snd_pcm_substream_t *substream, 756static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream,
781 snd_pcm_substream_t *master) 757 struct snd_pcm_substream *master)
782{ 758{
783 substream->runtime->trigger_master = master; 759 substream->runtime->trigger_master = master;
784} 760}
@@ -795,28 +771,28 @@ static inline int hw_is_interval(int var)
795 var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL; 771 var <= SNDRV_PCM_HW_PARAM_LAST_INTERVAL;
796} 772}
797 773
798static inline snd_mask_t *hw_param_mask(snd_pcm_hw_params_t *params, 774static inline struct snd_mask *hw_param_mask(struct snd_pcm_hw_params *params,
799 snd_pcm_hw_param_t var) 775 snd_pcm_hw_param_t var)
800{ 776{
801 return &params->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK]; 777 return &params->masks[var - SNDRV_PCM_HW_PARAM_FIRST_MASK];
802} 778}
803 779
804static inline snd_interval_t *hw_param_interval(snd_pcm_hw_params_t *params, 780static inline struct snd_interval *hw_param_interval(struct snd_pcm_hw_params *params,
805 snd_pcm_hw_param_t var) 781 snd_pcm_hw_param_t var)
806{ 782{
807 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 783 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
808} 784}
809 785
810static inline const snd_mask_t *hw_param_mask_c(const snd_pcm_hw_params_t *params, 786static inline const struct snd_mask *hw_param_mask_c(const struct snd_pcm_hw_params *params,
811 snd_pcm_hw_param_t var) 787 snd_pcm_hw_param_t var)
812{ 788{
813 return (const snd_mask_t *)hw_param_mask((snd_pcm_hw_params_t*) params, var); 789 return (const struct snd_mask *)hw_param_mask((struct snd_pcm_hw_params*) params, var);
814} 790}
815 791
816static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_t *params, 792static inline const struct snd_interval *hw_param_interval_c(const struct snd_pcm_hw_params *params,
817 snd_pcm_hw_param_t var) 793 snd_pcm_hw_param_t var)
818{ 794{
819 return (const snd_interval_t *)hw_param_interval((snd_pcm_hw_params_t*) params, var); 795 return (const struct snd_interval *)hw_param_interval((struct snd_pcm_hw_params*) params, var);
820} 796}
821 797
822#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS)) 798#define params_access(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))
@@ -832,66 +808,66 @@ static inline const snd_interval_t *hw_param_interval_c(const snd_pcm_hw_params_
832#define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min 808#define params_tick_time(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_TICK_TIME)->min
833 809
834 810
835int snd_interval_refine(snd_interval_t *i, const snd_interval_t *v); 811int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
836void snd_interval_mul(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 812void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
837void snd_interval_div(const snd_interval_t *a, const snd_interval_t *b, snd_interval_t *c); 813void snd_interval_div(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
838void snd_interval_muldivk(const snd_interval_t *a, const snd_interval_t *b, 814void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interval *b,
839 unsigned int k, snd_interval_t *c); 815 unsigned int k, struct snd_interval *c);
840void snd_interval_mulkdiv(const snd_interval_t *a, unsigned int k, 816void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
841 const snd_interval_t *b, snd_interval_t *c); 817 const struct snd_interval *b, struct snd_interval *c);
842int snd_interval_list(snd_interval_t *i, unsigned int count, unsigned int *list, unsigned int mask); 818int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask);
843int snd_interval_ratnum(snd_interval_t *i, 819int snd_interval_ratnum(struct snd_interval *i,
844 unsigned int rats_count, ratnum_t *rats, 820 unsigned int rats_count, struct snd_ratnum *rats,
845 unsigned int *nump, unsigned int *denp); 821 unsigned int *nump, unsigned int *denp);
846 822
847void _snd_pcm_hw_params_any(snd_pcm_hw_params_t *params); 823void _snd_pcm_hw_params_any(struct snd_pcm_hw_params *params);
848void _snd_pcm_hw_param_setempty(snd_pcm_hw_params_t *params, snd_pcm_hw_param_t var); 824void _snd_pcm_hw_param_setempty(struct snd_pcm_hw_params *params, snd_pcm_hw_param_t var);
849int snd_pcm_hw_param_near(snd_pcm_substream_t *substream, 825int snd_pcm_hw_param_near(struct snd_pcm_substream *substream,
850 snd_pcm_hw_params_t *params, 826 struct snd_pcm_hw_params *params,
851 snd_pcm_hw_param_t var, 827 snd_pcm_hw_param_t var,
852 unsigned int val, int *dir); 828 unsigned int val, int *dir);
853int snd_pcm_hw_param_set(snd_pcm_substream_t *pcm, 829int snd_pcm_hw_param_set(struct snd_pcm_substream *pcm,
854 snd_pcm_hw_params_t *params, 830 struct snd_pcm_hw_params *params,
855 snd_pcm_hw_param_t var, 831 snd_pcm_hw_param_t var,
856 unsigned int val, int dir); 832 unsigned int val, int dir);
857int snd_pcm_hw_params_choose(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); 833int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
858 834
859int snd_pcm_hw_refine(snd_pcm_substream_t *substream, snd_pcm_hw_params_t *params); 835int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
860 836
861int snd_pcm_hw_constraints_init(snd_pcm_substream_t *substream); 837int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream);
862int snd_pcm_hw_constraints_complete(snd_pcm_substream_t *substream); 838int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream);
863 839
864int snd_pcm_hw_constraint_mask(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 840int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
865 u_int32_t mask); 841 u_int32_t mask);
866int snd_pcm_hw_constraint_mask64(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 842int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
867 u_int64_t mask); 843 u_int64_t mask);
868int snd_pcm_hw_constraint_minmax(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var, 844int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
869 unsigned int min, unsigned int max); 845 unsigned int min, unsigned int max);
870int snd_pcm_hw_constraint_integer(snd_pcm_runtime_t *runtime, snd_pcm_hw_param_t var); 846int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
871int snd_pcm_hw_constraint_list(snd_pcm_runtime_t *runtime, 847int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
872 unsigned int cond, 848 unsigned int cond,
873 snd_pcm_hw_param_t var, 849 snd_pcm_hw_param_t var,
874 snd_pcm_hw_constraint_list_t *l); 850 struct snd_pcm_hw_constraint_list *l);
875int snd_pcm_hw_constraint_ratnums(snd_pcm_runtime_t *runtime, 851int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
876 unsigned int cond, 852 unsigned int cond,
877 snd_pcm_hw_param_t var, 853 snd_pcm_hw_param_t var,
878 snd_pcm_hw_constraint_ratnums_t *r); 854 struct snd_pcm_hw_constraint_ratnums *r);
879int snd_pcm_hw_constraint_ratdens(snd_pcm_runtime_t *runtime, 855int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
880 unsigned int cond, 856 unsigned int cond,
881 snd_pcm_hw_param_t var, 857 snd_pcm_hw_param_t var,
882 snd_pcm_hw_constraint_ratdens_t *r); 858 struct snd_pcm_hw_constraint_ratdens *r);
883int snd_pcm_hw_constraint_msbits(snd_pcm_runtime_t *runtime, 859int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
884 unsigned int cond, 860 unsigned int cond,
885 unsigned int width, 861 unsigned int width,
886 unsigned int msbits); 862 unsigned int msbits);
887int snd_pcm_hw_constraint_step(snd_pcm_runtime_t *runtime, 863int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
888 unsigned int cond, 864 unsigned int cond,
889 snd_pcm_hw_param_t var, 865 snd_pcm_hw_param_t var,
890 unsigned long step); 866 unsigned long step);
891int snd_pcm_hw_constraint_pow2(snd_pcm_runtime_t *runtime, 867int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
892 unsigned int cond, 868 unsigned int cond,
893 snd_pcm_hw_param_t var); 869 snd_pcm_hw_param_t var);
894int snd_pcm_hw_rule_add(snd_pcm_runtime_t *runtime, 870int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
895 unsigned int cond, 871 unsigned int cond,
896 int var, 872 int var,
897 snd_pcm_hw_rule_func_t func, void *private, 873 snd_pcm_hw_rule_func_t func, void *private,
@@ -925,37 +901,37 @@ int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int
925snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian); 901snd_pcm_format_t snd_pcm_build_linear_format(int width, int unsignd, int big_endian);
926const char *snd_pcm_format_name(snd_pcm_format_t format); 902const char *snd_pcm_format_name(snd_pcm_format_t format);
927 903
928void snd_pcm_set_ops(snd_pcm_t * pcm, int direction, snd_pcm_ops_t *ops); 904void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops);
929void snd_pcm_set_sync(snd_pcm_substream_t * substream); 905void snd_pcm_set_sync(struct snd_pcm_substream *substream);
930int snd_pcm_lib_interleave_len(snd_pcm_substream_t *substream); 906int snd_pcm_lib_interleave_len(struct snd_pcm_substream *substream);
931int snd_pcm_lib_ioctl(snd_pcm_substream_t *substream, 907int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
932 unsigned int cmd, void *arg); 908 unsigned int cmd, void *arg);
933int snd_pcm_update_hw_ptr(snd_pcm_substream_t *substream); 909int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
934int snd_pcm_playback_xrun_check(snd_pcm_substream_t *substream); 910int snd_pcm_playback_xrun_check(struct snd_pcm_substream *substream);
935int snd_pcm_capture_xrun_check(snd_pcm_substream_t *substream); 911int snd_pcm_capture_xrun_check(struct snd_pcm_substream *substream);
936int snd_pcm_playback_xrun_asap(snd_pcm_substream_t *substream); 912int snd_pcm_playback_xrun_asap(struct snd_pcm_substream *substream);
937int snd_pcm_capture_xrun_asap(snd_pcm_substream_t *substream); 913int snd_pcm_capture_xrun_asap(struct snd_pcm_substream *substream);
938void snd_pcm_playback_silence(snd_pcm_substream_t *substream, snd_pcm_uframes_t new_hw_ptr); 914void snd_pcm_playback_silence(struct snd_pcm_substream *substream, snd_pcm_uframes_t new_hw_ptr);
939void snd_pcm_tick_prepare(snd_pcm_substream_t *substream); 915void snd_pcm_tick_prepare(struct snd_pcm_substream *substream);
940void snd_pcm_tick_set(snd_pcm_substream_t *substream, unsigned long ticks); 916void snd_pcm_tick_set(struct snd_pcm_substream *substream, unsigned long ticks);
941void snd_pcm_tick_elapsed(snd_pcm_substream_t *substream); 917void snd_pcm_tick_elapsed(struct snd_pcm_substream *substream);
942void snd_pcm_period_elapsed(snd_pcm_substream_t *substream); 918void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
943snd_pcm_sframes_t snd_pcm_lib_write(snd_pcm_substream_t *substream, 919snd_pcm_sframes_t snd_pcm_lib_write(struct snd_pcm_substream *substream,
944 const void __user *buf, 920 const void __user *buf,
945 snd_pcm_uframes_t frames); 921 snd_pcm_uframes_t frames);
946snd_pcm_sframes_t snd_pcm_lib_read(snd_pcm_substream_t *substream, 922snd_pcm_sframes_t snd_pcm_lib_read(struct snd_pcm_substream *substream,
947 void __user *buf, snd_pcm_uframes_t frames); 923 void __user *buf, snd_pcm_uframes_t frames);
948snd_pcm_sframes_t snd_pcm_lib_writev(snd_pcm_substream_t *substream, 924snd_pcm_sframes_t snd_pcm_lib_writev(struct snd_pcm_substream *substream,
949 void __user **bufs, snd_pcm_uframes_t frames); 925 void __user **bufs, snd_pcm_uframes_t frames);
950snd_pcm_sframes_t snd_pcm_lib_readv(snd_pcm_substream_t *substream, 926snd_pcm_sframes_t snd_pcm_lib_readv(struct snd_pcm_substream *substream,
951 void __user **bufs, snd_pcm_uframes_t frames); 927 void __user **bufs, snd_pcm_uframes_t frames);
952 928
953int snd_pcm_limit_hw_rates(snd_pcm_runtime_t *runtime); 929int snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime);
954 930
955static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream, 931static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
956 struct snd_dma_buffer *bufp) 932 struct snd_dma_buffer *bufp)
957{ 933{
958 snd_pcm_runtime_t *runtime = substream->runtime; 934 struct snd_pcm_runtime *runtime = substream->runtime;
959 if (bufp) { 935 if (bufp) {
960 runtime->dma_buffer_p = bufp; 936 runtime->dma_buffer_p = bufp;
961 runtime->dma_area = bufp->area; 937 runtime->dma_area = bufp->area;
@@ -973,47 +949,47 @@ static inline void snd_pcm_set_runtime_buffer(snd_pcm_substream_t *substream,
973 * Timer interface 949 * Timer interface
974 */ 950 */
975 951
976void snd_pcm_timer_resolution_change(snd_pcm_substream_t *substream); 952void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
977void snd_pcm_timer_init(snd_pcm_substream_t * substream); 953void snd_pcm_timer_init(struct snd_pcm_substream *substream);
978void snd_pcm_timer_done(snd_pcm_substream_t * substream); 954void snd_pcm_timer_done(struct snd_pcm_substream *substream);
979 955
980/* 956/*
981 * Memory 957 * Memory
982 */ 958 */
983 959
984int snd_pcm_lib_preallocate_free(snd_pcm_substream_t *substream); 960int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
985int snd_pcm_lib_preallocate_free_for_all(snd_pcm_t *pcm); 961int snd_pcm_lib_preallocate_free_for_all(struct snd_pcm *pcm);
986int snd_pcm_lib_preallocate_pages(snd_pcm_substream_t *substream, 962int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
987 int type, struct device *data, 963 int type, struct device *data,
988 size_t size, size_t max); 964 size_t size, size_t max);
989int snd_pcm_lib_preallocate_pages_for_all(snd_pcm_t *pcm, 965int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
990 int type, void *data, 966 int type, void *data,
991 size_t size, size_t max); 967 size_t size, size_t max);
992int snd_pcm_lib_malloc_pages(snd_pcm_substream_t *substream, size_t size); 968int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
993int snd_pcm_lib_free_pages(snd_pcm_substream_t *substream); 969int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
994 970
995#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data) 971#define snd_pcm_substream_sgbuf(substream) ((substream)->runtime->dma_buffer_p->private_data)
996#define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size) 972#define snd_pcm_sgbuf_pages(size) snd_sgbuf_aligned_pages(size)
997#define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs) 973#define snd_pcm_sgbuf_get_addr(sgbuf,ofs) snd_sgbuf_get_addr(sgbuf,ofs)
998struct page *snd_pcm_sgbuf_ops_page(snd_pcm_substream_t *substream, unsigned long offset); 974struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset);
999 975
1000/* handle mmap counter - PCM mmap callback should handle this counter properly */ 976/* handle mmap counter - PCM mmap callback should handle this counter properly */
1001static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) 977static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area)
1002{ 978{
1003 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 979 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1004 atomic_inc(&substream->runtime->mmap_count); 980 atomic_inc(&substream->runtime->mmap_count);
1005} 981}
1006 982
1007static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area) 983static inline void snd_pcm_mmap_data_close(struct vm_area_struct *area)
1008{ 984{
1009 snd_pcm_substream_t *substream = (snd_pcm_substream_t *)area->vm_private_data; 985 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1010 atomic_dec(&substream->runtime->mmap_count); 986 atomic_dec(&substream->runtime->mmap_count);
1011} 987}
1012 988
1013/* mmap for io-memory area */ 989/* mmap for io-memory area */
1014#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA) 990#if defined(CONFIG_X86) || defined(CONFIG_PPC) || defined(CONFIG_ALPHA)
1015#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP 991#define SNDRV_PCM_INFO_MMAP_IOMEM SNDRV_PCM_INFO_MMAP
1016int snd_pcm_lib_mmap_iomem(snd_pcm_substream_t *substream, struct vm_area_struct *area); 992int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area);
1017#else 993#else
1018#define SNDRV_PCM_INFO_MMAP_IOMEM 0 994#define SNDRV_PCM_INFO_MMAP_IOMEM 0
1019#define snd_pcm_lib_mmap_iomem NULL 995#define snd_pcm_lib_mmap_iomem NULL
diff --git a/include/sound/pcm_oss.h b/include/sound/pcm_oss.h
index 0b67c9d105af..fddaddde47b4 100644
--- a/include/sound/pcm_oss.h
+++ b/include/sound/pcm_oss.h
@@ -22,10 +22,7 @@
22 * 22 *
23 */ 23 */
24 24
25typedef struct _snd_pcm_plugin snd_pcm_plugin_t; 25struct snd_pcm_oss_setup {
26typedef struct _snd_pcm_oss_setup snd_pcm_oss_setup_t;
27
28struct _snd_pcm_oss_setup {
29 char *task_name; 26 char *task_name;
30 unsigned int disable:1, 27 unsigned int disable:1,
31 direct:1, 28 direct:1,
@@ -36,10 +33,10 @@ struct _snd_pcm_oss_setup {
36 buggyptr:1; 33 buggyptr:1;
37 unsigned int periods; 34 unsigned int periods;
38 unsigned int period_size; 35 unsigned int period_size;
39 snd_pcm_oss_setup_t *next; 36 struct snd_pcm_oss_setup *next;
40}; 37};
41 38
42typedef struct _snd_pcm_oss_runtime { 39struct snd_pcm_oss_runtime {
43 unsigned params: 1, /* format/parameter change */ 40 unsigned params: 1, /* format/parameter change */
44 prepare: 1, /* need to prepare the operation */ 41 prepare: 1, /* need to prepare the operation */
45 trigger: 1, /* trigger flag */ 42 trigger: 1, /* trigger flag */
@@ -59,30 +56,30 @@ typedef struct _snd_pcm_oss_runtime {
59 size_t mmap_bytes; 56 size_t mmap_bytes;
60 char *buffer; /* vmallocated period */ 57 char *buffer; /* vmallocated period */
61 size_t buffer_used; /* used length from period buffer */ 58 size_t buffer_used; /* used length from period buffer */
62 snd_pcm_plugin_t *plugin_first; 59 struct snd_pcm_plugin *plugin_first;
63 snd_pcm_plugin_t *plugin_last; 60 struct snd_pcm_plugin *plugin_last;
64 unsigned int prev_hw_ptr_interrupt; 61 unsigned int prev_hw_ptr_interrupt;
65} snd_pcm_oss_runtime_t; 62};
66 63
67typedef struct _snd_pcm_oss_file { 64struct snd_pcm_oss_file {
68 snd_pcm_substream_t *streams[2]; 65 struct snd_pcm_substream *streams[2];
69} snd_pcm_oss_file_t; 66};
70 67
71typedef struct _snd_pcm_oss_substream { 68struct snd_pcm_oss_substream {
72 unsigned oss: 1; /* oss mode */ 69 unsigned oss: 1; /* oss mode */
73 snd_pcm_oss_setup_t *setup; /* active setup */ 70 struct snd_pcm_oss_setup *setup; /* active setup */
74 snd_pcm_oss_file_t *file; 71 struct snd_pcm_oss_file *file;
75} snd_pcm_oss_substream_t; 72};
76 73
77typedef struct _snd_pcm_oss_stream { 74struct snd_pcm_oss_stream {
78 snd_pcm_oss_setup_t *setup_list; /* setup list */ 75 struct snd_pcm_oss_setup *setup_list; /* setup list */
79 struct semaphore setup_mutex; 76 struct semaphore setup_mutex;
80 snd_info_entry_t *proc_entry; 77 struct snd_info_entry *proc_entry;
81} snd_pcm_oss_stream_t; 78};
82 79
83typedef struct _snd_pcm_oss { 80struct snd_pcm_oss {
84 int reg; 81 int reg;
85 unsigned int reg_mask; 82 unsigned int reg_mask;
86} snd_pcm_oss_t; 83};
87 84
88#endif /* __SOUND_PCM_OSS_H */ 85#endif /* __SOUND_PCM_OSS_H */
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 60b0e92e26f3..fb18aef77341 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -22,17 +22,17 @@
22 * 22 *
23 */ 23 */
24 24
25extern int snd_pcm_hw_param_mask(snd_pcm_substream_t *pcm, snd_pcm_hw_params_t *params, 25extern int snd_pcm_hw_param_mask(struct snd_pcm_substream *pcm, struct snd_pcm_hw_params *params,
26 snd_pcm_hw_param_t var, const snd_mask_t *val); 26 snd_pcm_hw_param_t var, const struct snd_mask *val);
27extern unsigned int snd_pcm_hw_param_value_min(const snd_pcm_hw_params_t *params, 27extern unsigned int snd_pcm_hw_param_value_min(const struct snd_pcm_hw_params *params,
28 snd_pcm_hw_param_t var, int *dir); 28 snd_pcm_hw_param_t var, int *dir);
29extern unsigned int snd_pcm_hw_param_value_max(const snd_pcm_hw_params_t *params, 29extern unsigned int snd_pcm_hw_param_value_max(const struct snd_pcm_hw_params *params,
30 snd_pcm_hw_param_t var, int *dir); 30 snd_pcm_hw_param_t var, int *dir);
31extern int _snd_pcm_hw_param_min(snd_pcm_hw_params_t *params, 31extern int _snd_pcm_hw_param_min(struct snd_pcm_hw_params *params,
32 snd_pcm_hw_param_t var, unsigned int val, int dir); 32 snd_pcm_hw_param_t var, unsigned int val, int dir);
33extern int _snd_pcm_hw_param_setinteger(snd_pcm_hw_params_t *params, 33extern int _snd_pcm_hw_param_setinteger(struct snd_pcm_hw_params *params,
34 snd_pcm_hw_param_t var); 34 snd_pcm_hw_param_t var);
35extern int _snd_pcm_hw_param_set(snd_pcm_hw_params_t *params, 35extern int _snd_pcm_hw_param_set(struct snd_pcm_hw_params *params,
36 snd_pcm_hw_param_t var, unsigned int val, int dir); 36 snd_pcm_hw_param_t var, unsigned int val, int dir);
37 37
38/* To share the same code we have alsa-lib */ 38/* To share the same code we have alsa-lib */
@@ -71,20 +71,20 @@ INLINE unsigned int ld2(u_int32_t v)
71 71
72INLINE size_t snd_mask_sizeof(void) 72INLINE size_t snd_mask_sizeof(void)
73{ 73{
74 return sizeof(snd_mask_t); 74 return sizeof(struct snd_mask);
75} 75}
76 76
77INLINE void snd_mask_none(snd_mask_t *mask) 77INLINE void snd_mask_none(struct snd_mask *mask)
78{ 78{
79 memset(mask, 0, sizeof(*mask)); 79 memset(mask, 0, sizeof(*mask));
80} 80}
81 81
82INLINE void snd_mask_any(snd_mask_t *mask) 82INLINE void snd_mask_any(struct snd_mask *mask)
83{ 83{
84 memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t)); 84 memset(mask, 0xff, SNDRV_MASK_SIZE * sizeof(u_int32_t));
85} 85}
86 86
87INLINE int snd_mask_empty(const snd_mask_t *mask) 87INLINE int snd_mask_empty(const struct snd_mask *mask)
88{ 88{
89 int i; 89 int i;
90 for (i = 0; i < SNDRV_MASK_SIZE; i++) 90 for (i = 0; i < SNDRV_MASK_SIZE; i++)
@@ -93,7 +93,7 @@ INLINE int snd_mask_empty(const snd_mask_t *mask)
93 return 1; 93 return 1;
94} 94}
95 95
96INLINE unsigned int snd_mask_min(const snd_mask_t *mask) 96INLINE unsigned int snd_mask_min(const struct snd_mask *mask)
97{ 97{
98 int i; 98 int i;
99 assert(!snd_mask_empty(mask)); 99 assert(!snd_mask_empty(mask));
@@ -104,7 +104,7 @@ INLINE unsigned int snd_mask_min(const snd_mask_t *mask)
104 return 0; 104 return 0;
105} 105}
106 106
107INLINE unsigned int snd_mask_max(const snd_mask_t *mask) 107INLINE unsigned int snd_mask_max(const struct snd_mask *mask)
108{ 108{
109 int i; 109 int i;
110 assert(!snd_mask_empty(mask)); 110 assert(!snd_mask_empty(mask));
@@ -115,19 +115,19 @@ INLINE unsigned int snd_mask_max(const snd_mask_t *mask)
115 return 0; 115 return 0;
116} 116}
117 117
118INLINE void snd_mask_set(snd_mask_t *mask, unsigned int val) 118INLINE void snd_mask_set(struct snd_mask *mask, unsigned int val)
119{ 119{
120 assert(val <= SNDRV_MASK_BITS); 120 assert(val <= SNDRV_MASK_BITS);
121 mask->bits[MASK_OFS(val)] |= MASK_BIT(val); 121 mask->bits[MASK_OFS(val)] |= MASK_BIT(val);
122} 122}
123 123
124INLINE void snd_mask_reset(snd_mask_t *mask, unsigned int val) 124INLINE void snd_mask_reset(struct snd_mask *mask, unsigned int val)
125{ 125{
126 assert(val <= SNDRV_MASK_BITS); 126 assert(val <= SNDRV_MASK_BITS);
127 mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val); 127 mask->bits[MASK_OFS(val)] &= ~MASK_BIT(val);
128} 128}
129 129
130INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int to) 130INLINE void snd_mask_set_range(struct snd_mask *mask, unsigned int from, unsigned int to)
131{ 131{
132 unsigned int i; 132 unsigned int i;
133 assert(to <= SNDRV_MASK_BITS && from <= to); 133 assert(to <= SNDRV_MASK_BITS && from <= to);
@@ -135,7 +135,7 @@ INLINE void snd_mask_set_range(snd_mask_t *mask, unsigned int from, unsigned int
135 mask->bits[MASK_OFS(i)] |= MASK_BIT(i); 135 mask->bits[MASK_OFS(i)] |= MASK_BIT(i);
136} 136}
137 137
138INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned int to) 138INLINE void snd_mask_reset_range(struct snd_mask *mask, unsigned int from, unsigned int to)
139{ 139{
140 unsigned int i; 140 unsigned int i;
141 assert(to <= SNDRV_MASK_BITS && from <= to); 141 assert(to <= SNDRV_MASK_BITS && from <= to);
@@ -143,7 +143,7 @@ INLINE void snd_mask_reset_range(snd_mask_t *mask, unsigned int from, unsigned i
143 mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i); 143 mask->bits[MASK_OFS(i)] &= ~MASK_BIT(i);
144} 144}
145 145
146INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val) 146INLINE void snd_mask_leave(struct snd_mask *mask, unsigned int val)
147{ 147{
148 unsigned int v; 148 unsigned int v;
149 assert(val <= SNDRV_MASK_BITS); 149 assert(val <= SNDRV_MASK_BITS);
@@ -152,30 +152,30 @@ INLINE void snd_mask_leave(snd_mask_t *mask, unsigned int val)
152 mask->bits[MASK_OFS(val)] = v; 152 mask->bits[MASK_OFS(val)] = v;
153} 153}
154 154
155INLINE void snd_mask_intersect(snd_mask_t *mask, const snd_mask_t *v) 155INLINE void snd_mask_intersect(struct snd_mask *mask, const struct snd_mask *v)
156{ 156{
157 int i; 157 int i;
158 for (i = 0; i < SNDRV_MASK_SIZE; i++) 158 for (i = 0; i < SNDRV_MASK_SIZE; i++)
159 mask->bits[i] &= v->bits[i]; 159 mask->bits[i] &= v->bits[i];
160} 160}
161 161
162INLINE int snd_mask_eq(const snd_mask_t *mask, const snd_mask_t *v) 162INLINE int snd_mask_eq(const struct snd_mask *mask, const struct snd_mask *v)
163{ 163{
164 return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t)); 164 return ! memcmp(mask, v, SNDRV_MASK_SIZE * sizeof(u_int32_t));
165} 165}
166 166
167INLINE void snd_mask_copy(snd_mask_t *mask, const snd_mask_t *v) 167INLINE void snd_mask_copy(struct snd_mask *mask, const struct snd_mask *v)
168{ 168{
169 *mask = *v; 169 *mask = *v;
170} 170}
171 171
172INLINE int snd_mask_test(const snd_mask_t *mask, unsigned int val) 172INLINE int snd_mask_test(const struct snd_mask *mask, unsigned int val)
173{ 173{
174 assert(val <= SNDRV_MASK_BITS); 174 assert(val <= SNDRV_MASK_BITS);
175 return mask->bits[MASK_OFS(val)] & MASK_BIT(val); 175 return mask->bits[MASK_OFS(val)] & MASK_BIT(val);
176} 176}
177 177
178INLINE int snd_mask_single(const snd_mask_t *mask) 178INLINE int snd_mask_single(const struct snd_mask *mask)
179{ 179{
180 int i, c = 0; 180 int i, c = 0;
181 assert(!snd_mask_empty(mask)); 181 assert(!snd_mask_empty(mask));
@@ -191,9 +191,9 @@ INLINE int snd_mask_single(const snd_mask_t *mask)
191 return 1; 191 return 1;
192} 192}
193 193
194INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v) 194INLINE int snd_mask_refine(struct snd_mask *mask, const struct snd_mask *v)
195{ 195{
196 snd_mask_t old; 196 struct snd_mask old;
197 assert(!snd_mask_empty(mask)); 197 assert(!snd_mask_empty(mask));
198 snd_mask_copy(&old, mask); 198 snd_mask_copy(&old, mask);
199 snd_mask_intersect(mask, v); 199 snd_mask_intersect(mask, v);
@@ -202,7 +202,7 @@ INLINE int snd_mask_refine(snd_mask_t *mask, const snd_mask_t *v)
202 return !snd_mask_eq(mask, &old); 202 return !snd_mask_eq(mask, &old);
203} 203}
204 204
205INLINE int snd_mask_refine_first(snd_mask_t *mask) 205INLINE int snd_mask_refine_first(struct snd_mask *mask)
206{ 206{
207 assert(!snd_mask_empty(mask)); 207 assert(!snd_mask_empty(mask));
208 if (snd_mask_single(mask)) 208 if (snd_mask_single(mask))
@@ -211,7 +211,7 @@ INLINE int snd_mask_refine_first(snd_mask_t *mask)
211 return 1; 211 return 1;
212} 212}
213 213
214INLINE int snd_mask_refine_last(snd_mask_t *mask) 214INLINE int snd_mask_refine_last(struct snd_mask *mask)
215{ 215{
216 assert(!snd_mask_empty(mask)); 216 assert(!snd_mask_empty(mask));
217 if (snd_mask_single(mask)) 217 if (snd_mask_single(mask))
@@ -220,7 +220,7 @@ INLINE int snd_mask_refine_last(snd_mask_t *mask)
220 return 1; 220 return 1;
221} 221}
222 222
223INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val) 223INLINE int snd_mask_refine_min(struct snd_mask *mask, unsigned int val)
224{ 224{
225 assert(!snd_mask_empty(mask)); 225 assert(!snd_mask_empty(mask));
226 if (snd_mask_min(mask) >= val) 226 if (snd_mask_min(mask) >= val)
@@ -231,7 +231,7 @@ INLINE int snd_mask_refine_min(snd_mask_t *mask, unsigned int val)
231 return 1; 231 return 1;
232} 232}
233 233
234INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val) 234INLINE int snd_mask_refine_max(struct snd_mask *mask, unsigned int val)
235{ 235{
236 assert(!snd_mask_empty(mask)); 236 assert(!snd_mask_empty(mask));
237 if (snd_mask_max(mask) <= val) 237 if (snd_mask_max(mask) <= val)
@@ -242,7 +242,7 @@ INLINE int snd_mask_refine_max(snd_mask_t *mask, unsigned int val)
242 return 1; 242 return 1;
243} 243}
244 244
245INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val) 245INLINE int snd_mask_refine_set(struct snd_mask *mask, unsigned int val)
246{ 246{
247 int changed; 247 int changed;
248 assert(!snd_mask_empty(mask)); 248 assert(!snd_mask_empty(mask));
@@ -253,13 +253,13 @@ INLINE int snd_mask_refine_set(snd_mask_t *mask, unsigned int val)
253 return changed; 253 return changed;
254} 254}
255 255
256INLINE int snd_mask_value(const snd_mask_t *mask) 256INLINE int snd_mask_value(const struct snd_mask *mask)
257{ 257{
258 assert(!snd_mask_empty(mask)); 258 assert(!snd_mask_empty(mask));
259 return snd_mask_min(mask); 259 return snd_mask_min(mask);
260} 260}
261 261
262INLINE void snd_interval_any(snd_interval_t *i) 262INLINE void snd_interval_any(struct snd_interval *i)
263{ 263{
264 i->min = 0; 264 i->min = 0;
265 i->openmin = 0; 265 i->openmin = 0;
@@ -269,42 +269,42 @@ INLINE void snd_interval_any(snd_interval_t *i)
269 i->empty = 0; 269 i->empty = 0;
270} 270}
271 271
272INLINE void snd_interval_none(snd_interval_t *i) 272INLINE void snd_interval_none(struct snd_interval *i)
273{ 273{
274 i->empty = 1; 274 i->empty = 1;
275} 275}
276 276
277INLINE int snd_interval_checkempty(const snd_interval_t *i) 277INLINE int snd_interval_checkempty(const struct snd_interval *i)
278{ 278{
279 return (i->min > i->max || 279 return (i->min > i->max ||
280 (i->min == i->max && (i->openmin || i->openmax))); 280 (i->min == i->max && (i->openmin || i->openmax)));
281} 281}
282 282
283INLINE int snd_interval_empty(const snd_interval_t *i) 283INLINE int snd_interval_empty(const struct snd_interval *i)
284{ 284{
285 return i->empty; 285 return i->empty;
286} 286}
287 287
288INLINE int snd_interval_single(const snd_interval_t *i) 288INLINE int snd_interval_single(const struct snd_interval *i)
289{ 289{
290 assert(!snd_interval_empty(i)); 290 assert(!snd_interval_empty(i));
291 return (i->min == i->max || 291 return (i->min == i->max ||
292 (i->min + 1 == i->max && i->openmax)); 292 (i->min + 1 == i->max && i->openmax));
293} 293}
294 294
295INLINE int snd_interval_value(const snd_interval_t *i) 295INLINE int snd_interval_value(const struct snd_interval *i)
296{ 296{
297 assert(snd_interval_single(i)); 297 assert(snd_interval_single(i));
298 return i->min; 298 return i->min;
299} 299}
300 300
301INLINE int snd_interval_min(const snd_interval_t *i) 301INLINE int snd_interval_min(const struct snd_interval *i)
302{ 302{
303 assert(!snd_interval_empty(i)); 303 assert(!snd_interval_empty(i));
304 return i->min; 304 return i->min;
305} 305}
306 306
307INLINE int snd_interval_max(const snd_interval_t *i) 307INLINE int snd_interval_max(const struct snd_interval *i)
308{ 308{
309 unsigned int v; 309 unsigned int v;
310 assert(!snd_interval_empty(i)); 310 assert(!snd_interval_empty(i));
@@ -314,18 +314,18 @@ INLINE int snd_interval_max(const snd_interval_t *i)
314 return v; 314 return v;
315} 315}
316 316
317INLINE int snd_interval_test(const snd_interval_t *i, unsigned int val) 317INLINE int snd_interval_test(const struct snd_interval *i, unsigned int val)
318{ 318{
319 return !((i->min > val || (i->min == val && i->openmin) || 319 return !((i->min > val || (i->min == val && i->openmin) ||
320 i->max < val || (i->max == val && i->openmax))); 320 i->max < val || (i->max == val && i->openmax)));
321} 321}
322 322
323INLINE void snd_interval_copy(snd_interval_t *d, const snd_interval_t *s) 323INLINE void snd_interval_copy(struct snd_interval *d, const struct snd_interval *s)
324{ 324{
325 *d = *s; 325 *d = *s;
326} 326}
327 327
328INLINE int snd_interval_setinteger(snd_interval_t *i) 328INLINE int snd_interval_setinteger(struct snd_interval *i)
329{ 329{
330 if (i->integer) 330 if (i->integer)
331 return 0; 331 return 0;
@@ -335,7 +335,7 @@ INLINE int snd_interval_setinteger(snd_interval_t *i)
335 return 1; 335 return 1;
336} 336}
337 337
338INLINE int snd_interval_eq(const snd_interval_t *i1, const snd_interval_t *i2) 338INLINE int snd_interval_eq(const struct snd_interval *i1, const struct snd_interval *i2)
339{ 339{
340 if (i1->empty) 340 if (i1->empty)
341 return i2->empty; 341 return i2->empty;
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 3f9db510dee3..d19bddfbf995 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -36,11 +36,6 @@
36 * Raw MIDI interface 36 * Raw MIDI interface
37 */ 37 */
38 38
39typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t;
40typedef struct sndrv_rawmidi_info snd_rawmidi_info_t;
41typedef struct sndrv_rawmidi_params snd_rawmidi_params_t;
42typedef struct sndrv_rawmidi_status snd_rawmidi_status_t;
43
44#define SNDRV_RAWMIDI_DEVICES 8 39#define SNDRV_RAWMIDI_DEVICES 8
45 40
46#define SNDRV_RAWMIDI_LFLG_OUTPUT (1<<0) 41#define SNDRV_RAWMIDI_LFLG_OUTPUT (1<<0)
@@ -49,23 +44,22 @@ typedef struct sndrv_rawmidi_status snd_rawmidi_status_t;
49#define SNDRV_RAWMIDI_LFLG_APPEND (1<<2) 44#define SNDRV_RAWMIDI_LFLG_APPEND (1<<2)
50#define SNDRV_RAWMIDI_LFLG_NOOPENLOCK (1<<3) 45#define SNDRV_RAWMIDI_LFLG_NOOPENLOCK (1<<3)
51 46
52typedef struct _snd_rawmidi_runtime snd_rawmidi_runtime_t; 47struct snd_rawmidi;
53typedef struct _snd_rawmidi_substream snd_rawmidi_substream_t; 48struct snd_rawmidi_substream;
54typedef struct _snd_rawmidi_str snd_rawmidi_str_t;
55 49
56typedef struct _snd_rawmidi_ops { 50struct snd_rawmidi_ops {
57 int (*open) (snd_rawmidi_substream_t * substream); 51 int (*open) (struct snd_rawmidi_substream * substream);
58 int (*close) (snd_rawmidi_substream_t * substream); 52 int (*close) (struct snd_rawmidi_substream * substream);
59 void (*trigger) (snd_rawmidi_substream_t * substream, int up); 53 void (*trigger) (struct snd_rawmidi_substream * substream, int up);
60 void (*drain) (snd_rawmidi_substream_t * substream); 54 void (*drain) (struct snd_rawmidi_substream * substream);
61} snd_rawmidi_ops_t; 55};
62 56
63typedef struct _snd_rawmidi_global_ops { 57struct snd_rawmidi_global_ops {
64 int (*dev_register) (snd_rawmidi_t * rmidi); 58 int (*dev_register) (struct snd_rawmidi * rmidi);
65 int (*dev_unregister) (snd_rawmidi_t * rmidi); 59 int (*dev_unregister) (struct snd_rawmidi * rmidi);
66} snd_rawmidi_global_ops_t; 60};
67 61
68struct _snd_rawmidi_runtime { 62struct snd_rawmidi_runtime {
69 unsigned int drain: 1, /* drain stage */ 63 unsigned int drain: 1, /* drain stage */
70 oss: 1; /* OSS compatible mode */ 64 oss: 1; /* OSS compatible mode */
71 /* midi stream buffer */ 65 /* midi stream buffer */
@@ -80,15 +74,15 @@ struct _snd_rawmidi_runtime {
80 spinlock_t lock; 74 spinlock_t lock;
81 wait_queue_head_t sleep; 75 wait_queue_head_t sleep;
82 /* event handler (new bytes, input only) */ 76 /* event handler (new bytes, input only) */
83 void (*event)(snd_rawmidi_substream_t *substream); 77 void (*event)(struct snd_rawmidi_substream *substream);
84 /* defers calls to event [input] or ops->trigger [output] */ 78 /* defers calls to event [input] or ops->trigger [output] */
85 struct tasklet_struct tasklet; 79 struct tasklet_struct tasklet;
86 /* private data */ 80 /* private data */
87 void *private_data; 81 void *private_data;
88 void (*private_free)(snd_rawmidi_substream_t *substream); 82 void (*private_free)(struct snd_rawmidi_substream *substream);
89}; 83};
90 84
91struct _snd_rawmidi_substream { 85struct snd_rawmidi_substream {
92 struct list_head list; /* list of all substream for given stream */ 86 struct list_head list; /* list of all substream for given stream */
93 int stream; /* direction */ 87 int stream; /* direction */
94 int number; /* substream number */ 88 int number; /* substream number */
@@ -97,29 +91,29 @@ struct _snd_rawmidi_substream {
97 active_sensing: 1; /* send active sensing when close */ 91 active_sensing: 1; /* send active sensing when close */
98 int use_count; /* use counter (for output) */ 92 int use_count; /* use counter (for output) */
99 size_t bytes; 93 size_t bytes;
100 snd_rawmidi_t *rmidi; 94 struct snd_rawmidi *rmidi;
101 snd_rawmidi_str_t *pstr; 95 struct snd_rawmidi_str *pstr;
102 char name[32]; 96 char name[32];
103 snd_rawmidi_runtime_t *runtime; 97 struct snd_rawmidi_runtime *runtime;
104 /* hardware layer */ 98 /* hardware layer */
105 snd_rawmidi_ops_t *ops; 99 struct snd_rawmidi_ops *ops;
106}; 100};
107 101
108typedef struct _snd_rawmidi_file { 102struct snd_rawmidi_file {
109 snd_rawmidi_t *rmidi; 103 struct snd_rawmidi *rmidi;
110 snd_rawmidi_substream_t *input; 104 struct snd_rawmidi_substream *input;
111 snd_rawmidi_substream_t *output; 105 struct snd_rawmidi_substream *output;
112} snd_rawmidi_file_t; 106};
113 107
114struct _snd_rawmidi_str { 108struct snd_rawmidi_str {
115 unsigned int substream_count; 109 unsigned int substream_count;
116 unsigned int substream_opened; 110 unsigned int substream_opened;
117 struct list_head substreams; 111 struct list_head substreams;
118}; 112};
119 113
120struct _snd_rawmidi { 114struct snd_rawmidi {
121 snd_card_t *card; 115 struct snd_card *card;
122 116 struct list_head list;
123 unsigned int device; /* device number */ 117 unsigned int device; /* device number */
124 unsigned int info_flags; /* SNDRV_RAWMIDI_INFO_XXXX */ 118 unsigned int info_flags; /* SNDRV_RAWMIDI_INFO_XXXX */
125 char id[64]; 119 char id[64];
@@ -129,52 +123,61 @@ struct _snd_rawmidi {
129 int ossreg; 123 int ossreg;
130#endif 124#endif
131 125
132 snd_rawmidi_global_ops_t *ops; 126 struct snd_rawmidi_global_ops *ops;
133 127
134 snd_rawmidi_str_t streams[2]; 128 struct snd_rawmidi_str streams[2];
135 129
136 void *private_data; 130 void *private_data;
137 void (*private_free) (snd_rawmidi_t *rmidi); 131 void (*private_free) (struct snd_rawmidi *rmidi);
138 132
139 struct semaphore open_mutex; 133 struct semaphore open_mutex;
140 wait_queue_head_t open_wait; 134 wait_queue_head_t open_wait;
141 135
142 snd_info_entry_t *dev; 136 struct snd_info_entry *dev;
143 snd_info_entry_t *proc_entry; 137 struct snd_info_entry *proc_entry;
144 138
145#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 139#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
146 snd_seq_device_t *seq_dev; 140 struct snd_seq_device *seq_dev;
147#endif 141#endif
148}; 142};
149 143
150/* main rawmidi functions */ 144/* main rawmidi functions */
151 145
152int snd_rawmidi_new(snd_card_t * card, char *id, int device, 146int snd_rawmidi_new(struct snd_card *card, char *id, int device,
153 int output_count, int input_count, 147 int output_count, int input_count,
154 snd_rawmidi_t ** rmidi); 148 struct snd_rawmidi **rmidi);
155void snd_rawmidi_set_ops(snd_rawmidi_t * rmidi, int stream, snd_rawmidi_ops_t * ops); 149void snd_rawmidi_set_ops(struct snd_rawmidi *rmidi, int stream,
150 struct snd_rawmidi_ops *ops);
156 151
157/* callbacks */ 152/* callbacks */
158 153
159void snd_rawmidi_receive_reset(snd_rawmidi_substream_t * substream); 154void snd_rawmidi_receive_reset(struct snd_rawmidi_substream *substream);
160int snd_rawmidi_receive(snd_rawmidi_substream_t * substream, const unsigned char *buffer, int count); 155int snd_rawmidi_receive(struct snd_rawmidi_substream *substream,
161void snd_rawmidi_transmit_reset(snd_rawmidi_substream_t * substream); 156 const unsigned char *buffer, int count);
162int snd_rawmidi_transmit_empty(snd_rawmidi_substream_t * substream); 157void snd_rawmidi_transmit_reset(struct snd_rawmidi_substream *substream);
163int snd_rawmidi_transmit_peek(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count); 158int snd_rawmidi_transmit_empty(struct snd_rawmidi_substream *substream);
164int snd_rawmidi_transmit_ack(snd_rawmidi_substream_t * substream, int count); 159int snd_rawmidi_transmit_peek(struct snd_rawmidi_substream *substream,
165int snd_rawmidi_transmit(snd_rawmidi_substream_t * substream, unsigned char *buffer, int count); 160 unsigned char *buffer, int count);
161int snd_rawmidi_transmit_ack(struct snd_rawmidi_substream *substream, int count);
162int snd_rawmidi_transmit(struct snd_rawmidi_substream *substream,
163 unsigned char *buffer, int count);
166 164
167/* main midi functions */ 165/* main midi functions */
168 166
169int snd_rawmidi_info_select(snd_card_t *card, snd_rawmidi_info_t *info); 167int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info);
170int snd_rawmidi_kernel_open(int cardnum, int device, int subdevice, int mode, snd_rawmidi_file_t * rfile); 168int snd_rawmidi_kernel_open(struct snd_card *card, int device, int subdevice,
171int snd_rawmidi_kernel_release(snd_rawmidi_file_t * rfile); 169 int mode, struct snd_rawmidi_file *rfile);
172int snd_rawmidi_output_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params); 170int snd_rawmidi_kernel_release(struct snd_rawmidi_file *rfile);
173int snd_rawmidi_input_params(snd_rawmidi_substream_t * substream, snd_rawmidi_params_t * params); 171int snd_rawmidi_output_params(struct snd_rawmidi_substream *substream,
174int snd_rawmidi_drop_output(snd_rawmidi_substream_t * substream); 172 struct snd_rawmidi_params *params);
175int snd_rawmidi_drain_output(snd_rawmidi_substream_t * substream); 173int snd_rawmidi_input_params(struct snd_rawmidi_substream *substream,
176int snd_rawmidi_drain_input(snd_rawmidi_substream_t * substream); 174 struct snd_rawmidi_params *params);
177long snd_rawmidi_kernel_read(snd_rawmidi_substream_t * substream, unsigned char *buf, long count); 175int snd_rawmidi_drop_output(struct snd_rawmidi_substream *substream);
178long snd_rawmidi_kernel_write(snd_rawmidi_substream_t * substream, const unsigned char *buf, long count); 176int snd_rawmidi_drain_output(struct snd_rawmidi_substream *substream);
177int snd_rawmidi_drain_input(struct snd_rawmidi_substream *substream);
178long snd_rawmidi_kernel_read(struct snd_rawmidi_substream *substream,
179 unsigned char *buf, long count);
180long snd_rawmidi_kernel_write(struct snd_rawmidi_substream *substream,
181 const unsigned char *buf, long count);
179 182
180#endif /* __SOUND_RAWMIDI_H */ 183#endif /* __SOUND_RAWMIDI_H */
diff --git a/include/sound/sb.h b/include/sound/sb.h
index 7960452445e6..431d06675e36 100644
--- a/include/sound/sb.h
+++ b/include/sound/sb.h
@@ -60,7 +60,7 @@ enum sb_hw_type {
60 60
61#define SB_MPU_INPUT 1 61#define SB_MPU_INPUT 1
62 62
63struct _snd_sb { 63struct snd_sb {
64 unsigned long port; /* base port of DSP chip */ 64 unsigned long port; /* base port of DSP chip */
65 struct resource *res_port; 65 struct resource *res_port;
66 unsigned long mpu_port; /* MPU port for SB DSP 4.0+ */ 66 unsigned long mpu_port; /* MPU port for SB DSP 4.0+ */
@@ -92,24 +92,26 @@ struct _snd_sb {
92 92
93 void *csp; /* used only when CONFIG_SND_SB16_CSP is set */ 93 void *csp; /* used only when CONFIG_SND_SB16_CSP is set */
94 94
95 snd_card_t *card; 95 struct snd_card *card;
96 snd_pcm_t *pcm; 96 struct snd_pcm *pcm;
97 snd_pcm_substream_t *playback_substream; 97 struct snd_pcm_substream *playback_substream;
98 snd_pcm_substream_t *capture_substream; 98 struct snd_pcm_substream *capture_substream;
99 99
100 snd_rawmidi_t *rmidi; 100 struct snd_rawmidi *rmidi;
101 snd_rawmidi_substream_t *midi_substream_input; 101 struct snd_rawmidi_substream *midi_substream_input;
102 snd_rawmidi_substream_t *midi_substream_output; 102 struct snd_rawmidi_substream *midi_substream_output;
103 irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); 103 irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs);
104 104
105 spinlock_t reg_lock; 105 spinlock_t reg_lock;
106 spinlock_t open_lock; 106 spinlock_t open_lock;
107 spinlock_t midi_input_lock; 107 spinlock_t midi_input_lock;
108 108
109 snd_info_entry_t *proc_entry; 109 struct snd_info_entry *proc_entry;
110};
111 110
112typedef struct _snd_sb sb_t; 111#ifdef CONFIG_PM
112 unsigned char saved_regs[0x20];
113#endif
114};
113 115
114/* I/O ports */ 116/* I/O ports */
115 117
@@ -267,48 +269,52 @@ typedef struct _snd_sb sb_t;
267 * 269 *
268 */ 270 */
269 271
270static inline void snd_sb_ack_8bit(sb_t *chip) 272static inline void snd_sb_ack_8bit(struct snd_sb *chip)
271{ 273{
272 inb(SBP(chip, DATA_AVAIL)); 274 inb(SBP(chip, DATA_AVAIL));
273} 275}
274 276
275static inline void snd_sb_ack_16bit(sb_t *chip) 277static inline void snd_sb_ack_16bit(struct snd_sb *chip)
276{ 278{
277 inb(SBP(chip, DATA_AVAIL_16)); 279 inb(SBP(chip, DATA_AVAIL_16));
278} 280}
279 281
280/* sb_common.c */ 282/* sb_common.c */
281int snd_sbdsp_command(sb_t *chip, unsigned char val); 283int snd_sbdsp_command(struct snd_sb *chip, unsigned char val);
282int snd_sbdsp_get_byte(sb_t *chip); 284int snd_sbdsp_get_byte(struct snd_sb *chip);
283int snd_sbdsp_reset(sb_t *chip); 285int snd_sbdsp_reset(struct snd_sb *chip);
284int snd_sbdsp_create(snd_card_t *card, 286int snd_sbdsp_create(struct snd_card *card,
285 unsigned long port, 287 unsigned long port,
286 int irq, 288 int irq,
287 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), 289 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *),
288 int dma8, int dma16, 290 int dma8, int dma16,
289 unsigned short hardware, 291 unsigned short hardware,
290 sb_t **r_chip); 292 struct snd_sb **r_chip);
291/* sb_mixer.c */ 293/* sb_mixer.c */
292void snd_sbmixer_write(sb_t *chip, unsigned char reg, unsigned char data); 294void snd_sbmixer_write(struct snd_sb *chip, unsigned char reg, unsigned char data);
293unsigned char snd_sbmixer_read(sb_t *chip, unsigned char reg); 295unsigned char snd_sbmixer_read(struct snd_sb *chip, unsigned char reg);
294int snd_sbmixer_new(sb_t *chip); 296int snd_sbmixer_new(struct snd_sb *chip);
297#ifdef CONFIG_PM
298void snd_sbmixer_suspend(struct snd_sb *chip);
299void snd_sbmixer_resume(struct snd_sb *chip);
300#endif
295 301
296/* sb8_init.c */ 302/* sb8_init.c */
297int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); 303int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm);
298/* sb8.c */ 304/* sb8.c */
299irqreturn_t snd_sb8dsp_interrupt(sb_t *chip); 305irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip);
300int snd_sb8_playback_open(snd_pcm_substream_t *substream); 306int snd_sb8_playback_open(struct snd_pcm_substream *substream);
301int snd_sb8_capture_open(snd_pcm_substream_t *substream); 307int snd_sb8_capture_open(struct snd_pcm_substream *substream);
302int snd_sb8_playback_close(snd_pcm_substream_t *substream); 308int snd_sb8_playback_close(struct snd_pcm_substream *substream);
303int snd_sb8_capture_close(snd_pcm_substream_t *substream); 309int snd_sb8_capture_close(struct snd_pcm_substream *substream);
304/* midi8.c */ 310/* midi8.c */
305irqreturn_t snd_sb8dsp_midi_interrupt(sb_t *chip); 311irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip);
306int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi); 312int snd_sb8dsp_midi(struct snd_sb *chip, int device, struct snd_rawmidi ** rrawmidi);
307 313
308/* sb16_init.c */ 314/* sb16_init.c */
309int snd_sb16dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); 315int snd_sb16dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm);
310const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction); 316const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction);
311int snd_sb16dsp_configure(sb_t *chip); 317int snd_sb16dsp_configure(struct snd_sb *chip);
312/* sb16.c */ 318/* sb16.c */
313irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); 319irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs);
314 320
@@ -328,7 +334,7 @@ enum {
328#define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \ 334#define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \
329 ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24)) 335 ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24))
330 336
331int snd_sbmixer_add_ctl(sb_t *chip, const char *name, int index, int type, unsigned long value); 337int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int type, unsigned long value);
332 338
333/* for ease of use */ 339/* for ease of use */
334struct sbmix_elem { 340struct sbmix_elem {
@@ -352,7 +358,7 @@ struct sbmix_elem {
352 .type = SB_MIX_INPUT_SW, \ 358 .type = SB_MIX_INPUT_SW, \
353 .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) } 359 .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) }
354 360
355static inline int snd_sbmixer_add_ctl_elem(sb_t *chip, const struct sbmix_elem *c) 361static inline int snd_sbmixer_add_ctl_elem(struct snd_sb *chip, const struct sbmix_elem *c)
356{ 362{
357 return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value); 363 return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value);
358} 364}
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index eb8368b56b16..3b44d4b370f5 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -63,25 +63,25 @@
63#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 63#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000
64 64
65/* microcode header */ 65/* microcode header */
66typedef struct snd_sb_csp_mc_header { 66struct snd_sb_csp_mc_header {
67 char codec_name[16]; /* id name of codec */ 67 char codec_name[16]; /* id name of codec */
68 unsigned short func_req; /* requested function */ 68 unsigned short func_req; /* requested function */
69} snd_sb_csp_mc_header_t; 69};
70 70
71/* microcode to be loaded */ 71/* microcode to be loaded */
72typedef struct snd_sb_csp_microcode { 72struct snd_sb_csp_microcode {
73 snd_sb_csp_mc_header_t info; 73 struct snd_sb_csp_mc_header info;
74 unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; 74 unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE];
75} snd_sb_csp_microcode_t; 75};
76 76
77/* start CSP with sample_width in mono/stereo */ 77/* start CSP with sample_width in mono/stereo */
78typedef struct snd_sb_csp_start { 78struct snd_sb_csp_start {
79 int sample_width; /* sample width, look above */ 79 int sample_width; /* sample width, look above */
80 int channels; /* channels, look above */ 80 int channels; /* channels, look above */
81} snd_sb_csp_start_t; 81};
82 82
83/* CSP information */ 83/* CSP information */
84typedef struct snd_sb_csp_info { 84struct snd_sb_csp_info {
85 char codec_name[16]; /* id name of codec */ 85 char codec_name[16]; /* id name of codec */
86 unsigned short func_nr; /* function number */ 86 unsigned short func_nr; /* function number */
87 unsigned int acc_format; /* accepted PCM formats */ 87 unsigned int acc_format; /* accepted PCM formats */
@@ -93,17 +93,17 @@ typedef struct snd_sb_csp_info {
93 unsigned short run_width; /* current sample width */ 93 unsigned short run_width; /* current sample width */
94 unsigned short version; /* version id: 0x10 - 0x1f */ 94 unsigned short version; /* version id: 0x10 - 0x1f */
95 unsigned short state; /* state bits */ 95 unsigned short state; /* state bits */
96} snd_sb_csp_info_t; 96};
97 97
98/* HWDEP controls */ 98/* HWDEP controls */
99/* get CSP information */ 99/* get CSP information */
100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, snd_sb_csp_info_t) 100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
101/* load microcode to CSP */ 101/* load microcode to CSP */
102#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, snd_sb_csp_microcode_t) 102#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, struct snd_sb_csp_microcode)
103/* unload microcode from CSP */ 103/* unload microcode from CSP */
104#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) 104#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
105/* start CSP */ 105/* start CSP */
106#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, snd_sb_csp_start_t) 106#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start)
107/* stop CSP */ 107/* stop CSP */
108#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) 108#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14)
109/* pause CSP and DMA transfer */ 109/* pause CSP and DMA transfer */
@@ -115,25 +115,25 @@ typedef struct snd_sb_csp_info {
115#include "sb.h" 115#include "sb.h"
116#include "hwdep.h" 116#include "hwdep.h"
117 117
118typedef struct snd_sb_csp snd_sb_csp_t; 118struct snd_sb_csp;
119 119
120/* 120/*
121 * CSP operators 121 * CSP operators
122 */ 122 */
123typedef struct { 123struct snd_sb_csp_ops {
124 int (*csp_use) (snd_sb_csp_t * p); 124 int (*csp_use) (struct snd_sb_csp * p);
125 int (*csp_unuse) (snd_sb_csp_t * p); 125 int (*csp_unuse) (struct snd_sb_csp * p);
126 int (*csp_autoload) (snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode); 126 int (*csp_autoload) (struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode);
127 int (*csp_start) (snd_sb_csp_t * p, int sample_width, int channels); 127 int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels);
128 int (*csp_stop) (snd_sb_csp_t * p); 128 int (*csp_stop) (struct snd_sb_csp * p);
129 int (*csp_qsound_transfer) (snd_sb_csp_t * p); 129 int (*csp_qsound_transfer) (struct snd_sb_csp * p);
130} snd_sb_csp_ops_t; 130};
131 131
132/* 132/*
133 * CSP private data 133 * CSP private data
134 */ 134 */
135struct snd_sb_csp { 135struct snd_sb_csp {
136 sb_t *chip; /* SB16 DSP */ 136 struct snd_sb *chip; /* SB16 DSP */
137 int used; /* usage flag - exclusive */ 137 int used; /* usage flag - exclusive */
138 char codec_name[16]; /* name of codec */ 138 char codec_name[16]; /* name of codec */
139 unsigned short func_nr; /* function number */ 139 unsigned short func_nr; /* function number */
@@ -147,7 +147,7 @@ struct snd_sb_csp {
147 int version; /* CSP version (0x10 - 0x1f) */ 147 int version; /* CSP version (0x10 - 0x1f) */
148 int running; /* running state */ 148 int running; /* running state */
149 149
150 snd_sb_csp_ops_t ops; /* operators */ 150 struct snd_sb_csp_ops ops; /* operators */
151 151
152 spinlock_t q_lock; /* locking */ 152 spinlock_t q_lock; /* locking */
153 int q_enabled; /* enabled flag */ 153 int q_enabled; /* enabled flag */
@@ -155,13 +155,13 @@ struct snd_sb_csp {
155 int qpos_right; /* right position */ 155 int qpos_right; /* right position */
156 int qpos_changed; /* position changed flag */ 156 int qpos_changed; /* position changed flag */
157 157
158 snd_kcontrol_t *qsound_switch; 158 struct snd_kcontrol *qsound_switch;
159 snd_kcontrol_t *qsound_space; 159 struct snd_kcontrol *qsound_space;
160 160
161 struct semaphore access_mutex; /* locking */ 161 struct semaphore access_mutex; /* locking */
162}; 162};
163 163
164int snd_sb_csp_new(sb_t *chip, int device, snd_hwdep_t ** rhwdep); 164int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep);
165#endif 165#endif
166 166
167#endif /* __SOUND_SB16_CSP */ 167#endif /* __SOUND_SB16_CSP */
diff --git a/include/sound/seq_device.h b/include/sound/seq_device.h
index 204ca540c28e..2b5f24cc7548 100644
--- a/include/sound/seq_device.h
+++ b/include/sound/seq_device.h
@@ -21,9 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24typedef struct snd_seq_device snd_seq_device_t;
25typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
26
27/* 24/*
28 * registered device information 25 * registered device information
29 */ 26 */
@@ -36,7 +33,7 @@ typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
36 33
37struct snd_seq_device { 34struct snd_seq_device {
38 /* device info */ 35 /* device info */
39 snd_card_t *card; /* sound card */ 36 struct snd_card *card; /* sound card */
40 int device; /* device number */ 37 int device; /* device number */
41 char id[ID_LEN]; /* driver id */ 38 char id[ID_LEN]; /* driver id */
42 char name[80]; /* device name */ 39 char name[80]; /* device name */
@@ -44,7 +41,7 @@ struct snd_seq_device {
44 void *driver_data; /* private data for driver */ 41 void *driver_data; /* private data for driver */
45 int status; /* flag - read only */ 42 int status; /* flag - read only */
46 void *private_data; /* private data for the caller */ 43 void *private_data; /* private data for the caller */
47 void (*private_free)(snd_seq_device_t *device); 44 void (*private_free)(struct snd_seq_device *device);
48 struct list_head list; /* link to next device */ 45 struct list_head list; /* link to next device */
49}; 46};
50 47
@@ -63,19 +60,19 @@ struct snd_seq_device {
63 * Typically, call snd_device_free(dev->card, dev->driver_data) 60 * Typically, call snd_device_free(dev->card, dev->driver_data)
64 */ 61 */
65struct snd_seq_dev_ops { 62struct snd_seq_dev_ops {
66 int (*init_device)(snd_seq_device_t *dev); 63 int (*init_device)(struct snd_seq_device *dev);
67 int (*free_device)(snd_seq_device_t *dev); 64 int (*free_device)(struct snd_seq_device *dev);
68}; 65};
69 66
70/* 67/*
71 * prototypes 68 * prototypes
72 */ 69 */
73void snd_seq_device_load_drivers(void); 70void snd_seq_device_load_drivers(void);
74int snd_seq_device_new(snd_card_t *card, int device, char *id, int argsize, snd_seq_device_t **result); 71int snd_seq_device_new(struct snd_card *card, int device, char *id, int argsize, struct snd_seq_device **result);
75int snd_seq_device_register_driver(char *id, snd_seq_dev_ops_t *entry, int argsize); 72int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, int argsize);
76int snd_seq_device_unregister_driver(char *id); 73int snd_seq_device_unregister_driver(char *id);
77 74
78#define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(snd_seq_device_t)) 75#define SNDRV_SEQ_DEVICE_ARGPTR(dev) (void *)((char *)(dev) + sizeof(struct snd_seq_device))
79 76
80 77
81/* 78/*
@@ -84,5 +81,4 @@ int snd_seq_device_unregister_driver(char *id);
84#define SNDRV_SEQ_DEV_ID_MIDISYNTH "seq-midi" 81#define SNDRV_SEQ_DEV_ID_MIDISYNTH "seq-midi"
85#define SNDRV_SEQ_DEV_ID_OPL3 "opl3-synth" 82#define SNDRV_SEQ_DEV_ID_OPL3 "opl3-synth"
86 83
87
88#endif /* __SOUND_SEQ_DEVICE_H */ 84#endif /* __SOUND_SEQ_DEVICE_H */
diff --git a/include/sound/seq_instr.h b/include/sound/seq_instr.h
index 1a654df4aa97..db764f09efb7 100644
--- a/include/sound/seq_instr.h
+++ b/include/sound/seq_instr.h
@@ -24,29 +24,27 @@
24#include "seq_kernel.h" 24#include "seq_kernel.h"
25 25
26/* Instrument cluster */ 26/* Instrument cluster */
27typedef struct _snd_seq_kcluster { 27struct snd_seq_kcluster {
28 snd_seq_instr_cluster_t cluster; 28 snd_seq_instr_cluster_t cluster;
29 char name[32]; 29 char name[32];
30 int priority; 30 int priority;
31 struct _snd_seq_kcluster *next; 31 struct snd_seq_kcluster *next;
32} snd_seq_kcluster_t; 32};
33 33
34/* return pointer to private data */ 34/* return pointer to private data */
35#define KINSTR_DATA(kinstr) (void *)(((char *)kinstr) + sizeof(snd_seq_kinstr_t)) 35#define KINSTR_DATA(kinstr) (void *)(((char *)kinstr) + sizeof(struct snd_seq_kinstr))
36
37typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t;
38 36
39/* Instrument structure */ 37/* Instrument structure */
40typedef struct _snd_seq_kinstr { 38struct snd_seq_kinstr {
41 snd_seq_instr_t instr; 39 struct snd_seq_instr instr;
42 char name[32]; 40 char name[32];
43 int type; /* instrument type */ 41 int type; /* instrument type */
44 int use; /* use count */ 42 int use; /* use count */
45 int busy; /* not useable */ 43 int busy; /* not useable */
46 int add_len; /* additional length */ 44 int add_len; /* additional length */
47 snd_seq_kinstr_ops_t *ops; /* operations */ 45 struct snd_seq_kinstr_ops *ops; /* operations */
48 struct _snd_seq_kinstr *next; 46 struct snd_seq_kinstr *next;
49} snd_seq_kinstr_t; 47};
50 48
51#define SNDRV_SEQ_INSTR_HASH_SIZE 32 49#define SNDRV_SEQ_INSTR_HASH_SIZE 32
52 50
@@ -54,11 +52,11 @@ typedef struct _snd_seq_kinstr {
54#define SNDRV_SEQ_INSTR_FLG_DIRECT (1<<0) /* accept only direct events */ 52#define SNDRV_SEQ_INSTR_FLG_DIRECT (1<<0) /* accept only direct events */
55 53
56/* List of all instruments */ 54/* List of all instruments */
57typedef struct { 55struct snd_seq_kinstr_list {
58 snd_seq_kinstr_t *hash[SNDRV_SEQ_INSTR_HASH_SIZE]; 56 struct snd_seq_kinstr *hash[SNDRV_SEQ_INSTR_HASH_SIZE];
59 int count; /* count of all instruments */ 57 int count; /* count of all instruments */
60 58
61 snd_seq_kcluster_t *chash[SNDRV_SEQ_INSTR_HASH_SIZE]; 59 struct snd_seq_kcluster *chash[SNDRV_SEQ_INSTR_HASH_SIZE];
62 int ccount; /* count of all clusters */ 60 int ccount; /* count of all clusters */
63 61
64 int owner; /* current owner of the instrument list */ 62 int owner; /* current owner of the instrument list */
@@ -68,7 +66,7 @@ typedef struct {
68 spinlock_t ops_lock; 66 spinlock_t ops_lock;
69 struct semaphore ops_mutex; 67 struct semaphore ops_mutex;
70 unsigned long ops_flags; 68 unsigned long ops_flags;
71} snd_seq_kinstr_list_t; 69};
72 70
73#define SNDRV_SEQ_INSTR_NOTIFY_REMOVE 0 71#define SNDRV_SEQ_INSTR_NOTIFY_REMOVE 0
74#define SNDRV_SEQ_INSTR_NOTIFY_CHANGE 1 72#define SNDRV_SEQ_INSTR_NOTIFY_CHANGE 1
@@ -78,33 +76,33 @@ struct snd_seq_kinstr_ops {
78 long add_len; /* additional length */ 76 long add_len; /* additional length */
79 char *instr_type; 77 char *instr_type;
80 int (*info)(void *private_data, char *info_data, long len); 78 int (*info)(void *private_data, char *info_data, long len);
81 int (*put)(void *private_data, snd_seq_kinstr_t *kinstr, 79 int (*put)(void *private_data, struct snd_seq_kinstr *kinstr,
82 char __user *instr_data, long len, int atomic, int cmd); 80 char __user *instr_data, long len, int atomic, int cmd);
83 int (*get)(void *private_data, snd_seq_kinstr_t *kinstr, 81 int (*get)(void *private_data, struct snd_seq_kinstr *kinstr,
84 char __user *instr_data, long len, int atomic, int cmd); 82 char __user *instr_data, long len, int atomic, int cmd);
85 int (*get_size)(void *private_data, snd_seq_kinstr_t *kinstr, long *size); 83 int (*get_size)(void *private_data, struct snd_seq_kinstr *kinstr, long *size);
86 int (*remove)(void *private_data, snd_seq_kinstr_t *kinstr, int atomic); 84 int (*remove)(void *private_data, struct snd_seq_kinstr *kinstr, int atomic);
87 void (*notify)(void *private_data, snd_seq_kinstr_t *kinstr, int what); 85 void (*notify)(void *private_data, struct snd_seq_kinstr *kinstr, int what);
88 struct snd_seq_kinstr_ops *next; 86 struct snd_seq_kinstr_ops *next;
89}; 87};
90 88
91 89
92/* instrument operations */ 90/* instrument operations */
93snd_seq_kinstr_list_t *snd_seq_instr_list_new(void); 91struct snd_seq_kinstr_list *snd_seq_instr_list_new(void);
94void snd_seq_instr_list_free(snd_seq_kinstr_list_t **list); 92void snd_seq_instr_list_free(struct snd_seq_kinstr_list **list);
95int snd_seq_instr_list_free_cond(snd_seq_kinstr_list_t *list, 93int snd_seq_instr_list_free_cond(struct snd_seq_kinstr_list *list,
96 snd_seq_instr_header_t *ifree, 94 struct snd_seq_instr_header *ifree,
97 int client, 95 int client,
98 int atomic); 96 int atomic);
99snd_seq_kinstr_t *snd_seq_instr_find(snd_seq_kinstr_list_t *list, 97struct snd_seq_kinstr *snd_seq_instr_find(struct snd_seq_kinstr_list *list,
100 snd_seq_instr_t *instr, 98 struct snd_seq_instr *instr,
101 int exact, 99 int exact,
102 int follow_alias); 100 int follow_alias);
103void snd_seq_instr_free_use(snd_seq_kinstr_list_t *list, 101void snd_seq_instr_free_use(struct snd_seq_kinstr_list *list,
104 snd_seq_kinstr_t *instr); 102 struct snd_seq_kinstr *instr);
105int snd_seq_instr_event(snd_seq_kinstr_ops_t *ops, 103int snd_seq_instr_event(struct snd_seq_kinstr_ops *ops,
106 snd_seq_kinstr_list_t *list, 104 struct snd_seq_kinstr_list *list,
107 snd_seq_event_t *ev, 105 struct snd_seq_event *ev,
108 int client, 106 int client,
109 int atomic, 107 int atomic,
110 int hop); 108 int hop);
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h
index 4beca1952c76..f023c1b97f8c 100644
--- a/include/sound/seq_kernel.h
+++ b/include/sound/seq_kernel.h
@@ -24,62 +24,8 @@
24#include <linux/time.h> 24#include <linux/time.h>
25#include "asequencer.h" 25#include "asequencer.h"
26 26
27typedef sndrv_seq_tick_time_t snd_seq_tick_time_t; 27typedef struct snd_seq_real_time snd_seq_real_time_t;
28typedef sndrv_seq_position_t snd_seq_position_t; 28typedef union snd_seq_timestamp snd_seq_timestamp_t;
29typedef sndrv_seq_frequency_t snd_seq_frequency_t;
30typedef sndrv_seq_instr_cluster_t snd_seq_instr_cluster_t;
31typedef enum sndrv_seq_client_type snd_seq_client_type_t;
32typedef enum sndrv_seq_stop_mode snd_seq_stop_mode_t;
33typedef struct sndrv_seq_port_info snd_seq_port_info_t;
34typedef struct sndrv_seq_port_subscribe snd_seq_port_subscribe_t;
35typedef struct sndrv_seq_event snd_seq_event_t;
36typedef struct sndrv_seq_addr snd_seq_addr_t;
37typedef struct sndrv_seq_ev_volume snd_seq_ev_volume_t;
38typedef struct sndrv_seq_ev_loop snd_seq_ev_loop_t;
39typedef struct sndrv_seq_remove_events snd_seq_remove_events_t;
40typedef struct sndrv_seq_query_subs snd_seq_query_subs_t;
41typedef struct sndrv_seq_real_time snd_seq_real_time_t;
42typedef struct sndrv_seq_system_info snd_seq_system_info_t;
43typedef struct sndrv_seq_client_info snd_seq_client_info_t;
44typedef struct sndrv_seq_queue_info snd_seq_queue_info_t;
45typedef struct sndrv_seq_queue_status snd_seq_queue_status_t;
46typedef struct sndrv_seq_queue_tempo snd_seq_queue_tempo_t;
47typedef struct sndrv_seq_queue_owner snd_seq_queue_owner_t;
48typedef struct sndrv_seq_queue_timer snd_seq_queue_timer_t;
49typedef struct sndrv_seq_queue_client snd_seq_queue_client_t;
50typedef struct sndrv_seq_client_pool snd_seq_client_pool_t;
51typedef struct sndrv_seq_instr snd_seq_instr_t;
52typedef struct sndrv_seq_instr_data snd_seq_instr_data_t;
53typedef struct sndrv_seq_instr_header snd_seq_instr_header_t;
54typedef union sndrv_seq_timestamp snd_seq_timestamp_t;
55
56#define snd_seq_event_bounce_ext_data sndrv_seq_event_bounce_ext_data
57#define snd_seq_ev_is_result_type sndrv_seq_ev_is_result_type
58#define snd_seq_ev_is_channel_type sndrv_seq_ev_is_channel_type
59#define snd_seq_ev_is_note_type sndrv_seq_ev_is_note_type
60#define snd_seq_ev_is_control_type sndrv_seq_ev_is_control_type
61#define snd_seq_ev_is_queue_type sndrv_seq_ev_is_queue_type
62#define snd_seq_ev_is_message_type sndrv_seq_ev_is_message_type
63#define snd_seq_ev_is_sample_type sndrv_seq_ev_is_sample_type
64#define snd_seq_ev_is_user_type sndrv_seq_ev_is_user_type
65#define snd_seq_ev_is_fixed_type sndrv_seq_ev_is_fixed_type
66#define snd_seq_ev_is_instr_type sndrv_seq_ev_is_instr_type
67#define snd_seq_ev_is_variable_type sndrv_seq_ev_is_variable_type
68#define snd_seq_ev_is_reserved sndrv_seq_ev_is_reserved
69#define snd_seq_ev_is_direct sndrv_seq_ev_is_direct
70#define snd_seq_ev_is_prior sndrv_seq_ev_is_prior
71#define snd_seq_ev_length_type sndrv_seq_ev_length_type
72#define snd_seq_ev_is_fixed sndrv_seq_ev_is_fixed
73#define snd_seq_ev_is_variable sndrv_seq_ev_is_variable
74#define snd_seq_ev_is_varusr sndrv_seq_ev_is_varusr
75#define snd_seq_ev_timestamp_type sndrv_seq_ev_timestamp_type
76#define snd_seq_ev_is_tick sndrv_seq_ev_is_tick
77#define snd_seq_ev_is_real sndrv_seq_ev_is_real
78#define snd_seq_ev_timemode_type sndrv_seq_ev_timemode_type
79#define snd_seq_ev_is_abstime sndrv_seq_ev_is_abstime
80#define snd_seq_ev_is_reltime sndrv_seq_ev_is_reltime
81#define snd_seq_queue_sync_port sndrv_seq_queue_sync_port
82#define snd_seq_queue_owner sndrv_seq_queue_owner
83 29
84/* maximum number of events dequeued per schedule interval */ 30/* maximum number of events dequeued per schedule interval */
85#define SNDRV_SEQ_MAX_DEQUEUE 50 31#define SNDRV_SEQ_MAX_DEQUEUE 50
@@ -114,69 +60,48 @@ typedef union sndrv_seq_timestamp snd_seq_timestamp_t;
114/* max size of event size */ 60/* max size of event size */
115#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff 61#define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff
116 62
117/* typedefs */
118struct _snd_seq_user_client;
119struct _snd_seq_kernel_client;
120struct _snd_seq_client;
121struct _snd_seq_queue;
122
123typedef struct _snd_seq_user_client user_client_t;
124typedef struct _snd_seq_kernel_client kernel_client_t;
125typedef struct _snd_seq_client client_t;
126typedef struct _snd_seq_queue queue_t;
127
128/* call-backs for kernel client */
129
130typedef struct {
131 void *private_data;
132 unsigned allow_input: 1,
133 allow_output: 1;
134 /*...*/
135} snd_seq_client_callback_t;
136
137/* call-backs for kernel port */ 63/* call-backs for kernel port */
138typedef int (snd_seq_kernel_port_open_t)(void *private_data, snd_seq_port_subscribe_t *info); 64struct snd_seq_port_callback {
139typedef int (snd_seq_kernel_port_close_t)(void *private_data, snd_seq_port_subscribe_t *info);
140typedef int (snd_seq_kernel_port_input_t)(snd_seq_event_t *ev, int direct, void *private_data, int atomic, int hop);
141typedef void (snd_seq_kernel_port_private_free_t)(void *private_data);
142
143typedef struct {
144 struct module *owner; 65 struct module *owner;
145 void *private_data; 66 void *private_data;
146 snd_seq_kernel_port_open_t *subscribe; 67 int (*subscribe)(void *private_data, struct snd_seq_port_subscribe *info);
147 snd_seq_kernel_port_close_t *unsubscribe; 68 int (*unsubscribe)(void *private_data, struct snd_seq_port_subscribe *info);
148 snd_seq_kernel_port_open_t *use; 69 int (*use)(void *private_data, struct snd_seq_port_subscribe *info);
149 snd_seq_kernel_port_close_t *unuse; 70 int (*unuse)(void *private_data, struct snd_seq_port_subscribe *info);
150 snd_seq_kernel_port_input_t *event_input; 71 int (*event_input)(struct snd_seq_event *ev, int direct, void *private_data, int atomic, int hop);
151 snd_seq_kernel_port_private_free_t *private_free; 72 void (*private_free)(void *private_data);
152 unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */ 73 unsigned int callback_all; /* call subscribe callbacks at each connection/disconnection */
153 /*...*/ 74 /*...*/
154} snd_seq_port_callback_t; 75};
155 76
156/* interface for kernel client */ 77/* interface for kernel client */
157extern int snd_seq_create_kernel_client(snd_card_t *card, int client_index, snd_seq_client_callback_t *callback); 78int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
158extern int snd_seq_delete_kernel_client(int client); 79 const char *name_fmt, ...)
159extern int snd_seq_kernel_client_enqueue(int client, snd_seq_event_t *ev, int atomic, int hop); 80 __attribute__ ((format (printf, 3, 4)));
160extern int snd_seq_kernel_client_dispatch(int client, snd_seq_event_t *ev, int atomic, int hop); 81int snd_seq_delete_kernel_client(int client);
161extern int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg); 82int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
83int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
84int snd_seq_kernel_client_ctl(int client, unsigned int cmd, void *arg);
162 85
163#define SNDRV_SEQ_EXT_MASK 0xc0000000 86#define SNDRV_SEQ_EXT_MASK 0xc0000000
164#define SNDRV_SEQ_EXT_USRPTR 0x80000000 87#define SNDRV_SEQ_EXT_USRPTR 0x80000000
165#define SNDRV_SEQ_EXT_CHAINED 0x40000000 88#define SNDRV_SEQ_EXT_CHAINED 0x40000000
166 89
167typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count); 90typedef int (*snd_seq_dump_func_t)(void *ptr, void *buf, int count);
168int snd_seq_expand_var_event(const snd_seq_event_t *event, int count, char *buf, int in_kernel, int size_aligned); 91int snd_seq_expand_var_event(const struct snd_seq_event *event, int count, char *buf,
169int snd_seq_dump_var_event(const snd_seq_event_t *event, snd_seq_dump_func_t func, void *private_data); 92 int in_kernel, int size_aligned);
93int snd_seq_dump_var_event(const struct snd_seq_event *event,
94 snd_seq_dump_func_t func, void *private_data);
170 95
171/* interface for OSS emulation */ 96/* interface for OSS emulation */
172int snd_seq_set_queue_tempo(int client, snd_seq_queue_tempo_t *tempo); 97int snd_seq_set_queue_tempo(int client, struct snd_seq_queue_tempo *tempo);
173 98
174/* port callback routines */ 99/* port callback routines */
175void snd_port_init_callback(snd_seq_port_callback_t *p); 100void snd_port_init_callback(struct snd_seq_port_callback *p);
176snd_seq_port_callback_t *snd_port_alloc_callback(void); 101struct snd_seq_port_callback *snd_port_alloc_callback(void);
177 102
178/* port attach/detach */ 103/* port attach/detach */
179int snd_seq_event_port_attach(int client, snd_seq_port_callback_t *pcbp, 104int snd_seq_event_port_attach(int client, struct snd_seq_port_callback *pcbp,
180 int cap, int type, int midi_channels, int midi_voices, char *portname); 105 int cap, int type, int midi_channels, int midi_voices, char *portname);
181int snd_seq_event_port_detach(int client, int port); 106int snd_seq_event_port_detach(int client, int port);
182 107
diff --git a/include/sound/seq_midi_emul.h b/include/sound/seq_midi_emul.h
index e58ca45bc73b..d6c4615901b9 100644
--- a/include/sound/seq_midi_emul.h
+++ b/include/sound/seq_midi_emul.h
@@ -29,7 +29,7 @@
29 * channel. All drivers for hardware that does not understand midi 29 * channel. All drivers for hardware that does not understand midi
30 * directly will probably need to use this structure. 30 * directly will probably need to use this structure.
31 */ 31 */
32typedef struct snd_midi_channel { 32struct snd_midi_channel {
33 void *private; /* A back pointer to driver data */ 33 void *private; /* A back pointer to driver data */
34 int number; /* The channel number */ 34 int number; /* The channel number */
35 int client; /* The client associated with this channel */ 35 int client; /* The client associated with this channel */
@@ -53,41 +53,43 @@ typedef struct snd_midi_channel {
53 short gm_rpn_fine_tuning; /* Master fine tuning */ 53 short gm_rpn_fine_tuning; /* Master fine tuning */
54 short gm_rpn_coarse_tuning; /* Master coarse tuning */ 54 short gm_rpn_coarse_tuning; /* Master coarse tuning */
55 55
56} snd_midi_channel_t; 56};
57 57
58/* 58/*
59 * A structure that represets a set of channels bound to a port. There 59 * A structure that represets a set of channels bound to a port. There
60 * would usually be 16 channels per port. But fewer could be used for 60 * would usually be 16 channels per port. But fewer could be used for
61 * particular cases. 61 * particular cases.
62 * The channel set consists of information describing the client and 62 * The channel set consists of information describing the client and
63 * port for this midi synth and an array of snd_midi_channel_t structures. 63 * port for this midi synth and an array of snd_midi_channel structures.
64 * A driver that had no need for snd_midi_channel_t could still use the 64 * A driver that had no need for snd_midi_channel could still use the
65 * channel set type if it wished with the channel array null. 65 * channel set type if it wished with the channel array null.
66 */ 66 */
67typedef struct snd_midi_channel_set { 67struct snd_midi_channel_set {
68 void *private_data; /* Driver data */ 68 void *private_data; /* Driver data */
69 int client; /* Client for this port */ 69 int client; /* Client for this port */
70 int port; /* The port number */ 70 int port; /* The port number */
71 71
72 int max_channels; /* Size of the channels array */ 72 int max_channels; /* Size of the channels array */
73 snd_midi_channel_t *channels; 73 struct snd_midi_channel *channels;
74 74
75 unsigned char midi_mode; /* MIDI operating mode */ 75 unsigned char midi_mode; /* MIDI operating mode */
76 unsigned char gs_master_volume; /* SYSEX master volume: 0-127 */ 76 unsigned char gs_master_volume; /* SYSEX master volume: 0-127 */
77 unsigned char gs_chorus_mode; 77 unsigned char gs_chorus_mode;
78 unsigned char gs_reverb_mode; 78 unsigned char gs_reverb_mode;
79 79
80} snd_midi_channel_set_t; 80};
81 81
82typedef struct snd_seq_midi_op { 82struct snd_midi_op {
83 void (*note_on)(void *private_data, int note, int vel, snd_midi_channel_t *chan); 83 void (*note_on)(void *private_data, int note, int vel, struct snd_midi_channel *chan);
84 void (*note_off)(void *private_data,int note, int vel, snd_midi_channel_t *chan); /* release note */ 84 void (*note_off)(void *private_data,int note, int vel, struct snd_midi_channel *chan); /* release note */
85 void (*key_press)(void *private_data, int note, int vel, snd_midi_channel_t *chan); 85 void (*key_press)(void *private_data, int note, int vel, struct snd_midi_channel *chan);
86 void (*note_terminate)(void *private_data, int note, snd_midi_channel_t *chan); /* terminate note immediately */ 86 void (*note_terminate)(void *private_data, int note, struct snd_midi_channel *chan); /* terminate note immediately */
87 void (*control)(void *private_data, int type, snd_midi_channel_t *chan); 87 void (*control)(void *private_data, int type, struct snd_midi_channel *chan);
88 void (*nrpn)(void *private_data, snd_midi_channel_t *chan, snd_midi_channel_set_t *chset); 88 void (*nrpn)(void *private_data, struct snd_midi_channel *chan,
89 void (*sysex)(void *private_data, unsigned char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 89 struct snd_midi_channel_set *chset);
90} snd_midi_op_t; 90 void (*sysex)(void *private_data, unsigned char *buf, int len, int parsed,
91 struct snd_midi_channel_set *chset);
92};
91 93
92/* 94/*
93 * These defines are used so that pitchbend, aftertouch etc, can be 95 * These defines are used so that pitchbend, aftertouch etc, can be
@@ -186,10 +188,10 @@ enum {
186}; 188};
187 189
188/* Prototypes for midi_process.c */ 190/* Prototypes for midi_process.c */
189void snd_midi_process_event(snd_midi_op_t *ops, snd_seq_event_t *ev, 191void snd_midi_process_event(struct snd_midi_op *ops, struct snd_seq_event *ev,
190 snd_midi_channel_set_t *chanset); 192 struct snd_midi_channel_set *chanset);
191void snd_midi_channel_set_clear(snd_midi_channel_set_t *chset); 193void snd_midi_channel_set_clear(struct snd_midi_channel_set *chset);
192snd_midi_channel_set_t *snd_midi_channel_alloc_set(int n); 194struct snd_midi_channel_set *snd_midi_channel_alloc_set(int n);
193void snd_midi_channel_free_set(snd_midi_channel_set_t *chset); 195void snd_midi_channel_free_set(struct snd_midi_channel_set *chset);
194 196
195#endif /* __SOUND_SEQ_MIDI_EMUL_H */ 197#endif /* __SOUND_SEQ_MIDI_EMUL_H */
diff --git a/include/sound/seq_midi_event.h b/include/sound/seq_midi_event.h
index 8857e2bd31a5..dd789e7cdb20 100644
--- a/include/sound/seq_midi_event.h
+++ b/include/sound/seq_midi_event.h
@@ -26,10 +26,8 @@
26 26
27#define MAX_MIDI_EVENT_BUF 256 27#define MAX_MIDI_EVENT_BUF 256
28 28
29typedef struct snd_midi_event_t snd_midi_event_t;
30
31/* midi status */ 29/* midi status */
32struct snd_midi_event_t { 30struct snd_midi_event {
33 int qlen; /* queue length */ 31 int qlen; /* queue length */
34 int read; /* chars read */ 32 int read; /* chars read */
35 int type; /* current event type */ 33 int type; /* current event type */
@@ -40,15 +38,17 @@ struct snd_midi_event_t {
40 spinlock_t lock; 38 spinlock_t lock;
41}; 39};
42 40
43int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev); 41int snd_midi_event_new(int bufsize, struct snd_midi_event **rdev);
44void snd_midi_event_free(snd_midi_event_t *dev); 42void snd_midi_event_free(struct snd_midi_event *dev);
45void snd_midi_event_reset_encode(snd_midi_event_t *dev); 43void snd_midi_event_reset_encode(struct snd_midi_event *dev);
46void snd_midi_event_reset_decode(snd_midi_event_t *dev); 44void snd_midi_event_reset_decode(struct snd_midi_event *dev);
47void snd_midi_event_no_status(snd_midi_event_t *dev, int on); 45void snd_midi_event_no_status(struct snd_midi_event *dev, int on);
48/* encode from byte stream - return number of written bytes if success */ 46/* encode from byte stream - return number of written bytes if success */
49long snd_midi_event_encode(snd_midi_event_t *dev, unsigned char *buf, long count, snd_seq_event_t *ev); 47long snd_midi_event_encode(struct snd_midi_event *dev, unsigned char *buf, long count,
50int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev); 48 struct snd_seq_event *ev);
49int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c, struct snd_seq_event *ev);
51/* decode from event to bytes - return number of written bytes if success */ 50/* decode from event to bytes - return number of written bytes if success */
52long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, snd_seq_event_t *ev); 51long snd_midi_event_decode(struct snd_midi_event *dev, unsigned char *buf, long count,
52 struct snd_seq_event *ev);
53 53
54#endif /* __SOUND_SEQ_MIDI_EVENT_H */ 54#endif /* __SOUND_SEQ_MIDI_EVENT_H */
diff --git a/include/sound/seq_oss.h b/include/sound/seq_oss.h
index bd7e57322ab6..9b060bbd6e02 100644
--- a/include/sound/seq_oss.h
+++ b/include/sound/seq_oss.h
@@ -25,22 +25,16 @@
25#include "seq_kernel.h" 25#include "seq_kernel.h"
26 26
27/* 27/*
28 * type definitions
29 */
30typedef struct snd_seq_oss_arg_t snd_seq_oss_arg_t;
31typedef struct snd_seq_oss_callback_t snd_seq_oss_callback_t;
32
33/*
34 * argument structure for synthesizer operations 28 * argument structure for synthesizer operations
35 */ 29 */
36struct snd_seq_oss_arg_t { 30struct snd_seq_oss_arg {
37 /* given by OSS sequencer */ 31 /* given by OSS sequencer */
38 int app_index; /* application unique index */ 32 int app_index; /* application unique index */
39 int file_mode; /* file mode - see below */ 33 int file_mode; /* file mode - see below */
40 int seq_mode; /* sequencer mode - see below */ 34 int seq_mode; /* sequencer mode - see below */
41 35
42 /* following must be initialized in open callback */ 36 /* following must be initialized in open callback */
43 snd_seq_addr_t addr; /* opened port address */ 37 struct snd_seq_addr addr; /* opened port address */
44 void *private_data; /* private data for lowlevel drivers */ 38 void *private_data; /* private data for lowlevel drivers */
45 39
46 /* note-on event passing mode: initially given by OSS seq, 40 /* note-on event passing mode: initially given by OSS seq,
@@ -53,14 +47,14 @@ struct snd_seq_oss_arg_t {
53/* 47/*
54 * synthesizer operation callbacks 48 * synthesizer operation callbacks
55 */ 49 */
56struct snd_seq_oss_callback_t { 50struct snd_seq_oss_callback {
57 struct module *owner; 51 struct module *owner;
58 int (*open)(snd_seq_oss_arg_t *p, void *closure); 52 int (*open)(struct snd_seq_oss_arg *p, void *closure);
59 int (*close)(snd_seq_oss_arg_t *p); 53 int (*close)(struct snd_seq_oss_arg *p);
60 int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg); 54 int (*ioctl)(struct snd_seq_oss_arg *p, unsigned int cmd, unsigned long arg);
61 int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char __user *buf, int offs, int count); 55 int (*load_patch)(struct snd_seq_oss_arg *p, int format, const char __user *buf, int offs, int count);
62 int (*reset)(snd_seq_oss_arg_t *p); 56 int (*reset)(struct snd_seq_oss_arg *p);
63 int (*raw_event)(snd_seq_oss_arg_t *p, unsigned char *data); 57 int (*raw_event)(struct snd_seq_oss_arg *p, unsigned char *data);
64}; 58};
65 59
66/* flag: file_mode */ 60/* flag: file_mode */
@@ -88,13 +82,13 @@ struct snd_seq_oss_callback_t {
88/* 82/*
89 * data pointer to snd_seq_register_device 83 * data pointer to snd_seq_register_device
90 */ 84 */
91typedef struct snd_seq_oss_reg { 85struct snd_seq_oss_reg {
92 int type; 86 int type;
93 int subtype; 87 int subtype;
94 int nvoices; 88 int nvoices;
95 snd_seq_oss_callback_t oper; 89 struct snd_seq_oss_callback oper;
96 void *private_data; 90 void *private_data;
97} snd_seq_oss_reg_t; 91};
98 92
99/* device id */ 93/* device id */
100#define SNDRV_SEQ_DEV_ID_OSS "seq-oss" 94#define SNDRV_SEQ_DEV_ID_OSS "seq-oss"
diff --git a/include/sound/seq_virmidi.h b/include/sound/seq_virmidi.h
index 1ad27e859af3..8d5aea76d7c3 100644
--- a/include/sound/seq_virmidi.h
+++ b/include/sound/seq_virmidi.h
@@ -25,25 +25,23 @@
25#include "rawmidi.h" 25#include "rawmidi.h"
26#include "seq_midi_event.h" 26#include "seq_midi_event.h"
27 27
28typedef struct _snd_virmidi_dev snd_virmidi_dev_t;
29
30/* 28/*
31 * device file instance: 29 * device file instance:
32 * This instance is created at each time the midi device file is 30 * This instance is created at each time the midi device file is
33 * opened. Each instance has its own input buffer and MIDI parser 31 * opened. Each instance has its own input buffer and MIDI parser
34 * (buffer), and is associated with the device instance. 32 * (buffer), and is associated with the device instance.
35 */ 33 */
36typedef struct _snd_virmidi { 34struct snd_virmidi {
37 struct list_head list; 35 struct list_head list;
38 int seq_mode; 36 int seq_mode;
39 int client; 37 int client;
40 int port; 38 int port;
41 unsigned int trigger: 1; 39 unsigned int trigger: 1;
42 snd_midi_event_t *parser; 40 struct snd_midi_event *parser;
43 snd_seq_event_t event; 41 struct snd_seq_event event;
44 snd_virmidi_dev_t *rdev; 42 struct snd_virmidi_dev *rdev;
45 snd_rawmidi_substream_t *substream; 43 struct snd_rawmidi_substream *substream;
46} snd_virmidi_t; 44};
47 45
48#define SNDRV_VIRMIDI_SUBSCRIBE (1<<0) 46#define SNDRV_VIRMIDI_SUBSCRIBE (1<<0)
49#define SNDRV_VIRMIDI_USE (1<<1) 47#define SNDRV_VIRMIDI_USE (1<<1)
@@ -53,9 +51,9 @@ typedef struct _snd_virmidi {
53 * Each virtual midi device has one device instance. It contains 51 * Each virtual midi device has one device instance. It contains
54 * common information and the linked-list of opened files, 52 * common information and the linked-list of opened files,
55 */ 53 */
56struct _snd_virmidi_dev { 54struct snd_virmidi_dev {
57 snd_card_t *card; /* associated card */ 55 struct snd_card *card; /* associated card */
58 snd_rawmidi_t *rmidi; /* rawmidi device */ 56 struct snd_rawmidi *rmidi; /* rawmidi device */
59 int seq_mode; /* SNDRV_VIRMIDI_XXX */ 57 int seq_mode; /* SNDRV_VIRMIDI_XXX */
60 int device; /* sequencer device */ 58 int device; /* sequencer device */
61 int client; /* created/attached client */ 59 int client; /* created/attached client */
@@ -78,6 +76,6 @@ struct _snd_virmidi_dev {
78#define SNDRV_VIRMIDI_SEQ_ATTACH 1 76#define SNDRV_VIRMIDI_SEQ_ATTACH 1
79#define SNDRV_VIRMIDI_SEQ_DISPATCH 2 77#define SNDRV_VIRMIDI_SEQ_DISPATCH 2
80 78
81int snd_virmidi_new(snd_card_t *card, int device, snd_rawmidi_t **rrmidi); 79int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmidi);
82 80
83#endif /* __SOUND_SEQ_VIRMIDI */ 81#endif /* __SOUND_SEQ_VIRMIDI */
diff --git a/include/sound/sfnt_info.h b/include/sound/sfnt_info.h
index 674585f88a31..5d1ab9c4950f 100644
--- a/include/sound/sfnt_info.h
+++ b/include/sound/sfnt_info.h
@@ -35,7 +35,7 @@
35#endif 35#endif
36 36
37/* patch interface header: 16 bytes */ 37/* patch interface header: 16 bytes */
38typedef struct soundfont_patch_info_t { 38struct soundfont_patch_info {
39 unsigned short key; /* use the key below */ 39 unsigned short key; /* use the key below */
40#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07) 40#define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07)
41 41
@@ -59,7 +59,7 @@ typedef struct soundfont_patch_info_t {
59 short reserved; /* word alignment data */ 59 short reserved; /* word alignment data */
60 60
61 /* the actual patch data begins after this */ 61 /* the actual patch data begins after this */
62} soundfont_patch_info_t; 62};
63 63
64 64
65/* 65/*
@@ -68,7 +68,7 @@ typedef struct soundfont_patch_info_t {
68 68
69#define SNDRV_SFNT_PATCH_NAME_LEN 32 69#define SNDRV_SFNT_PATCH_NAME_LEN 32
70 70
71typedef struct soundfont_open_parm_t { 71struct soundfont_open_parm {
72 unsigned short type; /* sample type */ 72 unsigned short type; /* sample type */
73#define SNDRV_SFNT_PAT_TYPE_MISC 0 73#define SNDRV_SFNT_PAT_TYPE_MISC 0
74#define SNDRV_SFNT_PAT_TYPE_GUS 6 74#define SNDRV_SFNT_PAT_TYPE_GUS 6
@@ -78,7 +78,7 @@ typedef struct soundfont_open_parm_t {
78 78
79 short reserved; 79 short reserved;
80 char name[SNDRV_SFNT_PATCH_NAME_LEN]; 80 char name[SNDRV_SFNT_PATCH_NAME_LEN];
81} soundfont_open_parm_t; 81};
82 82
83 83
84/* 84/*
@@ -86,7 +86,7 @@ typedef struct soundfont_open_parm_t {
86 */ 86 */
87 87
88/* wave table envelope & effect parameters to control EMU8000 */ 88/* wave table envelope & effect parameters to control EMU8000 */
89typedef struct soundfont_voice_parm_t { 89struct soundfont_voice_parm {
90 unsigned short moddelay; /* modulation delay (0x8000) */ 90 unsigned short moddelay; /* modulation delay (0x8000) */
91 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ 91 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */
92 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */ 92 unsigned short moddcysus; /* modulation decay & sustain (0x7f7f) */
@@ -108,11 +108,11 @@ typedef struct soundfont_voice_parm_t {
108 unsigned char chorus; /* chorus send (0x00) */ 108 unsigned char chorus; /* chorus send (0x00) */
109 unsigned char reverb; /* reverb send (0x00) */ 109 unsigned char reverb; /* reverb send (0x00) */
110 unsigned short reserved[4]; /* not used */ 110 unsigned short reserved[4]; /* not used */
111} soundfont_voice_parm_t; 111};
112 112
113 113
114/* wave table parameters: 92 bytes */ 114/* wave table parameters: 92 bytes */
115typedef struct soundfont_voice_info_t { 115struct soundfont_voice_info {
116 unsigned short sf_id; /* file id (should be zero) */ 116 unsigned short sf_id; /* file id (should be zero) */
117 unsigned short sample; /* sample id */ 117 unsigned short sample; /* sample id */
118 int start, end; /* sample offset correction */ 118 int start, end; /* sample offset correction */
@@ -135,13 +135,13 @@ typedef struct soundfont_voice_info_t {
135 unsigned char amplitude; /* sample volume (127 max) */ 135 unsigned char amplitude; /* sample volume (127 max) */
136 unsigned char attenuation; /* attenuation (0.375dB) */ 136 unsigned char attenuation; /* attenuation (0.375dB) */
137 short scaleTuning; /* pitch scale tuning(%), normally 100 */ 137 short scaleTuning; /* pitch scale tuning(%), normally 100 */
138 soundfont_voice_parm_t parm; /* voice envelope parameters */ 138 struct soundfont_voice_parm parm; /* voice envelope parameters */
139 unsigned short sample_mode; /* sample mode_flag (set by driver) */ 139 unsigned short sample_mode; /* sample mode_flag (set by driver) */
140} soundfont_voice_info_t; 140};
141 141
142 142
143/* instrument info header: 4 bytes */ 143/* instrument info header: 4 bytes */
144typedef struct soundfont_voice_rec_hdr_t { 144struct soundfont_voice_rec_hdr {
145 unsigned char bank; /* midi bank number */ 145 unsigned char bank; /* midi bank number */
146 unsigned char instr; /* midi preset number */ 146 unsigned char instr; /* midi preset number */
147 char nvoices; /* number of voices */ 147 char nvoices; /* number of voices */
@@ -149,7 +149,7 @@ typedef struct soundfont_voice_rec_hdr_t {
149#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */ 149#define SNDRV_SFNT_WR_APPEND 0 /* append anyway */
150#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */ 150#define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */
151#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */ 151#define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */
152} soundfont_voice_rec_hdr_t; 152};
153 153
154 154
155/* 155/*
@@ -157,7 +157,7 @@ typedef struct soundfont_voice_rec_hdr_t {
157 */ 157 */
158 158
159/* wave table sample header: 32 bytes */ 159/* wave table sample header: 32 bytes */
160typedef struct soundfont_sample_info_t { 160struct soundfont_sample_info {
161 unsigned short sf_id; /* file id (should be zero) */ 161 unsigned short sf_id; /* file id (should be zero) */
162 unsigned short sample; /* sample id */ 162 unsigned short sample; /* sample id */
163 int start, end; /* start & end offset */ 163 int start, end; /* start & end offset */
@@ -174,17 +174,17 @@ typedef struct soundfont_sample_info_t {
174#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */ 174#define SNDRV_SFNT_SAMPLE_STEREO_RIGHT 64 /* stereo right sound */
175#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ 175#define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */
176 unsigned int truesize; /* used memory size (set by driver) */ 176 unsigned int truesize; /* used memory size (set by driver) */
177} soundfont_sample_info_t; 177};
178 178
179 179
180/* 180/*
181 * voice preset mapping (aliasing) 181 * voice preset mapping (aliasing)
182 */ 182 */
183 183
184typedef struct soundfont_voice_map_t { 184struct soundfont_voice_map {
185 int map_bank, map_instr, map_key; /* key = -1 means all keys */ 185 int map_bank, map_instr, map_key; /* key = -1 means all keys */
186 int src_bank, src_instr, src_key; 186 int src_bank, src_instr, src_key;
187} soundfont_voice_map_t; 187};
188 188
189 189
190/* 190/*
@@ -195,7 +195,7 @@ typedef struct soundfont_voice_map_t {
195 195
196#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */ 196#define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */
197 197
198struct sndrv_emux_misc_mode { 198struct snd_emux_misc_mode {
199 int port; /* -1 = all */ 199 int port; /* -1 = all */
200 int mode; 200 int mode;
201 int value; 201 int value;
@@ -204,11 +204,11 @@ struct sndrv_emux_misc_mode {
204 204
205enum { 205enum {
206 SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int), 206 SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int),
207 SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, soundfont_patch_info_t), 207 SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info),
208 SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82), 208 SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82),
209 SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83), 209 SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83),
210 SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int), 210 SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int),
211 SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct sndrv_emux_misc_mode), 211 SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode),
212}; 212};
213 213
214#endif /* __SOUND_SFNT_INFO_H */ 214#endif /* __SOUND_SFNT_INFO_H */
diff --git a/include/sound/snd_wavefront.h b/include/sound/snd_wavefront.h
index 4b0b2b9370b9..0b9e5de94ff1 100644
--- a/include/sound/snd_wavefront.h
+++ b/include/sound/snd_wavefront.h
@@ -26,8 +26,8 @@ struct _snd_wavefront_midi {
26 snd_wavefront_mpu_id output_mpu; /* most-recently-used */ 26 snd_wavefront_mpu_id output_mpu; /* most-recently-used */
27 snd_wavefront_mpu_id input_mpu; /* most-recently-used */ 27 snd_wavefront_mpu_id input_mpu; /* most-recently-used */
28 unsigned int mode[2]; /* MPU401_MODE_XXX */ 28 unsigned int mode[2]; /* MPU401_MODE_XXX */
29 snd_rawmidi_substream_t *substream_output[2]; 29 struct snd_rawmidi_substream *substream_output[2];
30 snd_rawmidi_substream_t *substream_input[2]; 30 struct snd_rawmidi_substream *substream_input[2];
31 struct timer_list timer; 31 struct timer_list timer;
32 spinlock_t open; 32 spinlock_t open;
33 spinlock_t virtual; /* protects isvirtual */ 33 spinlock_t virtual; /* protects isvirtual */
@@ -38,8 +38,8 @@ struct _snd_wavefront_midi {
38#define MPU_ACK 0xFE 38#define MPU_ACK 0xFE
39#define UART_MODE_ON 0x3F 39#define UART_MODE_ON 0x3F
40 40
41extern snd_rawmidi_ops_t snd_wavefront_midi_output; 41extern struct snd_rawmidi_ops snd_wavefront_midi_output;
42extern snd_rawmidi_ops_t snd_wavefront_midi_input; 42extern struct snd_rawmidi_ops snd_wavefront_midi_input;
43 43
44extern void snd_wavefront_midi_enable_virtual (snd_wavefront_card_t *); 44extern void snd_wavefront_midi_enable_virtual (snd_wavefront_card_t *);
45extern void snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *); 45extern void snd_wavefront_midi_disable_virtual (snd_wavefront_card_t *);
@@ -116,23 +116,23 @@ extern int snd_wavefront_config_midi (snd_wavefront_t *dev) ;
116extern int snd_wavefront_cmd (snd_wavefront_t *, int, unsigned char *, 116extern int snd_wavefront_cmd (snd_wavefront_t *, int, unsigned char *,
117 unsigned char *); 117 unsigned char *);
118 118
119extern int snd_wavefront_synth_ioctl (snd_hwdep_t *, 119extern int snd_wavefront_synth_ioctl (struct snd_hwdep *,
120 struct file *, 120 struct file *,
121 unsigned int cmd, 121 unsigned int cmd,
122 unsigned long arg); 122 unsigned long arg);
123extern int snd_wavefront_synth_open (snd_hwdep_t *, struct file *); 123extern int snd_wavefront_synth_open (struct snd_hwdep *, struct file *);
124extern int snd_wavefront_synth_release (snd_hwdep_t *, struct file *); 124extern int snd_wavefront_synth_release (struct snd_hwdep *, struct file *);
125 125
126/* FX processor - see also yss225.[ch] */ 126/* FX processor - see also yss225.[ch] */
127 127
128extern int snd_wavefront_fx_start (snd_wavefront_t *); 128extern int snd_wavefront_fx_start (snd_wavefront_t *);
129extern int snd_wavefront_fx_detect (snd_wavefront_t *); 129extern int snd_wavefront_fx_detect (snd_wavefront_t *);
130extern int snd_wavefront_fx_ioctl (snd_hwdep_t *, 130extern int snd_wavefront_fx_ioctl (struct snd_hwdep *,
131 struct file *, 131 struct file *,
132 unsigned int cmd, 132 unsigned int cmd,
133 unsigned long arg); 133 unsigned long arg);
134extern int snd_wavefront_fx_open (snd_hwdep_t *, struct file *); 134extern int snd_wavefront_fx_open (struct snd_hwdep *, struct file *);
135extern int snd_wavefront_fx_release (snd_hwdep_t *, struct file *); 135extern int snd_wavefront_fx_release (struct snd_hwdep *, struct file *);
136 136
137/* prefix in all snd_printk() delivered messages */ 137/* prefix in all snd_printk() delivered messages */
138 138
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h
index c992958f5e3c..61a010c65d02 100644
--- a/include/sound/soundfont.h
+++ b/include/sound/soundfont.h
@@ -29,94 +29,93 @@
29#define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */ 29#define SF_MAX_PRESETS 256 /* drums are mapped from 128 to 256 */
30#define SF_IS_DRUM_BANK(z) ((z) == 128) 30#define SF_IS_DRUM_BANK(z) ((z) == 128)
31 31
32typedef struct snd_sf_zone { 32struct snd_sf_zone {
33 struct snd_sf_zone *next; /* Link to next */ 33 struct snd_sf_zone *next; /* Link to next */
34 unsigned char bank; /* Midi bank for this zone */ 34 unsigned char bank; /* Midi bank for this zone */
35 unsigned char instr; /* Midi program for this zone */ 35 unsigned char instr; /* Midi program for this zone */
36 unsigned char mapped; /* True if mapped to something else */ 36 unsigned char mapped; /* True if mapped to something else */
37 37
38 soundfont_voice_info_t v; /* All the soundfont parameters */ 38 struct soundfont_voice_info v; /* All the soundfont parameters */
39 int counter; 39 int counter;
40 struct snd_sf_sample *sample; /* Link to sample */ 40 struct snd_sf_sample *sample; /* Link to sample */
41 41
42 /* The following deals with preset numbers (programs) */ 42 /* The following deals with preset numbers (programs) */
43 struct snd_sf_zone *next_instr; /* Next zone of this instrument */ 43 struct snd_sf_zone *next_instr; /* Next zone of this instrument */
44 struct snd_sf_zone *next_zone; /* Next zone in play list */ 44 struct snd_sf_zone *next_zone; /* Next zone in play list */
45} snd_sf_zone_t; 45};
46 46
47typedef struct snd_sf_sample { 47struct snd_sf_sample {
48 soundfont_sample_info_t v; 48 struct soundfont_sample_info v;
49 int counter; 49 int counter;
50 snd_util_memblk_t *block; /* allocated data block */ 50 struct snd_util_memblk *block; /* allocated data block */
51 struct snd_sf_sample *next; 51 struct snd_sf_sample *next;
52} snd_sf_sample_t; 52};
53 53
54/* 54/*
55 * This represents all the information relating to a soundfont. 55 * This represents all the information relating to a soundfont.
56 */ 56 */
57typedef struct snd_soundfont { 57struct snd_soundfont {
58 struct snd_soundfont *next; /* Link to next */ 58 struct snd_soundfont *next; /* Link to next */
59 /*struct snd_soundfont *prev;*/ /* Link to previous */ 59 /*struct snd_soundfont *prev;*/ /* Link to previous */
60 short id; /* file id */ 60 short id; /* file id */
61 short type; /* font type */ 61 short type; /* font type */
62 unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */ 62 unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */
63 snd_sf_zone_t *zones; /* Font information */ 63 struct snd_sf_zone *zones; /* Font information */
64 snd_sf_sample_t *samples; /* The sample headers */ 64 struct snd_sf_sample *samples; /* The sample headers */
65} snd_soundfont_t; 65};
66 66
67/* 67/*
68 * Type of the sample access callback 68 * Type of the sample access callback
69 */ 69 */
70typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp, 70struct snd_sf_callback {
71 snd_util_memhdr_t *hdr, const void __user *buf, long count);
72typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp,
73 snd_util_memhdr_t *hdr);
74typedef void (*snd_sf_sample_reset_t)(void *private);
75
76typedef struct snd_sf_callback {
77 void *private_data; 71 void *private_data;
78 snd_sf_sample_new_t sample_new; 72 int (*sample_new)(void *private_data, struct snd_sf_sample *sp,
79 snd_sf_sample_free_t sample_free; 73 struct snd_util_memhdr *hdr,
80 snd_sf_sample_reset_t sample_reset; 74 const void __user *buf, long count);
81} snd_sf_callback_t; 75 int (*sample_free)(void *private_data, struct snd_sf_sample *sp,
76 struct snd_util_memhdr *hdr);
77 void (*sample_reset)(void *private);
78};
82 79
83/* 80/*
84 * List of soundfonts. 81 * List of soundfonts.
85 */ 82 */
86typedef struct snd_sf_list { 83struct snd_sf_list {
87 snd_soundfont_t *currsf; /* The currently open soundfont */ 84 struct snd_soundfont *currsf; /* The currently open soundfont */
88 int open_client; /* client pointer for lock */ 85 int open_client; /* client pointer for lock */
89 int mem_used; /* used memory size */ 86 int mem_used; /* used memory size */
90 snd_sf_zone_t *presets[SF_MAX_PRESETS]; 87 struct snd_sf_zone *presets[SF_MAX_PRESETS];
91 snd_soundfont_t *fonts; /* The list of soundfonts */ 88 struct snd_soundfont *fonts; /* The list of soundfonts */
92 int fonts_size; /* number of fonts allocated */ 89 int fonts_size; /* number of fonts allocated */
93 int zone_counter; /* last allocated time for zone */ 90 int zone_counter; /* last allocated time for zone */
94 int sample_counter; /* last allocated time for sample */ 91 int sample_counter; /* last allocated time for sample */
95 int zone_locked; /* locked time for zone */ 92 int zone_locked; /* locked time for zone */
96 int sample_locked; /* locked time for sample */ 93 int sample_locked; /* locked time for sample */
97 snd_sf_callback_t callback; /* callback functions */ 94 struct snd_sf_callback callback; /* callback functions */
98 int presets_locked; 95 int presets_locked;
99 struct semaphore presets_mutex; 96 struct semaphore presets_mutex;
100 spinlock_t lock; 97 spinlock_t lock;
101 snd_util_memhdr_t *memhdr; 98 struct snd_util_memhdr *memhdr;
102} snd_sf_list_t; 99};
103 100
104/* Prototypes for soundfont.c */ 101/* Prototypes for soundfont.c */
105int snd_soundfont_load(snd_sf_list_t *sflist, const void __user *data, long count, int client); 102int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
106int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char __user *data, 103 long count, int client);
104int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data,
107 long count, int client); 105 long count, int client);
108int snd_soundfont_close_check(snd_sf_list_t *sflist, int client); 106int snd_soundfont_close_check(struct snd_sf_list *sflist, int client);
109 107
110snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr); 108struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback,
111void snd_sf_free(snd_sf_list_t *sflist); 109 struct snd_util_memhdr *hdr);
110void snd_sf_free(struct snd_sf_list *sflist);
112 111
113int snd_soundfont_remove_samples(snd_sf_list_t *sflist); 112int snd_soundfont_remove_samples(struct snd_sf_list *sflist);
114int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist); 113int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist);
115 114
116int snd_soundfont_search_zone(snd_sf_list_t *sflist, int *notep, int vel, 115int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
117 int preset, int bank, 116 int preset, int bank,
118 int def_preset, int def_bank, 117 int def_preset, int def_bank,
119 snd_sf_zone_t **table, int max_layers); 118 struct snd_sf_zone **table, int max_layers);
120 119
121/* Parameter conversions */ 120/* Parameter conversions */
122int snd_sf_calc_parm_hold(int msec); 121int snd_sf_calc_parm_hold(int msec);
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index b82e408e758f..a4f554520197 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -24,15 +24,15 @@
24 24
25#include <linux/videodev.h> 25#include <linux/videodev.h>
26 26
27typedef struct snd_tea575x tea575x_t; 27struct snd_tea575x;
28 28
29struct snd_tea575x_ops { 29struct snd_tea575x_ops {
30 void (*write)(tea575x_t *tea, unsigned int val); 30 void (*write)(struct snd_tea575x *tea, unsigned int val);
31 unsigned int (*read)(tea575x_t *tea); 31 unsigned int (*read)(struct snd_tea575x *tea);
32}; 32};
33 33
34struct snd_tea575x { 34struct snd_tea575x {
35 snd_card_t *card; 35 struct snd_card *card;
36 struct video_device vd; /* video device */ 36 struct video_device vd; /* video device */
37 struct file_operations fops; 37 struct file_operations fops;
38 int dev_nr; /* requested device number + 1 */ 38 int dev_nr; /* requested device number + 1 */
@@ -45,7 +45,7 @@ struct snd_tea575x {
45 void *private_data; 45 void *private_data;
46}; 46};
47 47
48void snd_tea575x_init(tea575x_t *tea); 48void snd_tea575x_init(struct snd_tea575x *tea);
49void snd_tea575x_exit(tea575x_t *tea); 49void snd_tea575x_exit(struct snd_tea575x *tea);
50 50
51#endif /* __SOUND_TEA575X_TUNER_H */ 51#endif /* __SOUND_TEA575X_TUNER_H */
diff --git a/include/sound/tea6330t.h b/include/sound/tea6330t.h
index 3896c0a50907..51b282b76896 100644
--- a/include/sound/tea6330t.h
+++ b/include/sound/tea6330t.h
@@ -22,21 +22,10 @@
22 * 22 *
23 */ 23 */
24 24
25#include "control.h"
26#include "i2c.h" /* generic i2c support */ 25#include "i2c.h" /* generic i2c support */
27 26
28typedef struct { 27int snd_tea6330t_detect(struct snd_i2c_bus *bus, int equalizer);
29 snd_i2c_device_t *device; 28int snd_tea6330t_update_mixer(struct snd_card *card, struct snd_i2c_bus *bus,
30 snd_i2c_bus_t *bus; 29 int equalizer, int fader);
31 int equalizer;
32 int fader;
33 unsigned char regs[8];
34 unsigned char mleft, mright;
35 unsigned char bass, treble;
36 unsigned char max_bass, max_treble;
37} tea6330t_t;
38
39extern int snd_tea6330t_detect(snd_i2c_bus_t *bus, int equalizer);
40extern int snd_tea6330t_update_mixer(snd_card_t * card, snd_i2c_bus_t * bus, int equalizer, int fader);
41 30
42#endif /* __SOUND_TEA6330T_H */ 31#endif /* __SOUND_TEA6330T_H */
diff --git a/include/sound/timer.h b/include/sound/timer.h
index b55f38ae56e1..5ece2bf541dc 100644
--- a/include/sound/timer.h
+++ b/include/sound/timer.h
@@ -26,20 +26,6 @@
26#include <sound/asound.h> 26#include <sound/asound.h>
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28 28
29typedef enum sndrv_timer_class snd_timer_class_t;
30typedef enum sndrv_timer_slave_class snd_timer_slave_class_t;
31typedef enum sndrv_timer_global snd_timer_global_t;
32typedef struct sndrv_timer_id snd_timer_id_t;
33typedef struct sndrv_timer_ginfo snd_timer_ginfo_t;
34typedef struct sndrv_timer_gparams snd_timer_gparams_t;
35typedef struct sndrv_timer_gstatus snd_timer_gstatus_t;
36typedef struct sndrv_timer_select snd_timer_select_t;
37typedef struct sndrv_timer_info snd_timer_info_t;
38typedef struct sndrv_timer_params snd_timer_params_t;
39typedef struct sndrv_timer_status snd_timer_status_t;
40typedef struct sndrv_timer_read snd_timer_read_t;
41typedef struct sndrv_timer_tread snd_timer_tread_t;
42
43#define snd_timer_chip(timer) ((timer)->private_data) 29#define snd_timer_chip(timer) ((timer)->private_data)
44 30
45#define SNDRV_TIMER_DEVICES 16 31#define SNDRV_TIMER_DEVICES 16
@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t;
64#define SNDRV_TIMER_FLG_CHANGE 0x00000001 50#define SNDRV_TIMER_FLG_CHANGE 0x00000001
65#define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */ 51#define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */
66 52
67typedef void (*snd_timer_callback_t) (snd_timer_instance_t * timeri, unsigned long ticks, unsigned long resolution); 53struct snd_timer;
68typedef void (*snd_timer_ccallback_t) (snd_timer_instance_t * timeri, enum sndrv_timer_event event,
69 struct timespec * tstamp, unsigned long resolution);
70 54
71struct _snd_timer_hardware { 55struct snd_timer_hardware {
72 /* -- must be filled with low-level driver */ 56 /* -- must be filled with low-level driver */
73 unsigned int flags; /* various flags */ 57 unsigned int flags; /* various flags */
74 unsigned long resolution; /* average timer resolution for one tick in nsec */ 58 unsigned long resolution; /* average timer resolution for one tick in nsec */
@@ -76,18 +60,18 @@ struct _snd_timer_hardware {
76 unsigned long resolution_max; /* maximal resolution */ 60 unsigned long resolution_max; /* maximal resolution */
77 unsigned long ticks; /* max timer ticks per interrupt */ 61 unsigned long ticks; /* max timer ticks per interrupt */
78 /* -- low-level functions -- */ 62 /* -- low-level functions -- */
79 int (*open) (snd_timer_t * timer); 63 int (*open) (struct snd_timer * timer);
80 int (*close) (snd_timer_t * timer); 64 int (*close) (struct snd_timer * timer);
81 unsigned long (*c_resolution) (snd_timer_t * timer); 65 unsigned long (*c_resolution) (struct snd_timer * timer);
82 int (*start) (snd_timer_t * timer); 66 int (*start) (struct snd_timer * timer);
83 int (*stop) (snd_timer_t * timer); 67 int (*stop) (struct snd_timer * timer);
84 int (*set_period) (snd_timer_t * timer, unsigned long period_num, unsigned long period_den); 68 int (*set_period) (struct snd_timer * timer, unsigned long period_num, unsigned long period_den);
85 int (*precise_resolution) (snd_timer_t * timer, unsigned long *num, unsigned long *den); 69 int (*precise_resolution) (struct snd_timer * timer, unsigned long *num, unsigned long *den);
86}; 70};
87 71
88struct _snd_timer { 72struct snd_timer {
89 snd_timer_class_t tmr_class; 73 int tmr_class;
90 snd_card_t *card; 74 struct snd_card *card;
91 struct module *module; 75 struct module *module;
92 int tmr_device; 76 int tmr_device;
93 int tmr_subdevice; 77 int tmr_subdevice;
@@ -97,8 +81,8 @@ struct _snd_timer {
97 int running; /* running instances */ 81 int running; /* running instances */
98 unsigned long sticks; /* schedule ticks */ 82 unsigned long sticks; /* schedule ticks */
99 void *private_data; 83 void *private_data;
100 void (*private_free) (snd_timer_t *timer); 84 void (*private_free) (struct snd_timer *timer);
101 struct _snd_timer_hardware hw; 85 struct snd_timer_hardware hw;
102 spinlock_t lock; 86 spinlock_t lock;
103 struct list_head device_list; 87 struct list_head device_list;
104 struct list_head open_list_head; 88 struct list_head open_list_head;
@@ -108,49 +92,53 @@ struct _snd_timer {
108 struct tasklet_struct task_queue; 92 struct tasklet_struct task_queue;
109}; 93};
110 94
111struct _snd_timer_instance { 95struct snd_timer_instance {
112 snd_timer_t * timer; 96 struct snd_timer *timer;
113 char *owner; 97 char *owner;
114 unsigned int flags; 98 unsigned int flags;
115 void *private_data; 99 void *private_data;
116 void (*private_free) (snd_timer_instance_t *ti); 100 void (*private_free) (struct snd_timer_instance *ti);
117 snd_timer_callback_t callback; 101 void (*callback) (struct snd_timer_instance *timeri,
118 snd_timer_ccallback_t ccallback; 102 unsigned long ticks, unsigned long resolution);
103 void (*ccallback) (struct snd_timer_instance * timeri,
104 int event,
105 struct timespec * tstamp,
106 unsigned long resolution);
119 void *callback_data; 107 void *callback_data;
120 unsigned long ticks; /* auto-load ticks when expired */ 108 unsigned long ticks; /* auto-load ticks when expired */
121 unsigned long cticks; /* current ticks */ 109 unsigned long cticks; /* current ticks */
122 unsigned long pticks; /* accumulated ticks for callback */ 110 unsigned long pticks; /* accumulated ticks for callback */
123 unsigned long resolution; /* current resolution for tasklet */ 111 unsigned long resolution; /* current resolution for tasklet */
124 unsigned long lost; /* lost ticks */ 112 unsigned long lost; /* lost ticks */
125 snd_timer_slave_class_t slave_class; 113 int slave_class;
126 unsigned int slave_id; 114 unsigned int slave_id;
127 struct list_head open_list; 115 struct list_head open_list;
128 struct list_head active_list; 116 struct list_head active_list;
129 struct list_head ack_list; 117 struct list_head ack_list;
130 struct list_head slave_list_head; 118 struct list_head slave_list_head;
131 struct list_head slave_active_head; 119 struct list_head slave_active_head;
132 snd_timer_instance_t *master; 120 struct snd_timer_instance *master;
133}; 121};
134 122
135/* 123/*
136 * Registering 124 * Registering
137 */ 125 */
138 126
139extern int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, snd_timer_t ** rtimer); 127int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, struct snd_timer **rtimer);
140extern void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, struct timespec *tstamp); 128void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp);
141extern int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer); 129int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
142extern int snd_timer_global_free(snd_timer_t *timer); 130int snd_timer_global_free(struct snd_timer *timer);
143extern int snd_timer_global_register(snd_timer_t *timer); 131int snd_timer_global_register(struct snd_timer *timer);
144extern int snd_timer_global_unregister(snd_timer_t *timer); 132int snd_timer_global_unregister(struct snd_timer *timer);
145 133
146extern int snd_timer_open(snd_timer_instance_t ** ti, char *owner, snd_timer_id_t *tid, unsigned int slave_id); 134int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
147extern int snd_timer_close(snd_timer_instance_t * timeri); 135int snd_timer_close(struct snd_timer_instance *timeri);
148extern unsigned long snd_timer_resolution(snd_timer_instance_t * timeri); 136unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
149extern int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks); 137int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
150extern int snd_timer_stop(snd_timer_instance_t * timeri); 138int snd_timer_stop(struct snd_timer_instance *timeri);
151extern int snd_timer_continue(snd_timer_instance_t * timeri); 139int snd_timer_continue(struct snd_timer_instance *timeri);
152extern int snd_timer_pause(snd_timer_instance_t * timeri); 140int snd_timer_pause(struct snd_timer_instance *timeri);
153 141
154extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); 142void snd_timer_interrupt(struct snd_timer *timer, unsigned long ticks_left);
155 143
156#endif /* __SOUND_TIMER_H */ 144#endif /* __SOUND_TIMER_H */
diff --git a/include/sound/trident.h b/include/sound/trident.h
index a408d3925050..9752243241e5 100644
--- a/include/sound/trident.h
+++ b/include/sound/trident.h
@@ -253,43 +253,43 @@ enum serial_intf_ctrl_bits {
253#define T4D_DEFAULT_PCM_RVOL 127 /* 0 - 127 */ 253#define T4D_DEFAULT_PCM_RVOL 127 /* 0 - 127 */
254#define T4D_DEFAULT_PCM_CVOL 127 /* 0 - 127 */ 254#define T4D_DEFAULT_PCM_CVOL 127 /* 0 - 127 */
255 255
256typedef struct _snd_trident trident_t; 256struct snd_trident;
257typedef struct _snd_trident_voice snd_trident_voice_t; 257struct snd_trident_voice;
258typedef struct _snd_trident_pcm_mixer snd_trident_pcm_mixer_t; 258struct snd_trident_pcm_mixer;
259 259
260typedef struct { 260struct snd_trident_sample_ops {
261 void (*sample_start)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_position_t position); 261 void (*sample_start)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_position_t position);
262 void (*sample_stop)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_stop_mode_t mode); 262 void (*sample_stop)(struct snd_trident *gus, struct snd_trident_voice *voice, int mode);
263 void (*sample_freq)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_frequency_t freq); 263 void (*sample_freq)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_frequency_t freq);
264 void (*sample_volume)(trident_t *gus, snd_trident_voice_t *voice, snd_seq_ev_volume_t *volume); 264 void (*sample_volume)(struct snd_trident *gus, struct snd_trident_voice *voice, struct snd_seq_ev_volume *volume);
265 void (*sample_loop)(trident_t *card, snd_trident_voice_t *voice, snd_seq_ev_loop_t *loop); 265 void (*sample_loop)(struct snd_trident *card, struct snd_trident_voice *voice, struct snd_seq_ev_loop *loop);
266 void (*sample_pos)(trident_t *card, snd_trident_voice_t *voice, snd_seq_position_t position); 266 void (*sample_pos)(struct snd_trident *card, struct snd_trident_voice *voice, snd_seq_position_t position);
267 void (*sample_private1)(trident_t *card, snd_trident_voice_t *voice, unsigned char *data); 267 void (*sample_private1)(struct snd_trident *card, struct snd_trident_voice *voice, unsigned char *data);
268} snd_trident_sample_ops_t; 268};
269 269
270typedef struct { 270struct snd_trident_port {
271 snd_midi_channel_set_t * chset; 271 struct snd_midi_channel_set * chset;
272 trident_t * trident; 272 struct snd_trident * trident;
273 int mode; /* operation mode */ 273 int mode; /* operation mode */
274 int client; /* sequencer client number */ 274 int client; /* sequencer client number */
275 int port; /* sequencer port number */ 275 int port; /* sequencer port number */
276 unsigned int midi_has_voices: 1; 276 unsigned int midi_has_voices: 1;
277} snd_trident_port_t; 277};
278 278
279typedef struct snd_trident_memblk_arg { 279struct snd_trident_memblk_arg {
280 short first_page, last_page; 280 short first_page, last_page;
281} snd_trident_memblk_arg_t; 281};
282 282
283typedef struct { 283struct snd_trident_tlb {
284 unsigned int * entries; /* 16k-aligned TLB table */ 284 unsigned int * entries; /* 16k-aligned TLB table */
285 dma_addr_t entries_dmaaddr; /* 16k-aligned PCI address to TLB table */ 285 dma_addr_t entries_dmaaddr; /* 16k-aligned PCI address to TLB table */
286 unsigned long * shadow_entries; /* shadow entries with virtual addresses */ 286 unsigned long * shadow_entries; /* shadow entries with virtual addresses */
287 struct snd_dma_buffer buffer; 287 struct snd_dma_buffer buffer;
288 snd_util_memhdr_t * memhdr; /* page allocation list */ 288 struct snd_util_memhdr * memhdr; /* page allocation list */
289 struct snd_dma_buffer silent_page; 289 struct snd_dma_buffer silent_page;
290} snd_trident_tlb_t; 290};
291 291
292struct _snd_trident_voice { 292struct snd_trident_voice {
293 unsigned int number; 293 unsigned int number;
294 unsigned int use: 1, 294 unsigned int use: 1,
295 pcm: 1, 295 pcm: 1,
@@ -300,8 +300,8 @@ struct _snd_trident_voice {
300 unsigned char port; 300 unsigned char port;
301 unsigned char index; 301 unsigned char index;
302 302
303 snd_seq_instr_t instr; 303 struct snd_seq_instr instr;
304 snd_trident_sample_ops_t *sample_ops; 304 struct snd_trident_sample_ops *sample_ops;
305 305
306 /* channel parameters */ 306 /* channel parameters */
307 unsigned int CSO; /* 24 bits (16 on DX) */ 307 unsigned int CSO; /* 24 bits (16 on DX) */
@@ -323,13 +323,13 @@ struct _snd_trident_voice {
323 323
324 unsigned int negCSO; /* nonzero - use negative CSO */ 324 unsigned int negCSO; /* nonzero - use negative CSO */
325 325
326 snd_util_memblk_t *memblk; /* memory block if TLB enabled */ 326 struct snd_util_memblk *memblk; /* memory block if TLB enabled */
327 327
328 /* PCM data */ 328 /* PCM data */
329 329
330 trident_t *trident; 330 struct snd_trident *trident;
331 snd_pcm_substream_t *substream; 331 struct snd_pcm_substream *substream;
332 snd_trident_voice_t *extra; /* extra PCM voice (acts as interrupt generator) */ 332 struct snd_trident_voice *extra; /* extra PCM voice (acts as interrupt generator) */
333 unsigned int running: 1, 333 unsigned int running: 1,
334 capture: 1, 334 capture: 1,
335 spdif: 1, 335 spdif: 1,
@@ -347,25 +347,25 @@ struct _snd_trident_voice {
347 /* --- */ 347 /* --- */
348 348
349 void *private_data; 349 void *private_data;
350 void (*private_free)(snd_trident_voice_t *voice); 350 void (*private_free)(struct snd_trident_voice *voice);
351}; 351};
352 352
353struct _snd_4dwave { 353struct snd_4dwave {
354 int seq_client; 354 int seq_client;
355 355
356 snd_trident_port_t seq_ports[4]; 356 struct snd_trident_port seq_ports[4];
357 snd_simple_ops_t simple_ops; 357 struct snd_simple_ops simple_ops;
358 snd_seq_kinstr_list_t *ilist; 358 struct snd_seq_kinstr_list *ilist;
359 359
360 snd_trident_voice_t voices[64]; 360 struct snd_trident_voice voices[64];
361 361
362 int ChanSynthCount; /* number of allocated synth channels */ 362 int ChanSynthCount; /* number of allocated synth channels */
363 int max_size; /* maximum synth memory size in bytes */ 363 int max_size; /* maximum synth memory size in bytes */
364 int current_size; /* current allocated synth mem in bytes */ 364 int current_size; /* current allocated synth mem in bytes */
365}; 365};
366 366
367struct _snd_trident_pcm_mixer { 367struct snd_trident_pcm_mixer {
368 snd_trident_voice_t *voice; /* active voice */ 368 struct snd_trident_voice *voice; /* active voice */
369 unsigned short vol; /* front volume */ 369 unsigned short vol; /* front volume */
370 unsigned char pan; /* pan control */ 370 unsigned char pan; /* pan control */
371 unsigned char rvol; /* rear volume */ 371 unsigned char rvol; /* rear volume */
@@ -373,7 +373,7 @@ struct _snd_trident_pcm_mixer {
373 unsigned char pad; 373 unsigned char pad;
374}; 374};
375 375
376struct _snd_trident { 376struct snd_trident {
377 int irq; 377 int irq;
378 378
379 unsigned int device; /* device ID */ 379 unsigned int device; /* device ID */
@@ -386,13 +386,13 @@ struct _snd_trident {
386 unsigned int spurious_irq_count; 386 unsigned int spurious_irq_count;
387 unsigned int spurious_irq_max_delta; 387 unsigned int spurious_irq_max_delta;
388 388
389 snd_trident_tlb_t tlb; /* TLB entries for NX cards */ 389 struct snd_trident_tlb tlb; /* TLB entries for NX cards */
390 390
391 unsigned char spdif_ctrl; 391 unsigned char spdif_ctrl;
392 unsigned char spdif_pcm_ctrl; 392 unsigned char spdif_pcm_ctrl;
393 unsigned int spdif_bits; 393 unsigned int spdif_bits;
394 unsigned int spdif_pcm_bits; 394 unsigned int spdif_pcm_bits;
395 snd_kcontrol_t *spdif_pcm_ctl; /* S/PDIF settings */ 395 struct snd_kcontrol *spdif_pcm_ctl; /* S/PDIF settings */
396 unsigned int ac97_ctrl; 396 unsigned int ac97_ctrl;
397 397
398 unsigned int ChanMap[2]; /* allocation map for hardware channels */ 398 unsigned int ChanMap[2]; /* allocation map for hardware channels */
@@ -403,7 +403,7 @@ struct _snd_trident {
403 unsigned int ac97_detect: 1; /* 1 = AC97 in detection phase */ 403 unsigned int ac97_detect: 1; /* 1 = AC97 in detection phase */
404 unsigned int in_suspend: 1; /* 1 during suspend/resume */ 404 unsigned int in_suspend: 1; /* 1 during suspend/resume */
405 405
406 struct _snd_4dwave synth; /* synth specific variables */ 406 struct snd_4dwave synth; /* synth specific variables */
407 407
408 spinlock_t event_lock; 408 spinlock_t event_lock;
409 spinlock_t voice_alloc; 409 spinlock_t voice_alloc;
@@ -411,52 +411,57 @@ struct _snd_trident {
411 struct snd_dma_device dma_dev; 411 struct snd_dma_device dma_dev;
412 412
413 struct pci_dev *pci; 413 struct pci_dev *pci;
414 snd_card_t *card; 414 struct snd_card *card;
415 snd_pcm_t *pcm; /* ADC/DAC PCM */ 415 struct snd_pcm *pcm; /* ADC/DAC PCM */
416 snd_pcm_t *foldback; /* Foldback PCM */ 416 struct snd_pcm *foldback; /* Foldback PCM */
417 snd_pcm_t *spdif; /* SPDIF PCM */ 417 struct snd_pcm *spdif; /* SPDIF PCM */
418 snd_rawmidi_t *rmidi; 418 struct snd_rawmidi *rmidi;
419 snd_seq_device_t *seq_dev; 419 struct snd_seq_device *seq_dev;
420 420
421 ac97_bus_t *ac97_bus; 421 struct snd_ac97_bus *ac97_bus;
422 ac97_t *ac97; 422 struct snd_ac97 *ac97;
423 ac97_t *ac97_sec; 423 struct snd_ac97 *ac97_sec;
424 424
425 unsigned int musicvol_wavevol; 425 unsigned int musicvol_wavevol;
426 snd_trident_pcm_mixer_t pcm_mixer[32]; 426 struct snd_trident_pcm_mixer pcm_mixer[32];
427 snd_kcontrol_t *ctl_vol; /* front volume */ 427 struct snd_kcontrol *ctl_vol; /* front volume */
428 snd_kcontrol_t *ctl_pan; /* pan */ 428 struct snd_kcontrol *ctl_pan; /* pan */
429 snd_kcontrol_t *ctl_rvol; /* rear volume */ 429 struct snd_kcontrol *ctl_rvol; /* rear volume */
430 snd_kcontrol_t *ctl_cvol; /* center volume */ 430 struct snd_kcontrol *ctl_cvol; /* center volume */
431 431
432 spinlock_t reg_lock; 432 spinlock_t reg_lock;
433 433
434 struct gameport *gameport; 434 struct gameport *gameport;
435}; 435};
436 436
437int snd_trident_create(snd_card_t * card, 437int snd_trident_create(struct snd_card *card,
438 struct pci_dev *pci, 438 struct pci_dev *pci,
439 int pcm_streams, 439 int pcm_streams,
440 int pcm_spdif_device, 440 int pcm_spdif_device,
441 int max_wavetable_size, 441 int max_wavetable_size,
442 trident_t ** rtrident); 442 struct snd_trident ** rtrident);
443int snd_trident_create_gameport(trident_t *trident); 443int snd_trident_create_gameport(struct snd_trident *trident);
444 444
445int snd_trident_pcm(trident_t * trident, int device, snd_pcm_t **rpcm); 445int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
446int snd_trident_foldback_pcm(trident_t * trident, int device, snd_pcm_t **rpcm); 446int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
447int snd_trident_spdif_pcm(trident_t * trident, int device, snd_pcm_t **rpcm); 447int snd_trident_spdif_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
448int snd_trident_attach_synthesizer(trident_t * trident); 448int snd_trident_attach_synthesizer(struct snd_trident * trident);
449snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port); 449struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type,
450void snd_trident_free_voice(trident_t * trident, snd_trident_voice_t *voice); 450 int client, int port);
451void snd_trident_start_voice(trident_t * trident, unsigned int voice); 451void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice);
452void snd_trident_stop_voice(trident_t * trident, unsigned int voice); 452void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice);
453void snd_trident_write_voice_regs(trident_t * trident, snd_trident_voice_t *voice); 453void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice);
454void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice);
455int snd_trident_suspend(struct pci_dev *pci, pm_message_t state);
456int snd_trident_resume(struct pci_dev *pci);
454 457
455/* TLB memory allocation */ 458/* TLB memory allocation */
456snd_util_memblk_t *snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream); 459struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident,
457int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk); 460 struct snd_pcm_substream *substream);
458snd_util_memblk_t *snd_trident_synth_alloc(trident_t *trident, unsigned int size); 461int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk);
459int snd_trident_synth_free(trident_t *trident, snd_util_memblk_t *blk); 462struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size);
460int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char __user *data, int size); 463int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk);
464int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk,
465 int offset, const char __user *data, int size);
461 466
462#endif /* __SOUND_TRIDENT_H */ 467#endif /* __SOUND_TRIDENT_H */
diff --git a/include/sound/typedefs.h b/include/sound/typedefs.h
new file mode 100644
index 000000000000..f454b0206b93
--- /dev/null
+++ b/include/sound/typedefs.h
@@ -0,0 +1,173 @@
1/*
2 * Typedef's for backward compatibility (for out-of-kernel drivers)
3 *
4 * This file will be removed soon in future
5 */
6
7/* core stuff */
8typedef struct snd_card snd_card_t;
9typedef struct snd_device snd_device_t;
10typedef struct snd_device_ops snd_device_ops_t;
11typedef enum snd_card_type snd_card_type_t;
12typedef struct snd_minor snd_minor_t;
13
14/* info */
15typedef struct snd_info_entry snd_info_entry_t;
16typedef struct snd_info_buffer snd_info_buffer_t;
17
18/* control */
19typedef struct snd_ctl_file snd_ctl_file_t;
20typedef struct snd_kcontrol snd_kcontrol_t;
21typedef struct snd_kcontrol_new snd_kcontrol_new_t;
22typedef struct snd_kcontrol_volatile snd_kcontrol_volatile_t;
23typedef struct snd_kctl_event snd_kctl_event_t;
24typedef struct snd_aes_iec958 snd_aes_iec958_t;
25typedef struct snd_ctl_card_info snd_ctl_card_info_t;
26typedef struct snd_ctl_elem_id snd_ctl_elem_id_t;
27typedef struct snd_ctl_elem_list snd_ctl_elem_list_t;
28typedef struct snd_ctl_elem_info snd_ctl_elem_info_t;
29typedef struct snd_ctl_elem_value snd_ctl_elem_value_t;
30typedef struct snd_ctl_event snd_ctl_event_t;
31#if defined(CONFIG_SND_MIXER_OSS) || defined(CONFIG_SND_MIXER_OSS_MODULE)
32typedef struct snd_mixer_oss snd_mixer_oss_t;
33#endif
34
35/* timer */
36typedef struct snd_timer snd_timer_t;
37typedef struct snd_timer_instance snd_timer_instance_t;
38typedef struct snd_timer_id snd_timer_id_t;
39typedef struct snd_timer_ginfo snd_timer_ginfo_t;
40typedef struct snd_timer_gparams snd_timer_gparams_t;
41typedef struct snd_timer_gstatus snd_timer_gstatus_t;
42typedef struct snd_timer_select snd_timer_select_t;
43typedef struct snd_timer_info snd_timer_info_t;
44typedef struct snd_timer_params snd_timer_params_t;
45typedef struct snd_timer_status snd_timer_status_t;
46typedef struct snd_timer_read snd_timer_read_t;
47typedef struct snd_timer_tread snd_timer_tread_t;
48
49/* PCM */
50typedef struct snd_pcm snd_pcm_t;
51typedef struct snd_pcm_str snd_pcm_str_t;
52typedef struct snd_pcm_substream snd_pcm_substream_t;
53typedef struct snd_pcm_info snd_pcm_info_t;
54typedef struct snd_pcm_hw_params snd_pcm_hw_params_t;
55typedef struct snd_pcm_sw_params snd_pcm_sw_params_t;
56typedef struct snd_pcm_channel_info snd_pcm_channel_info_t;
57typedef struct snd_pcm_status snd_pcm_status_t;
58typedef struct snd_pcm_mmap_status snd_pcm_mmap_status_t;
59typedef struct snd_pcm_mmap_control snd_pcm_mmap_control_t;
60typedef struct snd_mask snd_mask_t;
61typedef struct snd_sg_buf snd_pcm_sgbuf_t;
62
63typedef struct snd_interval snd_interval_t;
64typedef struct snd_xferi snd_xferi_t;
65typedef struct snd_xfern snd_xfern_t;
66typedef struct snd_xferv snd_xferv_t;
67
68typedef struct snd_pcm_file snd_pcm_file_t;
69typedef struct snd_pcm_runtime snd_pcm_runtime_t;
70typedef struct snd_pcm_hardware snd_pcm_hardware_t;
71typedef struct snd_pcm_ops snd_pcm_ops_t;
72typedef struct snd_pcm_hw_rule snd_pcm_hw_rule_t;
73typedef struct snd_pcm_hw_constraints snd_pcm_hw_constraints_t;
74typedef struct snd_ratnum ratnum_t;
75typedef struct snd_ratden ratden_t;
76typedef struct snd_pcm_hw_constraint_ratnums snd_pcm_hw_constraint_ratnums_t;
77typedef struct snd_pcm_hw_constraint_ratdens snd_pcm_hw_constraint_ratdens_t;
78typedef struct snd_pcm_hw_constraint_list snd_pcm_hw_constraint_list_t;
79typedef struct snd_pcm_group snd_pcm_group_t;
80typedef struct snd_pcm_notify snd_pcm_notify_t;
81
82/* rawmidi */
83typedef struct snd_rawmidi snd_rawmidi_t;
84typedef struct snd_rawmidi_info snd_rawmidi_info_t;
85typedef struct snd_rawmidi_params snd_rawmidi_params_t;
86typedef struct snd_rawmidi_status snd_rawmidi_status_t;
87typedef struct snd_rawmidi_runtime snd_rawmidi_runtime_t;
88typedef struct snd_rawmidi_substream snd_rawmidi_substream_t;
89typedef struct snd_rawmidi_str snd_rawmidi_str_t;
90typedef struct snd_rawmidi_ops snd_rawmidi_ops_t;
91typedef struct snd_rawmidi_global_ops snd_rawmidi_global_ops_t;
92typedef struct snd_rawmidi_file snd_rawmidi_file_t;
93
94/* hwdep */
95typedef struct snd_hwdep snd_hwdep_t;
96typedef struct snd_hwdep_info snd_hwdep_info_t;
97typedef struct snd_hwdep_dsp_status snd_hwdep_dsp_status_t;
98typedef struct snd_hwdep_dsp_image snd_hwdep_dsp_image_t;
99typedef struct snd_hwdep_ops snd_hwdep_ops_t;
100
101/* sequencer */
102typedef struct snd_seq_port_info snd_seq_port_info_t;
103typedef struct snd_seq_port_subscribe snd_seq_port_subscribe_t;
104typedef struct snd_seq_event snd_seq_event_t;
105typedef struct snd_seq_addr snd_seq_addr_t;
106typedef struct snd_seq_ev_volume snd_seq_ev_volume_t;
107typedef struct snd_seq_ev_loop snd_seq_ev_loop_t;
108typedef struct snd_seq_remove_events snd_seq_remove_events_t;
109typedef struct snd_seq_query_subs snd_seq_query_subs_t;
110typedef struct snd_seq_system_info snd_seq_system_info_t;
111typedef struct snd_seq_client_info snd_seq_client_info_t;
112typedef struct snd_seq_queue_info snd_seq_queue_info_t;
113typedef struct snd_seq_queue_status snd_seq_queue_status_t;
114typedef struct snd_seq_queue_tempo snd_seq_queue_tempo_t;
115typedef struct snd_seq_queue_owner snd_seq_queue_owner_t;
116typedef struct snd_seq_queue_timer snd_seq_queue_timer_t;
117typedef struct snd_seq_queue_client snd_seq_queue_client_t;
118typedef struct snd_seq_client_pool snd_seq_client_pool_t;
119typedef struct snd_seq_instr snd_seq_instr_t;
120typedef struct snd_seq_instr_data snd_seq_instr_data_t;
121typedef struct snd_seq_instr_header snd_seq_instr_header_t;
122
123typedef struct snd_seq_user_client user_client_t;
124typedef struct snd_seq_kernel_client kernel_client_t;
125typedef struct snd_seq_client client_t;
126typedef struct snd_seq_queue queue_t;
127
128/* seq_device */
129typedef struct snd_seq_device snd_seq_device_t;
130typedef struct snd_seq_dev_ops snd_seq_dev_ops_t;
131
132/* seq_midi */
133typedef struct snd_midi_event snd_midi_event_t;
134
135/* seq_midi_emul */
136typedef struct snd_midi_channel snd_midi_channel_t;
137typedef struct snd_midi_channel_set snd_midi_channel_set_t;
138typedef struct snd_midi_op snd_midi_op_t;
139
140/* seq_oss */
141typedef struct snd_seq_oss_arg snd_seq_oss_arg_t;
142typedef struct snd_seq_oss_callback snd_seq_oss_callback_t;
143typedef struct snd_seq_oss_reg snd_seq_oss_reg_t;
144
145/* virmidi */
146typedef struct snd_virmidi_dev snd_virmidi_dev_t;
147typedef struct snd_virmidi snd_virmidi_t;
148
149/* seq_instr */
150typedef struct snd_seq_kcluster snd_seq_kcluster_t;
151typedef struct snd_seq_kinstr_ops snd_seq_kinstr_ops_t;
152typedef struct snd_seq_kinstr snd_seq_kinstr_t;
153typedef struct snd_seq_kinstr_list snd_seq_kinstr_list_t;
154
155/* ac97 */
156typedef struct snd_ac97_bus ac97_bus_t;
157typedef struct snd_ac97_bus_ops ac97_bus_ops_t;
158typedef struct snd_ac97_template ac97_template_t;
159typedef struct snd_ac97 ac97_t;
160
161/* opl3/4 */
162typedef struct snd_opl3 opl3_t;
163typedef struct snd_opl4 opl4_t;
164
165/* mpu401 */
166typedef struct snd_mpu401 mpu401_t;
167
168/* i2c */
169typedef struct snd_i2c_device snd_i2c_device_t;
170typedef struct snd_i2c_bus snd_i2c_bus_t;
171
172typedef struct snd_ak4531 ak4531_t;
173
diff --git a/include/sound/uda1341.h b/include/sound/uda1341.h
index 61ff65a628bc..2e564bfb37fe 100644
--- a/include/sound/uda1341.h
+++ b/include/sound/uda1341.h
@@ -15,7 +15,7 @@
15 * features support 15 * features support
16 */ 16 */
17 17
18/* $Id: uda1341.h,v 1.6 2004/05/03 17:36:50 tiwai Exp $ */ 18/* $Id: uda1341.h,v 1.8 2005/11/17 14:17:21 tiwai Exp $ */
19 19
20#define UDA1341_ALSA_NAME "snd-uda1341" 20#define UDA1341_ALSA_NAME "snd-uda1341"
21 21
@@ -37,11 +37,6 @@ enum uda1341_onoff {
37 ON, 37 ON,
38}; 38};
39 39
40const char *onoff_names[] = {
41 "Off",
42 "On",
43};
44
45enum uda1341_format { 40enum uda1341_format {
46 I2S=0, 41 I2S=0,
47 LSB16, 42 LSB16,
@@ -53,17 +48,6 @@ enum uda1341_format {
53 LSB20MSB, 48 LSB20MSB,
54}; 49};
55 50
56const char *format_names[] = {
57 "I2S-bus",
58 "LSB 16bits",
59 "LSB 18bits",
60 "LSB 20bits",
61 "MSB",
62 "in LSB 16bits/out MSB",
63 "in LSB 18bits/out MSB",
64 "in LSB 20bits/out MSB",
65};
66
67enum uda1341_fs { 51enum uda1341_fs {
68 F512=0, 52 F512=0,
69 F384, 53 F384,
@@ -71,23 +55,11 @@ enum uda1341_fs {
71 Funused, 55 Funused,
72}; 56};
73 57
74const char *fs_names[] = {
75 "512*fs",
76 "384*fs",
77 "256*fs",
78 "Unused - bad value!",
79};
80
81enum uda1341_peak { 58enum uda1341_peak {
82 BEFORE=0, 59 BEFORE=0,
83 AFTER, 60 AFTER,
84}; 61};
85 62
86const char *peak_names[] = {
87 "before",
88 "after",
89};
90
91enum uda1341_filter { 63enum uda1341_filter {
92 FLAT=0, 64 FLAT=0,
93 MIN, 65 MIN,
@@ -95,24 +67,6 @@ enum uda1341_filter {
95 MAX, 67 MAX,
96}; 68};
97 69
98const char *filter_names[] = {
99 "flat",
100 "min",
101 "min",
102 "max",
103};
104
105const char*bass_values[][16] = {
106 {"0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB", "0 dB",
107 "0 dB", "0 dB", "0 dB", "0 dB", "undefined", }, //flat
108 {"0 dB", "2 dB", "4 dB", "6 dB", "8 dB", "10 dB", "12 dB", "14 dB", "16 dB", "18 dB", "18 dB",
109 "18 dB", "18 dB", "18 dB", "18 dB", "undefined",}, // min
110 {"0 dB", "2 dB", "4 dB", "6 dB", "8 dB", "10 dB", "12 dB", "14 dB", "16 dB", "18 dB", "18 dB",
111 "18 dB", "18 dB", "18 dB", "18 dB", "undefined",}, // min
112 {"0 dB", "2 dB", "4 dB", "6 dB", "8 dB", "10 dB", "12 dB", "14 dB", "16 dB", "18 dB", "20 dB",
113 "22 dB", "24 dB", "24 dB", "24 dB", "undefined",}, // max
114};
115
116enum uda1341_mixer { 70enum uda1341_mixer {
117 DOUBLE, 71 DOUBLE,
118 LINE, 72 LINE,
@@ -120,13 +74,6 @@ enum uda1341_mixer {
120 MIXER, 74 MIXER,
121}; 75};
122 76
123const char *mixer_names[] = {
124 "double differential",
125 "input channel 1 (line in)",
126 "input channel 2 (microphone)",
127 "digital mixer",
128};
129
130enum uda1341_deemp { 77enum uda1341_deemp {
131 NONE, 78 NONE,
132 D32, 79 D32,
@@ -134,58 +81,6 @@ enum uda1341_deemp {
134 D48, 81 D48,
135}; 82};
136 83
137const char *deemp_names[] = {
138 "none",
139 "32 kHz",
140 "44.1 kHz",
141 "48 kHz",
142};
143
144const char *mic_sens_value[] = {
145 "-3 dB", "0 dB", "3 dB", "9 dB", "15 dB", "21 dB", "27 dB", "not used",
146};
147
148const unsigned short AGC_atime[] = {
149 11, 16, 11, 16, 21, 11, 16, 21,
150};
151
152const unsigned short AGC_dtime[] = {
153 100, 100, 200, 200, 200, 400, 400, 400,
154};
155
156const char *AGC_level[] = {
157 "-9.0", "-11.5", "-15.0", "-17.5",
158};
159
160const char *ig_small_value[] = {
161 "-3.0", "-2.5", "-2.0", "-1.5", "-1.0", "-0.5",
162};
163
164/*
165 * this was computed as peak_value[i] = pow((63-i)*1.42,1.013)
166 *
167 * UDA1341 datasheet on page 21: Peak value (dB) = (Peak level - 63.5)*5*log2
168 * There is an table with these values [level]=value: [3]=-90.31, [7]=-84.29
169 * [61]=-2.78, [62] = -1.48, [63] = 0.0
170 * I tried to compute it, but using but even using logarithm with base either 10 or 2
171 * i was'n able to get values in the table from the formula. So I constructed another
172 * formula (see above) to interpolate the values as good as possible. If there is some
173 * mistake, please contact me on tomas.kasparek@seznam.cz. Thanks.
174 * UDA1341TS datasheet is available at:
175 * http://www-us9.semiconductors.com/acrobat/datasheets/UDA1341TS_3.pdf
176 */
177const char *peak_value[] = {
178 "-INF dB", "N.A.", "N.A", "90.31 dB", "N.A.", "N.A.", "N.A.", "-84.29 dB",
179 "-82.65 dB", "-81.13 dB", "-79.61 dB", "-78.09 dB", "-76.57 dB", "-75.05 dB", "-73.53 dB",
180 "-72.01 dB", "-70.49 dB", "-68.97 dB", "-67.45 dB", "-65.93 dB", "-64.41 dB", "-62.90 dB",
181 "-61.38 dB", "-59.86 dB", "-58.35 dB", "-56.83 dB", "-55.32 dB", "-53.80 dB", "-52.29 dB",
182 "-50.78 dB", "-49.26 dB", "-47.75 dB", "-46.24 dB", "-44.73 dB", "-43.22 dB", "-41.71 dB",
183 "-40.20 dB", "-38.69 dB", "-37.19 dB", "-35.68 dB", "-34.17 dB", "-32.67 dB", "-31.17 dB",
184 "-29.66 dB", "-28.16 dB", "-26.66 dB", "-25.16 dB", "-23.66 dB", "-22.16 dB", "-20.67 dB",
185 "-19.17 dB", "-17.68 dB", "-16.19 dB", "-14.70 dB", "-13.21 dB", "-11.72 dB", "-10.24 dB",
186 "-8.76 dB", "-7.28 dB", "-5.81 dB", "-4.34 dB", "-2.88 dB", "-1.43 dB", "0.00 dB",
187};
188
189enum uda1341_config { 84enum uda1341_config {
190 CMD_READ_REG = 0, 85 CMD_READ_REG = 0,
191 CMD_RESET, 86 CMD_RESET,
@@ -224,7 +119,7 @@ enum write_through {
224 FLUSH, 119 FLUSH,
225}; 120};
226 121
227int __init snd_chip_uda1341_mixer_new(snd_card_t *card, struct l3_client **clnt); 122int __init snd_chip_uda1341_mixer_new(struct snd_card *card, struct l3_client **clnt);
228 123
229/* 124/*
230 * Local variables: 125 * Local variables:
diff --git a/include/sound/util_mem.h b/include/sound/util_mem.h
index 9d2cdfa0c42a..69944bbb5445 100644
--- a/include/sound/util_mem.h
+++ b/include/sound/util_mem.h
@@ -20,29 +20,25 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22 22
23typedef struct snd_util_memblk snd_util_memblk_t;
24typedef struct snd_util_memhdr snd_util_memhdr_t;
25typedef unsigned int snd_util_unit_t;
26
27/* 23/*
28 * memory block 24 * memory block
29 */ 25 */
30struct snd_util_memblk { 26struct snd_util_memblk {
31 snd_util_unit_t size; /* size of this block */ 27 unsigned int size; /* size of this block */
32 snd_util_unit_t offset; /* zero-offset of this block */ 28 unsigned int offset; /* zero-offset of this block */
33 struct list_head list; /* link */ 29 struct list_head list; /* link */
34}; 30};
35 31
36#define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(snd_util_memblk_t)) 32#define snd_util_memblk_argptr(blk) (void*)((char*)(blk) + sizeof(struct snd_util_memblk))
37 33
38/* 34/*
39 * memory management information 35 * memory management information
40 */ 36 */
41struct snd_util_memhdr { 37struct snd_util_memhdr {
42 snd_util_unit_t size; /* size of whole data */ 38 unsigned int size; /* size of whole data */
43 struct list_head block; /* block linked-list header */ 39 struct list_head block; /* block linked-list header */
44 int nblocks; /* # of allocated blocks */ 40 int nblocks; /* # of allocated blocks */
45 snd_util_unit_t used; /* used memory size */ 41 unsigned int used; /* used memory size */
46 int block_extra_size; /* extra data size of chunk */ 42 int block_extra_size; /* extra data size of chunk */
47 struct semaphore block_mutex; /* lock */ 43 struct semaphore block_mutex; /* lock */
48}; 44};
@@ -50,15 +46,17 @@ struct snd_util_memhdr {
50/* 46/*
51 * prototypes 47 * prototypes
52 */ 48 */
53snd_util_memhdr_t *snd_util_memhdr_new(int memsize); 49struct snd_util_memhdr *snd_util_memhdr_new(int memsize);
54void snd_util_memhdr_free(snd_util_memhdr_t *hdr); 50void snd_util_memhdr_free(struct snd_util_memhdr *hdr);
55snd_util_memblk_t *snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); 51struct snd_util_memblk *snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);
56int snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); 52int snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);
57int snd_util_mem_avail(snd_util_memhdr_t *hdr); 53int snd_util_mem_avail(struct snd_util_memhdr *hdr);
58 54
59/* functions without mutex */ 55/* functions without mutex */
60snd_util_memblk_t *__snd_util_mem_alloc(snd_util_memhdr_t *hdr, int size); 56struct snd_util_memblk *__snd_util_mem_alloc(struct snd_util_memhdr *hdr, int size);
61void __snd_util_mem_free(snd_util_memhdr_t *hdr, snd_util_memblk_t *blk); 57void __snd_util_mem_free(struct snd_util_memhdr *hdr, struct snd_util_memblk *blk);
62snd_util_memblk_t *__snd_util_memblk_new(snd_util_memhdr_t *hdr, snd_util_unit_t units, struct list_head *prev); 58struct snd_util_memblk *__snd_util_memblk_new(struct snd_util_memhdr *hdr,
59 unsigned int units,
60 struct list_head *prev);
63 61
64#endif /* __SOUND_UTIL_MEM_H */ 62#endif /* __SOUND_UTIL_MEM_H */
diff --git a/include/sound/version.h b/include/sound/version.h
index d1bd3b723967..919da0dd001c 100644
--- a/include/sound/version.h
+++ b/include/sound/version.h
@@ -1,3 +1,3 @@
1/* include/version.h. Generated by configure. */ 1/* include/version.h. Generated by configure. */
2#define CONFIG_SND_VERSION "1.0.10rc3" 2#define CONFIG_SND_VERSION "1.0.11rc2"
3#define CONFIG_SND_DATE " (Mon Nov 07 13:30:21 2005 UTC)" 3#define CONFIG_SND_DATE " (Wed Jan 04 08:57:20 2006 UTC)"
diff --git a/include/sound/vx_core.h b/include/sound/vx_core.h
index 7a60a3888667..5fd6f3305e0d 100644
--- a/include/sound/vx_core.h
+++ b/include/sound/vx_core.h
@@ -36,9 +36,6 @@
36struct firmware; 36struct firmware;
37struct device; 37struct device;
38 38
39typedef struct snd_vx_core vx_core_t;
40typedef struct vx_pipe vx_pipe_t;
41
42#define VX_DRIVER_VERSION 0x010000 /* 1.0.0 */ 39#define VX_DRIVER_VERSION 0x010000 /* 1.0.0 */
43 40
44/* 41/*
@@ -76,7 +73,7 @@ struct vx_pipe {
76 int channels; 73 int channels;
77 unsigned int differed_type; 74 unsigned int differed_type;
78 pcx_time_t pcx_time; 75 pcx_time_t pcx_time;
79 snd_pcm_substream_t *substream; 76 struct snd_pcm_substream *substream;
80 77
81 int hbuf_size; /* H-buffer size in bytes */ 78 int hbuf_size; /* H-buffer size in bytes */
82 int buffer_bytes; /* the ALSA pcm buffer size in bytes */ 79 int buffer_bytes; /* the ALSA pcm buffer size in bytes */
@@ -88,36 +85,38 @@ struct vx_pipe {
88 u64 cur_count; /* current sample position (for playback) */ 85 u64 cur_count; /* current sample position (for playback) */
89 86
90 unsigned int references; /* an output pipe may be used for monitoring and/or playback */ 87 unsigned int references; /* an output pipe may be used for monitoring and/or playback */
91 vx_pipe_t *monitoring_pipe; /* pointer to the monitoring pipe (capture pipe only)*/ 88 struct vx_pipe *monitoring_pipe; /* pointer to the monitoring pipe (capture pipe only)*/
92 89
93 struct tasklet_struct start_tq; 90 struct tasklet_struct start_tq;
94}; 91};
95 92
93struct vx_core;
94
96struct snd_vx_ops { 95struct snd_vx_ops {
97 /* low-level i/o */ 96 /* low-level i/o */
98 unsigned char (*in8)(vx_core_t *chip, int reg); 97 unsigned char (*in8)(struct vx_core *chip, int reg);
99 unsigned int (*in32)(vx_core_t *chip, int reg); 98 unsigned int (*in32)(struct vx_core *chip, int reg);
100 void (*out8)(vx_core_t *chip, int reg, unsigned char val); 99 void (*out8)(struct vx_core *chip, int reg, unsigned char val);
101 void (*out32)(vx_core_t *chip, int reg, unsigned int val); 100 void (*out32)(struct vx_core *chip, int reg, unsigned int val);
102 /* irq */ 101 /* irq */
103 int (*test_and_ack)(vx_core_t *chip); 102 int (*test_and_ack)(struct vx_core *chip);
104 void (*validate_irq)(vx_core_t *chip, int enable); 103 void (*validate_irq)(struct vx_core *chip, int enable);
105 /* codec */ 104 /* codec */
106 void (*write_codec)(vx_core_t *chip, int codec, unsigned int data); 105 void (*write_codec)(struct vx_core *chip, int codec, unsigned int data);
107 void (*akm_write)(vx_core_t *chip, int reg, unsigned int data); 106 void (*akm_write)(struct vx_core *chip, int reg, unsigned int data);
108 void (*reset_codec)(vx_core_t *chip); 107 void (*reset_codec)(struct vx_core *chip);
109 void (*change_audio_source)(vx_core_t *chip, int src); 108 void (*change_audio_source)(struct vx_core *chip, int src);
110 void (*set_clock_source)(vx_core_t *chp, int src); 109 void (*set_clock_source)(struct vx_core *chp, int src);
111 /* chip init */ 110 /* chip init */
112 int (*load_dsp)(vx_core_t *chip, int idx, const struct firmware *fw); 111 int (*load_dsp)(struct vx_core *chip, int idx, const struct firmware *fw);
113 void (*reset_dsp)(vx_core_t *chip); 112 void (*reset_dsp)(struct vx_core *chip);
114 void (*reset_board)(vx_core_t *chip, int cold_reset); 113 void (*reset_board)(struct vx_core *chip, int cold_reset);
115 int (*add_controls)(vx_core_t *chip); 114 int (*add_controls)(struct vx_core *chip);
116 /* pcm */ 115 /* pcm */
117 void (*dma_write)(vx_core_t *chip, snd_pcm_runtime_t *runtime, 116 void (*dma_write)(struct vx_core *chip, struct snd_pcm_runtime *runtime,
118 vx_pipe_t *pipe, int count); 117 struct vx_pipe *pipe, int count);
119 void (*dma_read)(vx_core_t *chip, snd_pcm_runtime_t *runtime, 118 void (*dma_read)(struct vx_core *chip, struct snd_pcm_runtime *runtime,
120 vx_pipe_t *pipe, int count); 119 struct vx_pipe *pipe, int count);
121}; 120};
122 121
123struct snd_vx_hardware { 122struct snd_vx_hardware {
@@ -158,10 +157,10 @@ enum {
158/* min/max values for analog output for old codecs */ 157/* min/max values for analog output for old codecs */
159#define VX_ANALOG_OUT_LEVEL_MAX 0xe3 158#define VX_ANALOG_OUT_LEVEL_MAX 0xe3
160 159
161struct snd_vx_core { 160struct vx_core {
162 /* ALSA stuff */ 161 /* ALSA stuff */
163 snd_card_t *card; 162 struct snd_card *card;
164 snd_pcm_t *pcm[VX_MAX_CODECS]; 163 struct snd_pcm *pcm[VX_MAX_CODECS];
165 int type; /* VX_TYPE_XXX */ 164 int type; /* VX_TYPE_XXX */
166 165
167 int irq; 166 int irq;
@@ -179,7 +178,7 @@ struct snd_vx_core {
179 unsigned int pcm_running; 178 unsigned int pcm_running;
180 179
181 struct device *dev; 180 struct device *dev;
182 snd_hwdep_t *hwdep; 181 struct snd_hwdep *hwdep;
183 182
184 struct vx_rmh irq_rmh; /* RMH used in interrupts */ 183 struct vx_rmh irq_rmh; /* RMH used in interrupts */
185 184
@@ -216,14 +215,14 @@ struct snd_vx_core {
216/* 215/*
217 * constructor 216 * constructor
218 */ 217 */
219vx_core_t *snd_vx_create(snd_card_t *card, struct snd_vx_hardware *hw, 218struct vx_core *snd_vx_create(struct snd_card *card, struct snd_vx_hardware *hw,
220 struct snd_vx_ops *ops, int extra_size); 219 struct snd_vx_ops *ops, int extra_size);
221int snd_vx_setup_firmware(vx_core_t *chip); 220int snd_vx_setup_firmware(struct vx_core *chip);
222int snd_vx_load_boot_image(vx_core_t *chip, const struct firmware *dsp); 221int snd_vx_load_boot_image(struct vx_core *chip, const struct firmware *dsp);
223int snd_vx_dsp_boot(vx_core_t *chip, const struct firmware *dsp); 222int snd_vx_dsp_boot(struct vx_core *chip, const struct firmware *dsp);
224int snd_vx_dsp_load(vx_core_t *chip, const struct firmware *dsp); 223int snd_vx_dsp_load(struct vx_core *chip, const struct firmware *dsp);
225 224
226void snd_vx_free_firmware(vx_core_t *chip); 225void snd_vx_free_firmware(struct vx_core *chip);
227 226
228/* 227/*
229 * interrupt handler; exported for pcmcia 228 * interrupt handler; exported for pcmcia
@@ -233,37 +232,37 @@ irqreturn_t snd_vx_irq_handler(int irq, void *dev, struct pt_regs *regs);
233/* 232/*
234 * lowlevel functions 233 * lowlevel functions
235 */ 234 */
236static inline int vx_test_and_ack(vx_core_t *chip) 235static inline int vx_test_and_ack(struct vx_core *chip)
237{ 236{
238 snd_assert(chip->ops->test_and_ack, return -ENXIO); 237 snd_assert(chip->ops->test_and_ack, return -ENXIO);
239 return chip->ops->test_and_ack(chip); 238 return chip->ops->test_and_ack(chip);
240} 239}
241 240
242static inline void vx_validate_irq(vx_core_t *chip, int enable) 241static inline void vx_validate_irq(struct vx_core *chip, int enable)
243{ 242{
244 snd_assert(chip->ops->validate_irq, return); 243 snd_assert(chip->ops->validate_irq, return);
245 chip->ops->validate_irq(chip, enable); 244 chip->ops->validate_irq(chip, enable);
246} 245}
247 246
248static inline unsigned char snd_vx_inb(vx_core_t *chip, int reg) 247static inline unsigned char snd_vx_inb(struct vx_core *chip, int reg)
249{ 248{
250 snd_assert(chip->ops->in8, return 0); 249 snd_assert(chip->ops->in8, return 0);
251 return chip->ops->in8(chip, reg); 250 return chip->ops->in8(chip, reg);
252} 251}
253 252
254static inline unsigned int snd_vx_inl(vx_core_t *chip, int reg) 253static inline unsigned int snd_vx_inl(struct vx_core *chip, int reg)
255{ 254{
256 snd_assert(chip->ops->in32, return 0); 255 snd_assert(chip->ops->in32, return 0);
257 return chip->ops->in32(chip, reg); 256 return chip->ops->in32(chip, reg);
258} 257}
259 258
260static inline void snd_vx_outb(vx_core_t *chip, int reg, unsigned char val) 259static inline void snd_vx_outb(struct vx_core *chip, int reg, unsigned char val)
261{ 260{
262 snd_assert(chip->ops->out8, return); 261 snd_assert(chip->ops->out8, return);
263 chip->ops->out8(chip, reg, val); 262 chip->ops->out8(chip, reg, val);
264} 263}
265 264
266static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val) 265static inline void snd_vx_outl(struct vx_core *chip, int reg, unsigned int val)
267{ 266{
268 snd_assert(chip->ops->out32, return); 267 snd_assert(chip->ops->out32, return);
269 chip->ops->out32(chip, reg, val); 268 chip->ops->out32(chip, reg, val);
@@ -274,27 +273,25 @@ static inline void snd_vx_outl(vx_core_t *chip, int reg, unsigned int val)
274#define vx_inl(chip,reg) snd_vx_inl(chip, VX_##reg) 273#define vx_inl(chip,reg) snd_vx_inl(chip, VX_##reg)
275#define vx_outl(chip,reg,val) snd_vx_outl(chip, VX_##reg,val) 274#define vx_outl(chip,reg,val) snd_vx_outl(chip, VX_##reg,val)
276 275
277void snd_vx_delay(vx_core_t *chip, int msec); 276static inline void vx_reset_dsp(struct vx_core *chip)
278
279static inline void vx_reset_dsp(vx_core_t *chip)
280{ 277{
281 snd_assert(chip->ops->reset_dsp, return); 278 snd_assert(chip->ops->reset_dsp, return);
282 chip->ops->reset_dsp(chip); 279 chip->ops->reset_dsp(chip);
283} 280}
284 281
285int vx_send_msg(vx_core_t *chip, struct vx_rmh *rmh); 282int vx_send_msg(struct vx_core *chip, struct vx_rmh *rmh);
286int vx_send_msg_nolock(vx_core_t *chip, struct vx_rmh *rmh); 283int vx_send_msg_nolock(struct vx_core *chip, struct vx_rmh *rmh);
287int vx_send_rih(vx_core_t *chip, int cmd); 284int vx_send_rih(struct vx_core *chip, int cmd);
288int vx_send_rih_nolock(vx_core_t *chip, int cmd); 285int vx_send_rih_nolock(struct vx_core *chip, int cmd);
289 286
290void vx_reset_codec(vx_core_t *chip, int cold_reset); 287void vx_reset_codec(struct vx_core *chip, int cold_reset);
291 288
292/* 289/*
293 * check the bit on the specified register 290 * check the bit on the specified register
294 * returns zero if a bit matches, or a negative error code. 291 * returns zero if a bit matches, or a negative error code.
295 * exported for vxpocket driver 292 * exported for vxpocket driver
296 */ 293 */
297int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time); 294int snd_vx_check_reg_bit(struct vx_core *chip, int reg, int mask, int bit, int time);
298#define vx_check_isr(chip,mask,bit,time) snd_vx_check_reg_bit(chip, VX_ISR, mask, bit, time) 295#define vx_check_isr(chip,mask,bit,time) snd_vx_check_reg_bit(chip, VX_ISR, mask, bit, time)
299#define vx_wait_isr_bit(chip,bit) vx_check_isr(chip, bit, bit, 200) 296#define vx_wait_isr_bit(chip,bit) vx_check_isr(chip, bit, bit, 200)
300#define vx_wait_for_rx_full(chip) vx_wait_isr_bit(chip, ISR_RX_FULL) 297#define vx_wait_for_rx_full(chip) vx_wait_isr_bit(chip, ISR_RX_FULL)
@@ -303,15 +300,15 @@ int snd_vx_check_reg_bit(vx_core_t *chip, int reg, int mask, int bit, int time);
303/* 300/*
304 * pseudo-DMA transfer 301 * pseudo-DMA transfer
305 */ 302 */
306static inline void vx_pseudo_dma_write(vx_core_t *chip, snd_pcm_runtime_t *runtime, 303static inline void vx_pseudo_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime,
307 vx_pipe_t *pipe, int count) 304 struct vx_pipe *pipe, int count)
308{ 305{
309 snd_assert(chip->ops->dma_write, return); 306 snd_assert(chip->ops->dma_write, return);
310 chip->ops->dma_write(chip, runtime, pipe, count); 307 chip->ops->dma_write(chip, runtime, pipe, count);
311} 308}
312 309
313static inline void vx_pseudo_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtime, 310static inline void vx_pseudo_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime,
314 vx_pipe_t *pipe, int count) 311 struct vx_pipe *pipe, int count)
315{ 312{
316 snd_assert(chip->ops->dma_read, return); 313 snd_assert(chip->ops->dma_read, return);
317 chip->ops->dma_read(chip, runtime, pipe, count); 314 chip->ops->dma_read(chip, runtime, pipe, count);
@@ -329,27 +326,33 @@ static inline void vx_pseudo_dma_read(vx_core_t *chip, snd_pcm_runtime_t *runtim
329/* 326/*
330 * pcm stuff 327 * pcm stuff
331 */ 328 */
332int snd_vx_pcm_new(vx_core_t *chip); 329int snd_vx_pcm_new(struct vx_core *chip);
333void vx_pcm_update_intr(vx_core_t *chip, unsigned int events); 330void vx_pcm_update_intr(struct vx_core *chip, unsigned int events);
334 331
335/* 332/*
336 * mixer stuff 333 * mixer stuff
337 */ 334 */
338int snd_vx_mixer_new(vx_core_t *chip); 335int snd_vx_mixer_new(struct vx_core *chip);
339void vx_toggle_dac_mute(vx_core_t *chip, int mute); 336void vx_toggle_dac_mute(struct vx_core *chip, int mute);
340int vx_sync_audio_source(vx_core_t *chip); 337int vx_sync_audio_source(struct vx_core *chip);
341int vx_set_monitor_level(vx_core_t *chip, int audio, int level, int active); 338int vx_set_monitor_level(struct vx_core *chip, int audio, int level, int active);
342 339
343/* 340/*
344 * IEC958 & clock stuff 341 * IEC958 & clock stuff
345 */ 342 */
346void vx_set_iec958_status(vx_core_t *chip, unsigned int bits); 343void vx_set_iec958_status(struct vx_core *chip, unsigned int bits);
347int vx_set_clock(vx_core_t *chip, unsigned int freq); 344int vx_set_clock(struct vx_core *chip, unsigned int freq);
348void vx_set_internal_clock(vx_core_t *chip, unsigned int freq); 345void vx_set_internal_clock(struct vx_core *chip, unsigned int freq);
349int vx_change_frequency(vx_core_t *chip); 346int vx_change_frequency(struct vx_core *chip);
350 347
351 348
352/* 349/*
350 * PM
351 */
352int snd_vx_suspend(struct vx_core *card, pm_message_t state);
353int snd_vx_resume(struct vx_core *card);
354
355/*
353 * hardware constants 356 * hardware constants
354 */ 357 */
355 358
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h
index c3bccbfd8d4c..d567bfdbf513 100644
--- a/include/sound/ymfpci.h
+++ b/include/sound/ymfpci.h
@@ -184,7 +184,7 @@
184 * 184 *
185 */ 185 */
186 186
187typedef struct _snd_ymfpci_playback_bank { 187struct snd_ymfpci_playback_bank {
188 u32 format; 188 u32 format;
189 u32 loop_default; 189 u32 loop_default;
190 u32 base; /* 32-bit address */ 190 u32 base; /* 32-bit address */
@@ -215,46 +215,45 @@ typedef struct _snd_ymfpci_playback_bank {
215 u32 eff3_gain; 215 u32 eff3_gain;
216 u32 lpfD1; 216 u32 lpfD1;
217 u32 lpfD2; 217 u32 lpfD2;
218} snd_ymfpci_playback_bank_t; 218 };
219 219
220typedef struct _snd_ymfpci_capture_bank { 220struct snd_ymfpci_capture_bank {
221 u32 base; /* 32-bit address */ 221 u32 base; /* 32-bit address */
222 u32 loop_end; /* 32-bit offset */ 222 u32 loop_end; /* 32-bit offset */
223 u32 start; /* 32-bit offset */ 223 u32 start; /* 32-bit offset */
224 u32 num_of_loops; /* counter */ 224 u32 num_of_loops; /* counter */
225} snd_ymfpci_capture_bank_t; 225};
226 226
227typedef struct _snd_ymfpci_effect_bank { 227struct snd_ymfpci_effect_bank {
228 u32 base; /* 32-bit address */ 228 u32 base; /* 32-bit address */
229 u32 loop_end; /* 32-bit offset */ 229 u32 loop_end; /* 32-bit offset */
230 u32 start; /* 32-bit offset */ 230 u32 start; /* 32-bit offset */
231 u32 temp; 231 u32 temp;
232} snd_ymfpci_effect_bank_t; 232};
233 233
234typedef struct _snd_ymfpci_voice ymfpci_voice_t; 234struct snd_ymfpci_pcm;
235typedef struct _snd_ymfpci_pcm ymfpci_pcm_t; 235struct snd_ymfpci;
236typedef struct _snd_ymfpci ymfpci_t;
237 236
238typedef enum { 237enum snd_ymfpci_voice_type {
239 YMFPCI_PCM, 238 YMFPCI_PCM,
240 YMFPCI_SYNTH, 239 YMFPCI_SYNTH,
241 YMFPCI_MIDI 240 YMFPCI_MIDI
242} ymfpci_voice_type_t; 241};
243 242
244struct _snd_ymfpci_voice { 243struct snd_ymfpci_voice {
245 ymfpci_t *chip; 244 struct snd_ymfpci *chip;
246 int number; 245 int number;
247 unsigned int use: 1, 246 unsigned int use: 1,
248 pcm: 1, 247 pcm: 1,
249 synth: 1, 248 synth: 1,
250 midi: 1; 249 midi: 1;
251 snd_ymfpci_playback_bank_t *bank; 250 struct snd_ymfpci_playback_bank *bank;
252 dma_addr_t bank_addr; 251 dma_addr_t bank_addr;
253 void (*interrupt)(ymfpci_t *chip, ymfpci_voice_t *voice); 252 void (*interrupt)(struct snd_ymfpci *chip, struct snd_ymfpci_voice *voice);
254 ymfpci_pcm_t *ypcm; 253 struct snd_ymfpci_pcm *ypcm;
255}; 254};
256 255
257typedef enum { 256enum snd_ymfpci_pcm_type {
258 PLAYBACK_VOICE, 257 PLAYBACK_VOICE,
259 CAPTURE_REC, 258 CAPTURE_REC,
260 CAPTURE_AC97, 259 CAPTURE_AC97,
@@ -263,13 +262,13 @@ typedef enum {
263 EFFECT_EFF1, 262 EFFECT_EFF1,
264 EFFECT_EFF2, 263 EFFECT_EFF2,
265 EFFECT_EFF3 264 EFFECT_EFF3
266} snd_ymfpci_pcm_type_t; 265};
267 266
268struct _snd_ymfpci_pcm { 267struct snd_ymfpci_pcm {
269 ymfpci_t *chip; 268 struct snd_ymfpci *chip;
270 snd_ymfpci_pcm_type_t type; 269 enum snd_ymfpci_pcm_type type;
271 snd_pcm_substream_t *substream; 270 struct snd_pcm_substream *substream;
272 ymfpci_voice_t *voices[2]; /* playback only */ 271 struct snd_ymfpci_voice *voices[2]; /* playback only */
273 unsigned int running: 1; 272 unsigned int running: 1;
274 unsigned int output_front: 1; 273 unsigned int output_front: 1;
275 unsigned int output_rear: 1; 274 unsigned int output_rear: 1;
@@ -282,7 +281,7 @@ struct _snd_ymfpci_pcm {
282 u32 shift; 281 u32 shift;
283}; 282};
284 283
285struct _snd_ymfpci { 284struct snd_ymfpci {
286 int irq; 285 int irq;
287 286
288 unsigned int device_id; /* PCI device ID */ 287 unsigned int device_id; /* PCI device ID */
@@ -316,47 +315,47 @@ struct _snd_ymfpci {
316 struct snd_dma_buffer ac3_tmp_base; 315 struct snd_dma_buffer ac3_tmp_base;
317 316
318 u32 *ctrl_playback; 317 u32 *ctrl_playback;
319 snd_ymfpci_playback_bank_t *bank_playback[YDSXG_PLAYBACK_VOICES][2]; 318 struct snd_ymfpci_playback_bank *bank_playback[YDSXG_PLAYBACK_VOICES][2];
320 snd_ymfpci_capture_bank_t *bank_capture[YDSXG_CAPTURE_VOICES][2]; 319 struct snd_ymfpci_capture_bank *bank_capture[YDSXG_CAPTURE_VOICES][2];
321 snd_ymfpci_effect_bank_t *bank_effect[YDSXG_EFFECT_VOICES][2]; 320 struct snd_ymfpci_effect_bank *bank_effect[YDSXG_EFFECT_VOICES][2];
322 321
323 int start_count; 322 int start_count;
324 323
325 u32 active_bank; 324 u32 active_bank;
326 ymfpci_voice_t voices[64]; 325 struct snd_ymfpci_voice voices[64];
327 326
328 ac97_bus_t *ac97_bus; 327 struct snd_ac97_bus *ac97_bus;
329 ac97_t *ac97; 328 struct snd_ac97 *ac97;
330 snd_rawmidi_t *rawmidi; 329 struct snd_rawmidi *rawmidi;
331 snd_timer_t *timer; 330 struct snd_timer *timer;
332 331
333 struct pci_dev *pci; 332 struct pci_dev *pci;
334 snd_card_t *card; 333 struct snd_card *card;
335 snd_pcm_t *pcm; 334 struct snd_pcm *pcm;
336 snd_pcm_t *pcm2; 335 struct snd_pcm *pcm2;
337 snd_pcm_t *pcm_spdif; 336 struct snd_pcm *pcm_spdif;
338 snd_pcm_t *pcm_4ch; 337 struct snd_pcm *pcm_4ch;
339 snd_pcm_substream_t *capture_substream[YDSXG_CAPTURE_VOICES]; 338 struct snd_pcm_substream *capture_substream[YDSXG_CAPTURE_VOICES];
340 snd_pcm_substream_t *effect_substream[YDSXG_EFFECT_VOICES]; 339 struct snd_pcm_substream *effect_substream[YDSXG_EFFECT_VOICES];
341 snd_kcontrol_t *ctl_vol_recsrc; 340 struct snd_kcontrol *ctl_vol_recsrc;
342 snd_kcontrol_t *ctl_vol_adcrec; 341 struct snd_kcontrol *ctl_vol_adcrec;
343 snd_kcontrol_t *ctl_vol_spdifrec; 342 struct snd_kcontrol *ctl_vol_spdifrec;
344 unsigned short spdif_bits, spdif_pcm_bits; 343 unsigned short spdif_bits, spdif_pcm_bits;
345 snd_kcontrol_t *spdif_pcm_ctl; 344 struct snd_kcontrol *spdif_pcm_ctl;
346 int mode_dup4ch; 345 int mode_dup4ch;
347 int rear_opened; 346 int rear_opened;
348 int spdif_opened; 347 int spdif_opened;
349 struct { 348 struct {
350 u16 left; 349 u16 left;
351 u16 right; 350 u16 right;
352 snd_kcontrol_t *ctl; 351 struct snd_kcontrol *ctl;
353 } pcm_mixer[32]; 352 } pcm_mixer[32];
354 353
355 spinlock_t reg_lock; 354 spinlock_t reg_lock;
356 spinlock_t voice_lock; 355 spinlock_t voice_lock;
357 wait_queue_head_t interrupt_sleep; 356 wait_queue_head_t interrupt_sleep;
358 atomic_t interrupt_sleep_count; 357 atomic_t interrupt_sleep_count;
359 snd_info_entry_t *proc_entry; 358 struct snd_info_entry *proc_entry;
360 359
361#ifdef CONFIG_PM 360#ifdef CONFIG_PM
362 u32 *saved_regs; 361 u32 *saved_regs;
@@ -364,17 +363,20 @@ struct _snd_ymfpci {
364#endif 363#endif
365}; 364};
366 365
367int snd_ymfpci_create(snd_card_t * card, 366int snd_ymfpci_create(struct snd_card *card,
368 struct pci_dev *pci, 367 struct pci_dev *pci,
369 unsigned short old_legacy_ctrl, 368 unsigned short old_legacy_ctrl,
370 ymfpci_t ** rcodec); 369 struct snd_ymfpci ** rcodec);
371void snd_ymfpci_free_gameport(ymfpci_t *chip); 370void snd_ymfpci_free_gameport(struct snd_ymfpci *chip);
372 371
373int snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t **rpcm); 372int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state);
374int snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t **rpcm); 373int snd_ymfpci_resume(struct pci_dev *pci);
375int snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t **rpcm); 374
376int snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t **rpcm); 375int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
377int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch); 376int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
378int snd_ymfpci_timer(ymfpci_t *chip, int device); 377int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
378int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm);
379int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch);
380int snd_ymfpci_timer(struct snd_ymfpci *chip, int device);
379 381
380#endif /* __SOUND_YMFPCI_H */ 382#endif /* __SOUND_YMFPCI_H */