Changeset 34 for GPL/trunk/alsa-kernel/include/sound
- Timestamp:
- Dec 11, 2005, 5:57:39 PM (20 years ago)
- Location:
- GPL/trunk/alsa-kernel/include/sound
- Files:
-
- 20 edited
-
ac97_codec.h (modified) (5 diffs)
-
ainstr_simple.h (modified) (1 diff)
-
asound.h (modified) (4 diffs)
-
asoundef.h (modified) (1 diff)
-
config.h (modified) (1 diff)
-
cs46xx.h (modified) (5 diffs)
-
cs46xx_dsp_scb_types.h (modified) (28 diffs)
-
cs46xx_dsp_spos.h (modified) (5 diffs)
-
cs46xx_dsp_task_types.h (modified) (6 diffs)
-
driver.h (modified) (6 diffs)
-
emu10k1.h (modified) (42 diffs)
-
emu10k1_synth.h (modified) (1 diff)
-
emux_synth.h (modified) (10 diffs)
-
instr.h (modified) (1 diff)
-
pcm-indirect.h (modified) (5 diffs)
-
seq_midi_event.h (modified) (3 diffs)
-
seq_virmidi.h (modified) (6 diffs)
-
sfnt_info.h (modified) (13 diffs)
-
soundfont.h (modified) (8 diffs)
-
trident.h (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/include/sound/ac97_codec.h
r33 r34 399 399 */ 400 400 401 typedef struct _snd_ac97_bus ac97_bus_t;402 typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;403 typedef struct _snd_ac97_template ac97_template_t;404 typedef struct _snd_ac97 ac97_t;405 406 401 enum ac97_pcm_cfg { 407 402 AC97_PCM_CFG_FRONT = 2, … … 448 443 }; 449 444 450 struct _snd_ac97_bus_ops {445 struct snd_ac97_bus_ops { 451 446 void (*reset) (ac97_t *ac97); 452 447 void (*write) (ac97_t *ac97, unsigned short reg, unsigned short val); … … 456 451 }; 457 452 458 struct _snd_ac97_bus {453 struct snd_ac97_bus { 459 454 /* -- lowlevel (hardware) driver specific -- */ 460 455 ac97_bus_ops_t *ops; … … 477 472 }; 478 473 479 struct _snd_ac97_template {474 struct snd_ac97_template { 480 475 void *private_data; 481 476 void (*private_free) (ac97_t *ac97); … … 488 483 }; 489 484 490 struct _snd_ac97 {485 struct snd_ac97 { 491 486 /* -- lowlevel (hardware) driver specific -- */ 492 487 struct snd_ac97_build_ops * build_ops; -
GPL/trunk/alsa-kernel/include/sound/ainstr_simple.h
r33 r34 137 137 extern char *snd_seq_simple_id; 138 138 139 typedef struct {139 typedef struct snd_simple_ops { 140 140 void *private_data; 141 141 int (*info)(void *private_data, simple_instrument_info_t *info); -
GPL/trunk/alsa-kernel/include/sound/asound.h
r33 r34 55 55 #ifndef __bitwise 56 56 #define __bitwise 57 #endif 58 59 #ifdef TARGET_OS2 60 #define SNDRV_PCM_VOL_FRONT_LEFT 0 61 #define SNDRV_PCM_VOL_FRONT_RIGHT 1 62 #define SNDRV_PCM_VOL_REAR_LEFT 2 63 #define SNDRV_PCM_VOL_REAR_RIGHT 3 64 #define SNDRV_PCM_VOL_CENTER 4 65 #define SNDRV_PCM_VOL_LFE 5 66 67 #define SNDRV_PCM_VOL_MAX 100 68 69 struct snd_pcm_volume { 70 int nrchannels; 71 int volume[6]; 72 }; 57 73 #endif 58 74 … … 314 330 #define SNDRV_PCM_HW_PARAM_ACCESS ((__force snd_pcm_hw_param_t) 0) /* Access type */ 315 331 #define SNDRV_PCM_HW_PARAM_FORMAT ((__force snd_pcm_hw_param_t) 1) /* Format */ 316 #define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 2) /* Subformat */ 332 #ifdef TARGET_OS2 333 #define SNDRV_PCM_HW_PARAM_RATE_MASK ((__force snd_pcm_hw_param_t) 2) /* Format */ 334 #endif 335 #define SNDRV_PCM_HW_PARAM_SUBFORMAT ((__force snd_pcm_hw_param_t) 3) /* Subformat */ 317 336 #define SNDRV_PCM_HW_PARAM_FIRST_MASK SNDRV_PCM_HW_PARAM_ACCESS 318 337 #define SNDRV_PCM_HW_PARAM_LAST_MASK SNDRV_PCM_HW_PARAM_SUBFORMAT … … 856 875 SNDRV_CTL_IOCTL_RAWMIDI_PREFER_SUBDEVICE = _IOW('U', 0x42, int), 857 876 SNDRV_CTL_IOCTL_POWER = _IOWR('U', 0xd0, int), 858 SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), 877 SNDRV_CTL_IOCTL_POWER_STATE = _IOR('U', 0xd1, int), 878 #ifdef TARGET_OS2 879 SNDRV_PCM_IOCTL_SETVOLUME = _IOW('A', 0x62, struct snd_pcm_volume), 880 SNDRV_PCM_IOCTL_GETVOLUME = _IOR('A', 0x63, struct snd_pcm_volume), 881 #endif 882 859 883 }; 860 884 … … 916 940 }; 917 941 942 #define msleep(msecs) \ 943 do { \ 944 set_current_state(TASK_UNINTERRUPTIBLE); \ 945 schedule_timeout(((msecs) * HZ + 999) / 1000); \ 946 } while (0) 947 948 #define schedule_timeout_interruptible(x) \ 949 {set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(x);} 950 #define schedule_timeout_uninterruptible(x) {set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(x);} 951 918 952 #endif /* __SOUND_ASOUND_H */ -
GPL/trunk/alsa-kernel/include/sound/asoundef.h
r33 r34 186 186 #define MIDI_CTL_SUSTAIN 0x40 187 187 #define MIDI_CTL_PORTAMENTO 0x41 188 #define MIDI_CTL_S USTENUTO 0x42188 #define MIDI_CTL_SOSTENUTO 0x42 189 189 #define MIDI_CTL_SOFT_PEDAL 0x43 190 190 #define MIDI_CTL_LEGATO_FOOTSWITCH 0x44 -
GPL/trunk/alsa-kernel/include/sound/config.h
r33 r34 194 194 #endif 195 195 196 struct snd_minor { 197 struct list_head list; /* list of all minors per card */ 198 int number; /* minor number */ 199 int device; /* device number */ 200 const char *comment; /* for /proc/asound/devices */ 201 struct file_operations *f_ops; /* file operations */ 202 char name[1]; /* device name (keep at the end of 203 structure) */ 204 }; 205 206 /* misc.c */ 207 struct resource; 208 void release_and_free_resource(struct resource *res); 209 210 #include "typedefs.h" 211 196 212 #endif //__ALSA_CONFIG_H__ -
GPL/trunk/alsa-kernel/include/sound/cs46xx.h
r33 r34 29 29 #include "ac97_codec.h" 30 30 #include "cs46xx_dsp_spos.h" 31 32 #ifndef PCI_VENDOR_ID_CIRRUS33 #define PCI_VENDOR_ID_CIRRUS 0x101334 #endif35 #ifndef PCI_DEVICE_ID_CIRRUS_461036 #define PCI_DEVICE_ID_CIRRUS_4610 0x600137 #endif38 #ifndef PCI_DEVICE_ID_CIRRUS_461239 #define PCI_DEVICE_ID_CIRRUS_4612 0x600340 #endif41 #ifndef PCI_DEVICE_ID_CIRRUS_461542 #define PCI_DEVICE_ID_CIRRUS_4615 0x600443 #endif44 31 45 32 /* … … 1645 1632 #define CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT 2 1646 1633 1647 typedef struct _snd_cs46xx cs46xx_t; 1648 1649 typedef struct _snd_cs46xx_pcm_t { 1634 1635 struct snd_cs46xx_pcm { 1650 1636 struct snd_dma_buffer hw_buf; 1651 1637 1652 1638 unsigned int ctl; 1653 unsigned int shift; /* Shift count to trasform frames in bytes */1654 snd_pcm_indirect_t pcm_rec;1655 s nd_pcm_substream_t*substream;1656 1657 pcm_channel_descriptor_t* pcm_channel;1639 unsigned int shift; /* Shift count to trasform frames in bytes */ 1640 struct snd_pcm_indirect pcm_rec; 1641 struct snd_pcm_substream *substream; 1642 1643 struct dsp_pcm_channel_descriptor * pcm_channel; 1658 1644 1659 1645 int pcm_channel_id; /* Fron Rear, Center Lfe ... */ 1660 } cs46xx_pcm_t;1661 1662 typedef struct{1646 }; 1647 1648 struct snd_cs46xx_region { 1663 1649 char name[24]; 1664 unsigned long base;1665 void __iomem *remap_addr;1650 unsigned long base; 1651 void __iomem *remap_addr; 1666 1652 unsigned long size; 1667 1653 struct resource *resource; 1668 } snd_cs46xx_region_t;1669 1670 struct _snd_cs46xx {1654 }; 1655 1656 struct snd_cs46xx { 1671 1657 int irq; 1672 1658 unsigned long ba0_addr; … … 1674 1660 union { 1675 1661 struct { 1676 s nd_cs46xx_region_tba0;1677 s nd_cs46xx_region_tdata0;1678 s nd_cs46xx_region_tdata1;1679 s nd_cs46xx_region_tpmem;1680 s nd_cs46xx_region_treg;1662 struct snd_cs46xx_region ba0; 1663 struct snd_cs46xx_region data0; 1664 struct snd_cs46xx_region data1; 1665 struct snd_cs46xx_region pmem; 1666 struct snd_cs46xx_region reg; 1681 1667 } name; 1682 s nd_cs46xx_region_tidx[5];1668 struct snd_cs46xx_region idx[5]; 1683 1669 } region; 1684 1670 1685 1671 unsigned int mode; 1686 1672 1687 struct {1673 struct { 1688 1674 struct snd_dma_buffer hw_buf; 1689 1675 1690 1676 unsigned int ctl; 1691 unsigned int shift; /* Shift count to trasform frames in bytes */1692 snd_pcm_indirect_t pcm_rec;1693 s nd_pcm_substream_t*substream;1677 unsigned int shift; /* Shift count to trasform frames in bytes */ 1678 struct snd_pcm_indirect pcm_rec; 1679 struct snd_pcm_substream *substream; 1694 1680 } capt; 1695 1681 1696 1682 1697 1683 int nr_ac97_codecs; 1698 ac97_bus_t*ac97_bus;1699 ac97_t*ac97[MAX_NR_AC97];1684 struct snd_ac97_bus *ac97_bus; 1685 struct snd_ac97 *ac97[MAX_NR_AC97]; 1700 1686 1701 1687 struct pci_dev *pci; 1702 s nd_card_t*card;1703 s nd_pcm_t*pcm;1704 1705 s nd_rawmidi_t*rmidi;1706 s nd_rawmidi_substream_t*midi_input;1707 s nd_rawmidi_substream_t*midi_output;1688 struct snd_card *card; 1689 struct snd_pcm *pcm; 1690 1691 struct snd_rawmidi *rmidi; 1692 struct snd_rawmidi_substream *midi_input; 1693 struct snd_rawmidi_substream *midi_output; 1708 1694 1709 1695 spinlock_t reg_lock; … … 1712 1698 1713 1699 int amplifier; 1714 void (*amplifier_ctrl)(cs46xx_t *, int); 1715 void (*active_ctrl)(cs46xx_t *, int); 1716 void (*mixer_init)(cs46xx_t *); 1717 1718 struct pci_dev *acpi_dev; 1700 void (*amplifier_ctrl)(struct snd_cs46xx *, int); 1701 void (*active_ctrl)(struct snd_cs46xx *, int); 1702 void (*mixer_init)(struct snd_cs46xx *); 1703 1719 1704 int acpi_port; 1720 s nd_kcontrol_t*eapd_switch; /* for amplifier hack */1705 struct snd_kcontrol *eapd_switch; /* for amplifier hack */ 1721 1706 int accept_valid; /* accept mmap valid (for OSS) */ 1722 1707 1723 struct snd_cs46xx_gameport *gameport;1708 struct gameport *gameport; 1724 1709 1725 1710 #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO … … 1729 1714 struct semaphore spos_mutex; 1730 1715 1731 dsp_spos_instance_t* dsp_spos_instance;1732 1733 s nd_pcm_t*pcm_rear;1734 s nd_pcm_t*pcm_center_lfe;1735 s nd_pcm_t*pcm_iec958;1716 struct dsp_spos_instance * dsp_spos_instance; 1717 1718 struct snd_pcm *pcm_rear; 1719 struct snd_pcm *pcm_center_lfe; 1720 struct snd_pcm *pcm_iec958; 1736 1721 #else /* for compatibility */ 1737 cs46xx_pcm_t*playback_pcm;1722 struct snd_cs46xx_pcm *playback_pcm; 1738 1723 unsigned int play_ctl; 1739 1724 #endif 1740 1725 }; 1741 1726 1742 int snd_cs46xx_create(s nd_card_t*card,1727 int snd_cs46xx_create(struct snd_card *card, 1743 1728 struct pci_dev *pci, 1744 1729 int external_amp, int thinkpad, 1745 cs46xx_t **rcodec); 1746 1747 int snd_cs46xx_pcm(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1748 int snd_cs46xx_pcm_rear(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1749 int snd_cs46xx_pcm_iec958(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1750 int snd_cs46xx_pcm_center_lfe(cs46xx_t *chip, int device, snd_pcm_t **rpcm); 1751 int snd_cs46xx_mixer(cs46xx_t *chip); 1752 int snd_cs46xx_midi(cs46xx_t *chip, int device, snd_rawmidi_t **rmidi); 1753 int snd_cs46xx_start_dsp(cs46xx_t *chip); 1754 void snd_cs46xx_gameport(cs46xx_t *chip); 1730 struct snd_cs46xx **rcodec); 1731 int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state); 1732 int snd_cs46xx_resume(struct pci_dev *pci); 1733 1734 int snd_cs46xx_pcm(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); 1735 int snd_cs46xx_pcm_rear(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); 1736 int snd_cs46xx_pcm_iec958(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); 1737 int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pcm **rpcm); 1738 int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device); 1739 int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rmidi); 1740 int snd_cs46xx_start_dsp(struct snd_cs46xx *chip); 1741 int snd_cs46xx_gameport(struct snd_cs46xx *chip); 1742 1755 1743 #endif /* __SOUND_CS46XX_H */ -
GPL/trunk/alsa-kernel/include/sound/cs46xx_dsp_scb_types.h
r33 r34 28 28 #define __CS46XX_DSP_SCB_TYPES_H__ 29 29 30 #ifndef TARGET_OS2 31 #include <asm/byteorder.h> 30 //#include <asm/byteorder.h> 31 32 32 #ifndef ___DSP_DUAL_16BIT_ALLOC 33 33 #if defined(__LITTLE_ENDIAN) … … 39 39 #endif 40 40 #endif 41 #else // target_os242 #define ___DSP_DUAL_16BIT_ALLOC(a,b) u16 a; u16 b;43 #endif // target_os244 41 45 42 /* This structs are used internally by the SP */ 46 43 47 typedef struct _basic_dma_req_t{44 struct dsp_basic_dma_req { 48 45 /* DMA Requestor Word 0 (DCW) fields: 49 46 … … 57 54 u32 saw; /* Source Address Word */ 58 55 u32 daw; /* Destination Address Word */ 59 } basic_dma_req_t;60 61 typedef struct _scatter_gather_ext_t {56 }; 57 58 struct dsp_scatter_gather_ext { 62 59 u32 npaw; /* Next-Page Address Word */ 63 60 … … 73 70 u32 nplbaw; /* Next-Page after Loop-Begin Address Word */ 74 71 u32 sgaw; /* Scatter/Gather Address Word */ 75 } scatter_gather_ext_t;76 77 typedef struct _volume_control_t{72 }; 73 74 struct dsp_volume_control { 78 75 ___DSP_DUAL_16BIT_ALLOC( 79 76 rightTarg, /* Target volume for left & right channels */ … … 84 81 leftVol 85 82 ) 86 } volume_control_t;83 }; 87 84 88 85 /* Generic stream control block (SCB) structure definition */ 89 typedef struct _generic_scb_t{86 struct dsp_generic_scb { 90 87 /* For streaming I/O, the DSP should never alter any words in the DMA 91 88 requestor or the scatter/gather extension. Only ad hoc DMA request … … 103 100 /* Initialized by the host, only modified by DMA 104 101 R/O for the DSP task */ 105 basic_dma_req_tbasic_req; /* Optional */102 struct dsp_basic_dma_req basic_req; /* Optional */ 106 103 107 104 /* Scatter/gather DMA requestor extension (5 ints) … … 109 106 DSP task never needs to even read these. 110 107 */ 111 s catter_gather_ext_t sg_ext; /* Optional */108 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 112 109 113 110 /* Sublist pointer & next stream control block (SCB) link. … … 183 180 These two 32-bit words are redefined for wavetable & 3-D voices. 184 181 */ 185 volume_control_tvol_ctrl_t; /* Optional */186 } generic_scb_t;187 188 189 typedef struct _spos_control_block_t{182 struct dsp_volume_control vol_ctrl_t; /* Optional */ 183 }; 184 185 186 struct dsp_spos_control_block { 190 187 /* WARNING: Certain items in this structure are modified by the host 191 188 Any dword that can be modified by the host, must not be … … 277 274 u32 r32_save_for_trap; 278 275 u32 r32_save_for_HFG; 279 } spos_control_block_t;276 }; 280 277 281 278 /* SPB for MIX_TO_OSTREAM algorithm family */ 282 typedef struct _mix2_ostream_spb_t 279 struct dsp_mix2_ostream_spb 283 280 { 284 281 /* 16b.16b integer.frac approximation to the … … 294 291 */ 295 292 u32 accumOutTriplets; 296 } mix2_ostream_spb_t;293 }; 297 294 298 295 /* SCB for Timing master algorithm */ 299 typedef struct _timing_master_scb_t{296 struct dsp_timing_master_scb { 300 297 /* First 12 dwords from generic_scb_t */ 301 basic_dma_req_tbasic_req; /* Optional */302 s catter_gather_ext_t sg_ext; /* Optional */298 struct dsp_basic_dma_req basic_req; /* Optional */ 299 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 303 300 ___DSP_DUAL_16BIT_ALLOC( 304 301 next_scb, /* REQUIRED */ … … 362 359 (approximation must be floor, to insure */ 363 360 u32 nsamp_per_frm_q15; 364 } timing_master_scb_t;361 }; 365 362 366 363 /* SCB for CODEC output algorithm */ 367 typedef struct _codec_output_scb_t{364 struct dsp_codec_output_scb { 368 365 /* First 13 dwords from generic_scb_t */ 369 basic_dma_req_tbasic_req; /* Optional */370 s catter_gather_ext_t sg_ext; /* Optional */366 struct dsp_basic_dma_req basic_req; /* Optional */ 367 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 371 368 ___DSP_DUAL_16BIT_ALLOC( 372 369 next_scb, /* REQUIRED */ … … 426 423 last_sub_ptr 427 424 ) 428 } codec_output_scb_t;425 }; 429 426 430 427 /* SCB for CODEC input algorithm */ 431 typedef struct _codec_input_scb_t{428 struct dsp_codec_input_scb { 432 429 /* First 13 dwords from generic_scb_t */ 433 basic_dma_req_tbasic_req; /* Optional */434 s catter_gather_ext_t sg_ext; /* Optional */430 struct dsp_basic_dma_req basic_req; /* Optional */ 431 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 435 432 ___DSP_DUAL_16BIT_ALLOC( 436 433 next_scb, /* REQUIRED */ … … 483 480 484 481 u32 reserved2; 485 } codec_input_scb_t;486 487 488 typedef struct _pcm_serial_input_scb_t{482 }; 483 484 485 struct dsp_pcm_serial_input_scb { 489 486 /* First 13 dwords from generic_scb_t */ 490 basic_dma_req_tbasic_req; /* Optional */491 s catter_gather_ext_t sg_ext; /* Optional */487 struct dsp_basic_dma_req basic_req; /* Optional */ 488 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 492 489 ___DSP_DUAL_16BIT_ALLOC( 493 490 next_scb, /* REQUIRED */ … … 516 513 517 514 /* Initialized by the host (host updates target volumes) */ 518 volume_control_tpsi_vol_ctrl;519 520 } pcm_serial_input_scb_t;521 522 typedef struct _src_task_scb_t{515 struct dsp_volume_control psi_vol_ctrl; 516 517 }; 518 519 struct dsp_src_task_scb { 523 520 ___DSP_DUAL_16BIT_ALLOC( 524 521 frames_left_in_gof, … … 575 572 u32 phiIncr6int_26frac; 576 573 577 volume_control_tsrc_vol_ctrl;578 } src_task_scb_t;579 580 typedef struct _decimate_by_pow2_scb_t{574 struct dsp_volume_control src_vol_ctrl; 575 }; 576 577 struct dsp_decimate_by_pow2_scb { 581 578 /* decimationFactor = 2, 4, or 8 (larger factors waste too much memory 582 579 when compared to cascading decimators) … … 652 649 u32 dec2_reserved4; 653 650 654 volume_control_tdec2_vol_ctrl; /* Not used! */655 } decimate_by_pow2_scb_t;656 657 typedef struct _vari_decimate_scb_t{651 struct dsp_volume_control dec2_vol_ctrl; /* Not used! */ 652 }; 653 654 struct dsp_vari_decimate_scb { 658 655 ___DSP_DUAL_16BIT_ALLOC( 659 656 vdec_frames_left_in_gof, … … 715 712 u32 vdec_phi_incr_6int_26frac; 716 713 717 volume_control_tvdec_vol_ctrl;718 } vari_decimate_scb_t;714 struct dsp_volume_control vdec_vol_ctrl; 715 }; 719 716 720 717 721 718 /* SCB for MIX_TO_OSTREAM algorithm family */ 722 typedef struct _mix2_ostream_scb_t{719 struct dsp_mix2_ostream_scb { 723 720 /* First 13 dwords from generic_scb_t */ 724 basic_dma_req_tbasic_req; /* Optional */725 s catter_gather_ext_t sg_ext; /* Optional */721 struct dsp_basic_dma_req basic_req; /* Optional */ 722 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 726 723 ___DSP_DUAL_16BIT_ALLOC( 727 724 next_scb, /* REQUIRED */ … … 762 759 const_zero 763 760 ) 764 } mix2_ostream_scb_t;761 }; 765 762 766 763 767 764 /* SCB for S16_MIX algorithm */ 768 typedef struct _mix_only_scb_t{765 struct dsp_mix_only_scb { 769 766 /* First 13 dwords from generic_scb_t */ 770 basic_dma_req_tbasic_req; /* Optional */771 s catter_gather_ext_t sg_ext; /* Optional */767 struct dsp_basic_dma_req basic_req; /* Optional */ 768 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 772 769 ___DSP_DUAL_16BIT_ALLOC( 773 770 next_scb, /* REQUIRED */ … … 784 781 785 782 u32 reserved; 786 volume_control_tvol_ctrl;787 } mix_only_scb_t;783 struct dsp_volume_control vol_ctrl; 784 }; 788 785 789 786 /* SCB for the async. CODEC input algorithm */ 790 typedef struct _async_codec_input_scb_t { 787 struct dsp_async_codec_input_scb { 791 788 u32 io_free2; 792 789 … … 841 838 842 839 u32 i_free; 843 } async_codec_input_scb_t;840 }; 844 841 845 842 846 843 /* SCB for the SP/DIF CODEC input and output */ 847 typedef struct _spdifiscb_t{844 struct dsp_spdifiscb { 848 845 ___DSP_DUAL_16BIT_ALLOC( 849 846 status_ptr, … … 899 896 900 897 u32 free1; 901 } spdifiscb_t;898 }; 902 899 903 900 904 901 /* SCB for the SP/DIF CODEC input and output */ 905 typedef struct _spdifoscb_t { 906 902 struct dsp_spdifoscb { 907 903 908 904 u32 free2; … … 945 941 946 942 u32 free1; 947 } spdifoscb_t; 948 949 950 951 typedef struct _asynch_fg_rx_scb_t { 943 }; 944 945 946 struct dsp_asynch_fg_rx_scb { 952 947 ___DSP_DUAL_16BIT_ALLOC( 953 948 bot_buf_mask, … … 997 992 left_vol 998 993 ) 999 } asynch_fg_rx_scb_t; 1000 1001 1002 1003 typedef struct _asynch_fg_tx_scb_t { 994 }; 995 996 997 struct dsp_asynch_fg_tx_scb { 1004 998 ___DSP_DUAL_16BIT_ALLOC( 1005 999 not_buf_mask, … … 1056 1050 unused_left_vol 1057 1051 ) 1058 } asynch_fg_tx_scb_t;1059 1060 1061 typedef struct _output_snoop_scb_t{1052 }; 1053 1054 1055 struct dsp_output_snoop_scb { 1062 1056 /* First 13 dwords from generic_scb_t */ 1063 basic_dma_req_tbasic_req; /* Optional */1064 s catter_gather_ext_t sg_ext; /* Optional */1057 struct dsp_basic_dma_req basic_req; /* Optional */ 1058 struct dsp_scatter_gather_ext sg_ext; /* Optional */ 1065 1059 ___DSP_DUAL_16BIT_ALLOC( 1066 1060 next_scb, /* REQUIRED */ … … 1087 1081 input_scb 1088 1082 ) 1089 } output_snoop_scb_t;1090 1091 typedef struct _spio_write_scb_t{1083 }; 1084 1085 struct dsp_spio_write_scb { 1092 1086 ___DSP_DUAL_16BIT_ALLOC( 1093 1087 address1, … … 1126 1120 1127 1121 u32 unused3[5]; 1128 } spio_write_scb_t;1129 1130 typedef struct _magic_snoop_task_t{1122 }; 1123 1124 struct dsp_magic_snoop_task { 1131 1125 u32 i0; 1132 1126 u32 i1; … … 1159 1153 u32 i8; 1160 1154 1161 volume_control_tvdec_vol_ctrl;1162 } magic_snoop_task_t;1163 1164 1165 typedef struct _filter_scb_t{1155 struct dsp_volume_control vdec_vol_ctrl; 1156 }; 1157 1158 1159 struct dsp_filter_scb { 1166 1160 ___DSP_DUAL_16BIT_ALLOC( 1167 1161 a0_right, /* 0x00 */ … … 1216 1210 b2_left 1217 1211 ) 1218 } filter_scb_t;1212 }; 1219 1213 #endif /* __DSP_SCB_TYPES_H__ */ -
GPL/trunk/alsa-kernel/include/sound/cs46xx_dsp_spos.h
r33 r34 66 66 #define DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED 8 67 67 68 struct _dsp_module_desc_t; 69 70 typedef struct _symbol_entry_t { 68 struct dsp_symbol_entry { 71 69 u32 address; 72 70 char symbol_name[DSP_MAX_SYMBOL_NAME]; … … 74 72 75 73 /* initialized by driver */ 76 struct _dsp_module_desc_t* module;74 struct dsp_module_desc * module; 77 75 int deleted; 78 } symbol_entry_t;79 80 typedef struct _symbol_desc_t{76 }; 77 78 struct dsp_symbol_desc { 81 79 int nsymbols; 82 80 83 s ymbol_entry_t *symbols;81 struct dsp_symbol_entry *symbols; 84 82 85 83 /* initialized by driver */ 86 84 int highest_frag_index; 87 } symbol_desc_t; 88 89 90 typedef struct _segment_desc_t { 85 }; 86 87 struct dsp_segment_desc { 91 88 int segment_type; 92 89 u32 offset; 93 90 u32 size; 94 91 u32 * data; 95 } segment_desc_t;96 97 typedef struct _dsp_module_desc_t{92 }; 93 94 struct dsp_module_desc { 98 95 char * module_name; 99 s ymbol_desc_tsymbol_table;96 struct dsp_symbol_desc symbol_table; 100 97 int nsegments; 101 s egment_desc_t* segments;98 struct dsp_segment_desc * segments; 102 99 103 100 /* initialized by driver */ … … 105 102 u32 load_address; 106 103 int nfixups; 107 } dsp_module_desc_t;108 109 typedef struct _dsp_scb_descriptor_t{104 }; 105 106 struct dsp_scb_descriptor { 110 107 char scb_name[DSP_MAX_SCB_NAME]; 111 108 u32 address; 112 109 int index; 113 110 114 struct _dsp_scb_descriptor_t* sub_list_ptr;115 struct _dsp_scb_descriptor_t* next_scb_ptr;116 struct _dsp_scb_descriptor_t* parent_scb_ptr;117 118 s ymbol_entry_t* task_entry;119 s ymbol_entry_t* scb_symbol;120 121 s nd_info_entry_t*proc_info;111 struct dsp_scb_descriptor * sub_list_ptr; 112 struct dsp_scb_descriptor * next_scb_ptr; 113 struct dsp_scb_descriptor * parent_scb_ptr; 114 115 struct dsp_symbol_entry * task_entry; 116 struct dsp_symbol_entry * scb_symbol; 117 118 struct snd_info_entry *proc_info; 122 119 int ref_count; 123 120 spinlock_t lock; 124 121 125 122 int deleted; 126 } dsp_scb_descriptor_t;127 128 typedef struct _dsp_task_descriptor_t{123 }; 124 125 struct dsp_task_descriptor { 129 126 char task_name[DSP_MAX_TASK_NAME]; 130 127 int size; 131 128 u32 address; 132 129 int index; 133 } dsp_task_descriptor_t;134 135 typedef struct _pcm_channel_descriptor_t{130 }; 131 132 struct dsp_pcm_channel_descriptor { 136 133 int active; 137 134 int src_slot; … … 139 136 u32 sample_rate; 140 137 u32 unlinked; 141 dsp_scb_descriptor_t* pcm_reader_scb;142 dsp_scb_descriptor_t* src_scb;143 dsp_scb_descriptor_t* mixer_scb;138 struct dsp_scb_descriptor * pcm_reader_scb; 139 struct dsp_scb_descriptor * src_scb; 140 struct dsp_scb_descriptor * mixer_scb; 144 141 145 142 void * private_data; 146 } pcm_channel_descriptor_t;147 148 typedef struct _dsp_spos_instance_t{149 s ymbol_desc_tsymbol_table; /* currently availble loaded symbols in SP */143 }; 144 145 struct dsp_spos_instance { 146 struct dsp_symbol_desc symbol_table; /* currently availble loaded symbols in SP */ 150 147 151 148 int nmodules; 152 dsp_module_desc_t* modules; /* modules loaded into SP */153 154 s egment_desc_tcode;149 struct dsp_module_desc * modules; /* modules loaded into SP */ 150 151 struct dsp_segment_desc code; 155 152 156 153 /* Main PCM playback mixer */ 157 dsp_scb_descriptor_t* master_mix_scb;154 struct dsp_scb_descriptor * master_mix_scb; 158 155 u16 dac_volume_right; 159 156 u16 dac_volume_left; 160 157 161 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 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 164 int npcm_channels; 168 165 int nsrc_scb; 169 pcm_channel_descriptor_tpcm_channels[DSP_MAX_PCM_CHANNELS];166 struct dsp_pcm_channel_descriptor pcm_channels[DSP_MAX_PCM_CHANNELS]; 170 167 int src_scb_slots[DSP_MAX_SRC_NR]; 171 168 172 169 /* cache this symbols */ 173 s ymbol_entry_t* null_algorithm; /* used by PCMreaderSCB's */174 s ymbol_entry_t* s16_up; /* used by SRCtaskSCB's */170 struct dsp_symbol_entry * null_algorithm; /* used by PCMreaderSCB's */ 171 struct dsp_symbol_entry * s16_up; /* used by SRCtaskSCB's */ 175 172 176 173 /* proc fs */ 177 s nd_card_t *snd_card;178 s nd_info_entry_t* proc_dsp_dir;179 s nd_info_entry_t* proc_sym_info_entry;180 s nd_info_entry_t* proc_modules_info_entry;181 s nd_info_entry_t* proc_parameter_dump_info_entry;182 s nd_info_entry_t* proc_sample_dump_info_entry;174 struct snd_card *snd_card; 175 struct snd_info_entry * proc_dsp_dir; 176 struct snd_info_entry * proc_sym_info_entry; 177 struct snd_info_entry * proc_modules_info_entry; 178 struct snd_info_entry * proc_parameter_dump_info_entry; 179 struct snd_info_entry * proc_sample_dump_info_entry; 183 180 184 181 /* SCB's descriptors */ 185 182 int nscb; 186 183 int scb_highest_frag_index; 187 dsp_scb_descriptor_tscbs[DSP_MAX_SCB_DESC];188 s nd_info_entry_t* proc_scb_info_entry;189 dsp_scb_descriptor_t* the_null_scb;184 struct dsp_scb_descriptor scbs[DSP_MAX_SCB_DESC]; 185 struct snd_info_entry * proc_scb_info_entry; 186 struct dsp_scb_descriptor * the_null_scb; 190 187 191 188 /* Task's descriptors */ 192 189 int ntask; 193 dsp_task_descriptor_ttasks[DSP_MAX_TASK_DESC];194 s nd_info_entry_t* proc_task_info_entry;190 struct dsp_task_descriptor tasks[DSP_MAX_TASK_DESC]; 191 struct snd_info_entry * proc_task_info_entry; 195 192 196 193 /* SPDIF status */ … … 205 202 206 203 /* SPDIF input sample rate converter */ 207 dsp_scb_descriptor_t* spdif_in_src;204 struct dsp_scb_descriptor * spdif_in_src; 208 205 /* SPDIF input asynch. receiver */ 209 dsp_scb_descriptor_t* asynch_rx_scb;206 struct dsp_scb_descriptor * asynch_rx_scb; 210 207 211 208 /* Capture record mixer SCB */ 212 dsp_scb_descriptor_t* record_mixer_scb;209 struct dsp_scb_descriptor * record_mixer_scb; 213 210 214 211 /* CODEC input SCB */ 215 dsp_scb_descriptor_t* codec_in_scb;212 struct dsp_scb_descriptor * codec_in_scb; 216 213 217 214 /* reference snooper */ 218 dsp_scb_descriptor_t* ref_snoop_scb;215 struct dsp_scb_descriptor * ref_snoop_scb; 219 216 220 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 220 /* asynch TX task */ 224 dsp_scb_descriptor_t* asynch_tx_scb;221 struct dsp_scb_descriptor * asynch_tx_scb; 225 222 226 223 /* record sources */ 227 dsp_scb_descriptor_t* pcm_input;228 dsp_scb_descriptor_t* adc_input;224 struct dsp_scb_descriptor * pcm_input; 225 struct dsp_scb_descriptor * adc_input; 229 226 230 227 int spdif_in_sample_rate; 231 } dsp_spos_instance_t;228 }; 232 229 233 230 #endif /* __DSP_SPOS_H__ */ -
GPL/trunk/alsa-kernel/include/sound/cs46xx_dsp_task_types.h
r33 r34 72 72 73 73 /* Minimal context save area for Hyper Forground */ 74 typedef struct _hf_save_area_t{74 struct dsp_hf_save_area { 75 75 u32 r10_save; 76 76 u32 r54_save; … … 97 97 ) 98 98 /* saved as part of HFG context */ 99 } hf_save_area_t;99 }; 100 100 101 101 102 102 /* Task link data structure */ 103 typedef struct _tree_link_t{103 struct dsp_tree_link { 104 104 ___DSP_DUAL_16BIT_ALLOC( 105 105 /* Pointer to sibling task control block */ … … 115 115 this_spb 116 116 ) 117 } tree_link_t;118 119 120 typedef struct _task_tree_data_t{117 }; 118 119 120 struct dsp_task_tree_data { 121 121 ___DSP_DUAL_16BIT_ALLOC( 122 122 /* Initial tock count; controls task tree execution rate */ … … 156 156 ) 157 157 158 } task_tree_data_t; 159 160 161 162 typedef struct _interval_timer_data_t 158 }; 159 160 161 struct dsp_interval_timer_data 163 162 { 164 163 /* These data items have the same relative locations to those */ … … 173 172 num_intervals 174 173 ) 175 } interval_timer_data_t;174 }; 176 175 177 176 178 177 /* This structure contains extra storage for the task tree 179 178 Currently, this additional data is related only to a full context save */ 180 typedef struct _task_tree_context_block_t{179 struct dsp_task_tree_context_block { 181 180 /* Up to 10 values are saved onto the stack. 8 for the task tree, 1 for 182 181 The access to the context switch (call or interrupt), and 1 spare that … … 239 238 u32 savershouthl; 240 239 u32 savershoutxmacmode; 241 } task_tree_context_block_t;240 }; 242 241 243 242 244 typedef struct _task_tree_control_block_t{245 hf_save_area_tcontext;246 tree_link_tlinks;247 task_tree_data_tdata;248 task_tree_context_block_tcontext_blk;249 interval_timer_data_tint_timer;250 } task_tree_control_block_t;243 struct dsp_task_tree_control_block { 244 struct dsp_hf_save_area context; 245 struct dsp_tree_link links; 246 struct dsp_task_tree_data data; 247 struct dsp_task_tree_context_block context_blk; 248 struct dsp_interval_timer_data int_timer; 249 }; 251 250 252 251 -
GPL/trunk/alsa-kernel/include/sound/driver.h
r33 r34 67 67 #include <linux/version.h> 68 68 69 #define IRQ_NONE /*void*/70 #define IRQ_HANDLED /*void*/71 #define IRQ_RETVAL(x) /*void*/72 typedef voidirqreturn_t;69 #define IRQ_NONE (0) /*void*/ 70 #define IRQ_HANDLED (1) /*void*/ 71 #define IRQ_RETVAL(x) ((x) != 0) /*void*/ 72 typedef int irqreturn_t; 73 73 74 74 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 3) … … 191 191 #include <sound/asound.h> 192 192 #include <sound/asoundef.h> 193 194 /* wrapper for getnstimeofday() 195 * it's needed for recent 2.6 kernels, too, due to lack of EXPORT_SYMBOL 196 */ 197 #define getnstimeofday(x) do { \ 198 struct timeval __x; \ 199 do_gettimeofday(&__x); \ 200 (x)->tv_sec = __x.tv_sec; \ 201 (x)->tv_nsec = __x.tv_usec * 1000; \ 202 } while (0) 193 203 194 204 struct work_struct { … … 218 228 /* Name change */ 219 229 typedef struct timeval snd_timestamp_t; 220 typedef struct sndrv_interval snd_interval_t;221 230 #ifndef TARGET_OS2 222 231 typedef enum sndrv_card_type snd_card_type; 223 232 #endif 224 typedef struct sndrv_aes_iec958 snd_aes_iec958_t;225 //typedef enum sndrv_hwdep_iface snd_hwdep_iface_t;226 typedef struct sndrv_hwdep_info snd_hwdep_info_t;227 //typedef enum sndrv_pcm_class snd_pcm_class_t;228 //typedef enum sndrv_pcm_subclass snd_pcm_subclass_t;229 //typedef enum sndrv_pcm_stream snd_pcm_stream_t;230 //typedef enum sndrv_pcm_access snd_pcm_access_t;231 //typedef enum sndrv_pcm_format snd_pcm_format_t;232 //typedef enum sndrv_pcm_subformat snd_pcm_subformat_t;233 //typedef enum sndrv_pcm_state snd_pcm_state_t;234 233 typedef union sndrv_pcm_sync_id snd_pcm_sync_id_t; 235 typedef struct sndrv_pcm_info snd_pcm_info_t;236 //typedef enum sndrv_pcm_hw_param snd_pcm_hw_param_t;237 typedef struct sndrv_pcm_hw_params snd_pcm_hw_params_t;238 234 #ifndef TARGET_OS2 239 235 typedef enum sndrv_pcm_start snd_pcm_start_t; 240 236 typedef enum sndrv_pcm_xrun snd_pcm_xrun_t; 241 237 #endif 242 //typedef enum sndrv_pcm_tstamp snd_pcm_tstamp_t;243 typedef struct sndrv_pcm_sw_params snd_pcm_sw_params_t;244 typedef struct sndrv_pcm_channel_info snd_pcm_channel_info_t;245 typedef struct sndrv_pcm_status snd_pcm_status_t;246 typedef struct sndrv_pcm_mmap_status snd_pcm_mmap_status_t;247 typedef struct sndrv_pcm_mmap_control snd_pcm_mmap_control_t;248 typedef struct sndrv_xferi snd_xferi_t;249 typedef struct sndrv_xfern snd_xfern_t;250 //typedef enum sndrv_rawmidi_stream snd_rawmidi_stream_t;251 typedef struct sndrv_rawmidi_info snd_rawmidi_info_t;252 typedef struct sndrv_rawmidi_params snd_rawmidi_params_t;253 typedef struct sndrv_rawmidi_status snd_rawmidi_status_t;254 //typedef enum sndrv_timer_class snd_timer_class_t;255 //typedef enum sndrv_timer_slave_class snd_timer_slave_class_t;256 238 #ifdef TARGET_OS2 257 239 typedef struct snd_pcm_volume snd_pcm_volume_t; … … 259 241 typedef enum sndrv_timer_global snd_timer_global_t; 260 242 #endif 261 typedef struct sndrv_timer_id snd_timer_id_t;262 typedef struct sndrv_timer_select snd_timer_select_t;263 typedef struct sndrv_timer_info snd_timer_info_t;264 typedef struct sndrv_timer_params snd_timer_params_t;265 typedef struct sndrv_timer_status snd_timer_status_t;266 typedef struct sndrv_timer_read snd_timer_read_t;267 typedef struct sndrv_timer_tread snd_timer_tread_t;268 typedef struct sndrv_timer_ginfo snd_timer_ginfo_t;269 typedef struct sndrv_timer_gparams snd_timer_gparams_t;270 typedef struct sndrv_timer_gstatus snd_timer_gstatus_t;271 typedef struct sndrv_xferv snd_xferv_t;272 243 273 244 #ifdef CONFIG_SND_DEBUG_MEMORY … … 378 349 }; 379 350 380 #define snd_device(n) list_entry(n, s nd_device_t, list)351 #define snd_device(n) list_entry(n, struct snd_device, list) 381 352 382 353 /* various typedefs */ 383 354 384 355 typedef struct snd_info_entry snd_info_entry_t; 385 typedef struct _snd_pcm snd_pcm_t;386 typedef struct _snd_pcm_str snd_pcm_str_t;387 typedef struct _snd_pcm_substream snd_pcm_substream_t;388 typedef struct _snd_mixer snd_kmixer_t;389 typedef struct _snd_rawmidi snd_rawmidi_t;390 typedef struct _snd_ctl_file snd_ctl_file_t;391 typedef struct _snd_kcontrol snd_kcontrol_t;392 typedef struct _snd_timer snd_timer_t;393 typedef struct _snd_timer_instance snd_timer_instance_t;394 typedef struct _snd_hwdep snd_hwdep_t;395 356 #ifdef CONFIG_SND_OSSEMUL 396 357 typedef struct _snd_oss_mixer snd_mixer_oss_t; … … 519 480 }; 520 481 521 typedef struct _snd_minor snd_minor_t;522 523 482 /* sound.c */ 524 483 -
GPL/trunk/alsa-kernel/include/sound/emu10k1.h
r33 r34 26 26 #ifdef __KERNEL__ 27 27 28 #include "pcm.h"29 #include "rawmidi.h"30 #include "hwdep.h"31 #include "ac97_codec.h"32 #include "util_mem.h"28 #include <sound/pcm.h> 29 #include <sound/rawmidi.h> 30 #include <sound/hwdep.h> 31 #include <sound/ac97_codec.h> 32 #include <sound/util_mem.h> 33 33 #include <sound/pcm-indirect.h> 34 #include <sound/timer.h> 35 #include <linux/interrupt.h> 34 36 #include <asm/io.h> 35 #include <sound/timer.h>36 37 #ifndef PCI_VENDOR_ID_CREATIVE38 #define PCI_VENDOR_ID_CREATIVE 0x110239 #endif40 #ifndef PCI_DEVICE_ID_CREATIVE_EMU10K141 #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x000242 #endif43 37 44 38 /* ------------------- DEFINES -------------------- */ … … 51 45 #define NUM_G 64 /* use all channels */ 52 46 #define NUM_FXSENDS 4 53 //#define NUM_EFX_PLAYBACK 16 54 #define NUM_EFX_PLAYBACK 6 47 #define NUM_EFX_PLAYBACK 16 55 48 56 49 /* FIXME? - according to the OSS driver the EMU10K1 needs a 29 bit DMA mask */ 57 50 #define EMU10K1_DMA_MASK 0x7fffffffUL /* 31bit */ 58 #define AUDIGY_DMA_MASK 0x ffffffffUL /* 32bit*/59 51 #define AUDIGY_DMA_MASK 0x7fffffffUL /* 31bit FIXME - 32 should work? */ 52 /* See ALSA bug #1276 - rlrevell */ 60 53 61 54 #define TMEMSIZE 256*1024 … … 85 78 /* Clear pending interrupts by writing a 1 to */ 86 79 /* the relevant bits and zero to the other bits */ 87 88 #define IPR_P16V 0x80000000 /* Bit set when the CA0151 P16V chip wishes to interrupt */ 89 #define IPR_GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure which INTE bits enable it) */ 80 #define IPR_P16V 0x80000000 /* Bit set when the CA0151 P16V chip wishes 81 to interrupt */ 82 #define IPR_GPIOMSG 0x20000000 /* GPIO message interrupt (RE'd, still not sure 83 which INTE bits enable it) */ 90 84 91 85 /* The next two interrupts are for the midi port on the Audigy Drive (A_MPU1) */ … … 93 87 #define IPR_A_MIDIRECVBUFEMPTY2 0x08000000 /* MIDI UART receive buffer empty */ 94 88 95 #define IPR_SPDIFBUFFULL 0x04000000 /* SPDIF capture related, 10k2 only? (RE) */ 96 #define IPR_SPDIFBUFHALFFULL 0x02000000 /* SPDIF capture related? (RE) */ 89 #define IPR_SPDIFBUFFULL 0x04000000 /* SPDIF capture related, 10k2 only? (RE) */ 90 #define IPR_SPDIFBUFHALFFULL 0x02000000 /* SPDIF capture related? (RE) */ 91 97 92 #define IPR_SAMPLERATETRACKER 0x01000000 /* Sample rate tracker lock status change */ 98 93 #define IPR_FXDSP 0x00800000 /* Enable FX DSP interrupts */ … … 113 108 #define IPR_MIDITRANSBUFEMPTY 0x00000100 /* MIDI UART transmit buffer empty */ 114 109 #define IPR_MIDIRECVBUFEMPTY 0x00000080 /* MIDI UART receive buffer empty */ 115 #define IPR_CHANNELLOOP 0x00000040 /* Channel (half) loop interrupt(s) pending*/110 #define IPR_CHANNELLOOP 0x00000040 /* Channel (half) loop interrupt(s) pending */ 116 111 #define IPR_CHANNELNUMBERMASK 0x0000003f /* When IPR_CHANNELLOOP is set, indicates the */ 117 /* Highest set channel in CLIPL or CLIPH. When*/118 /* IP is written with CL set, the bit in CLIPL*/119 /* or CLIPH corresponding to the CIN value*/120 /* written will be cleared.*/112 /* highest set channel in CLIPL, CLIPH, HLIPL, */ 113 /* or HLIPH. When IP is written with CL set, */ 114 /* the bit in H/CLIPL or H/CLIPH corresponding */ 115 /* to the CIN value written will be cleared. */ 121 116 122 117 #define INTE 0x0c /* Interrupt enable register */ … … 245 240 #define A_GPINPUT_MASK 0xff00 246 241 #define A_GPOUTPUT_MASK 0x00ff 242 247 243 // Audigy output/GPIO stuff taken from the kX drivers 248 #define A_IOCFG_GPOUT0 0x0044 /* analog/digital*/249 #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4)*/250 #define A_IOCFG_ENABLE_DIGITAL 0x0004244 #define A_IOCFG_GPOUT0 0x0044 /* analog/digital */ 245 #define A_IOCFG_DISABLE_ANALOG 0x0040 /* = 'enable' for Audigy2 (chiprev=4) */ 246 #define A_IOCFG_ENABLE_DIGITAL 0x0004 251 247 #define A_IOCFG_UNKNOWN_20 0x0020 252 #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */253 #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?)*/248 #define A_IOCFG_DISABLE_AC97_FRONT 0x0080 /* turn off ac97 front -> front (10k2.1) */ 249 #define A_IOCFG_GPOUT1 0x0002 /* IR? drive's internal bypass (?) */ 254 250 #define A_IOCFG_GPOUT2 0x0001 /* IR */ 255 256 #define A_IOCFG_MULTIPURPOSE_JACK 0x2000 /* center+lfe+rear_center (a2/a2ex) */ 257 /* + digital for generic 10k2 */ 258 #define A_IOCFG_DIGITAL_JACK 0x1000 /* digital for a2 platinum */ 251 #define A_IOCFG_MULTIPURPOSE_JACK 0x2000 /* center+lfe+rear_center (a2/a2ex) */ 252 /* + digital for generic 10k2 */ 253 #define A_IOCFG_DIGITAL_JACK 0x1000 /* digital for a2 platinum */ 259 254 #define A_IOCFG_FRONT_JACK 0x4000 260 255 #define A_IOCFG_REAR_JACK 0x8000 261 #define A_IOCFG_PHONES_JACK 0x0100 /* LiveDrive */256 #define A_IOCFG_PHONES_JACK 0x0100 /* LiveDrive */ 262 257 263 258 /* outputs: 264 * for audigy2 platinum:0xa00265 * for a2 platinum ex:0x1c00266 * for a1 platinum:0x0259 * for audigy2 platinum: 0xa00 260 * for a2 platinum ex: 0x1c00 261 * for a1 platinum: 0x0 267 262 */ 263 268 264 #define TIMER 0x1a /* Timer terminal count register */ 269 265 /* NOTE: After the rate is changed, a maximum */ … … 281 277 282 278 /* Available on the Audigy 2 and Audigy 4 only. This is the P16V chip. */ 283 #define PTR2 0x20 /* Indexed register set pointer register*/284 #define DATA2 0x24 /* Indexed register set data register*/285 #define IPR2 0x28 /* P16V interrupt pending register*/279 #define PTR2 0x20 /* Indexed register set pointer register */ 280 #define DATA2 0x24 /* Indexed register set data register */ 281 #define IPR2 0x28 /* P16V interrupt pending register */ 286 282 #define IPR2_PLAYBACK_CH_0_LOOP 0x00001000 /* Playback Channel 0 loop */ 287 283 #define IPR2_PLAYBACK_CH_0_HALF_LOOP 0x00000100 /* Playback Channel 0 half loop */ 288 284 #define IPR2_CAPTURE_CH_0_LOOP 0x00100000 /* Capture Channel 0 loop */ 289 285 #define IPR2_CAPTURE_CH_0_HALF_LOOP 0x00010000 /* Capture Channel 0 half loop */ 290 /* 0x00000100 Playback. Only in once per period.291 * 0x00110000 Capture. Int on half buffer.292 */293 #define INTE2 0x2c /* P16V Interrupt enable register.*/286 /* 0x00000100 Playback. Only in once per period. 287 * 0x00110000 Capture. Int on half buffer. 288 */ 289 #define INTE2 0x2c /* P16V Interrupt enable register. */ 294 290 #define INTE2_PLAYBACK_CH_0_LOOP 0x00001000 /* Playback Channel 0 loop */ 295 291 #define INTE2_PLAYBACK_CH_0_HALF_LOOP 0x00000100 /* Playback Channel 0 half loop */ … … 302 298 #define INTE2_CAPTURE_CH_0_LOOP 0x00100000 /* Capture Channel 0 loop */ 303 299 #define INTE2_CAPTURE_CH_0_HALF_LOOP 0x00010000 /* Caputre Channel 0 half loop */ 304 #define HCFG2 0x34/* Defaults: 0, win2000 sets it to 00004201 */305 /* 0x00000000 2-channel output. */306 /* 0x00000200 8-channel output. */307 /* 0x00000004 pauses stream/irq fail. */308 /* Rest of bits no nothing to sound output */309 /* bit 0: Enable P16V audio.310 * bit 1: Lock P16V record memory cache.311 * bit 2: Lock P16V playback memory cache.312 * bit 3: Dummy record insert zero samples.313 * bit 8: Record 8-channel in phase.314 * bit 9: Playback 8-channel in phase.315 * bit 11-12: Playback mixer attenuation: 0=0dB, 1=-6dB, 2=-12dB, 3=Mute.316 * bit 13: Playback mixer enable.317 * bit 14: Route SRC48 mixer output to fx engine.318 * bit 15: Enable IEEE 1394 chip.319 */320 #define IPR3 0x38 /* Cdif interrupt pending register*/321 #define INTE3 0x3c /* Cdif interrupt enable register.*/300 #define HCFG2 0x34 /* Defaults: 0, win2000 sets it to 00004201 */ 301 /* 0x00000000 2-channel output. */ 302 /* 0x00000200 8-channel output. */ 303 /* 0x00000004 pauses stream/irq fail. */ 304 /* Rest of bits no nothing to sound output */ 305 /* bit 0: Enable P16V audio. 306 * bit 1: Lock P16V record memory cache. 307 * bit 2: Lock P16V playback memory cache. 308 * bit 3: Dummy record insert zero samples. 309 * bit 8: Record 8-channel in phase. 310 * bit 9: Playback 8-channel in phase. 311 * bit 11-12: Playback mixer attenuation: 0=0dB, 1=-6dB, 2=-12dB, 3=Mute. 312 * bit 13: Playback mixer enable. 313 * bit 14: Route SRC48 mixer output to fx engine. 314 * bit 15: Enable IEEE 1394 chip. 315 */ 316 #define IPR3 0x38 /* Cdif interrupt pending register */ 317 #define INTE3 0x3c /* Cdif interrupt enable register. */ 322 318 /************************************************************************************************/ 323 319 /* PCI function 1 registers, address = <val> + PCIBASE1 */ … … 443 439 444 440 #define ENVVOL 0x10 /* Volume envelope register */ 445 #define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ 441 #define ENVVOL_MASK 0x0000ffff /* Current value of volume envelope state variable */ 446 442 /* 0x8000-n == 666*n usec delay */ 447 443 … … 529 525 /* NOTE: All channels contain internal variables; do */ 530 526 /* not write to these locations. */ 527 531 528 /* 1f something */ 529 532 530 #define CD0 0x20 /* Cache data 0 register */ 533 531 #define CD1 0x21 /* Cache data 1 register */ … … 579 577 #define FXWC 0x43 /* FX output write channels register */ 580 578 /* When set, each bit enables the writing of the */ 581 /* corresponding FX output channel into host memory */ 579 /* corresponding FX output channel (internal registers */ 580 /* 0x20-0x3f) to host memory. This mode of recording */ 581 /* is 16bit, 48KHz only. All 32 channels can be enabled */ 582 /* simultaneously. */ 583 582 584 #define FXWC_DEFAULTROUTE_C (1<<0) /* left emu out? */ 583 585 #define FXWC_DEFAULTROUTE_B (1<<1) /* right emu out? */ … … 613 615 #define FXBA 0x47 /* FX Buffer Address */ 614 616 #define FXBA_MASK 0xfffff000 /* 20 bit base address */ 615 /* 0x48 something - word access, defaults to 3f */ 617 618 /* 0x48 something - word access, defaults to 3f */ 619 616 620 #define MICBS 0x49 /* Microphone buffer size register */ 617 621 … … 717 721 718 722 #define SPBYPASS 0x5e /* SPDIF BYPASS mode register */ 719 #define SPBYPASS_SPDIF0_MASK 0x00000003 /* SPDIF 0 bypass mode */ 720 #define SPBYPASS_SPDIF1_MASK 0x0000000c /* SPDIF 1 bypass mode */ 721 /* bypass mode: 0 - DSP; 1 - SPDIF A, 2 - SPDIF B, 3 - SPDIF C */ 722 #define SPBYPASS_FORMAT 0x00000f00 /* If 1, SPDIF XX uses 24 bit, if 0 - 20 bit */ 723 #define SPBYPASS_SPDIF0_MASK 0x00000003 /* SPDIF 0 bypass mode */ 724 #define SPBYPASS_SPDIF1_MASK 0x0000000c /* SPDIF 1 bypass mode */ 725 /* bypass mode: 0 - DSP; 1 - SPDIF A, 2 - SPDIF B, 3 - SPDIF C */ 726 #define SPBYPASS_FORMAT 0x00000f00 /* If 1, SPDIF XX uses 24 bit, if 0 - 20 bit */ 727 723 728 #define AC97SLOT 0x5f /* additional AC97 slots enable bits */ 724 #define AC97SLOT_REAR_RIGHT 0x01/* Rear left */725 #define AC97SLOT_REAR_LEFT 0x02/* Rear right */729 #define AC97SLOT_REAR_RIGHT 0x01 /* Rear left */ 730 #define AC97SLOT_REAR_LEFT 0x02 /* Rear right */ 726 731 #define AC97SLOT_CNTR 0x10 /* Center enable */ 727 732 #define AC97SLOT_LFE 0x20 /* LFE enable */ … … 737 742 738 743 /* These three bitfields apply to CDSRCS, GPSRCS, and (except as noted) ZVSRCS. */ 739 #define SRCS_SPDIFVALID 0x04000000 /* SPDIF stream valid*/744 #define SRCS_SPDIFVALID 0x04000000 /* SPDIF stream valid */ 740 745 #define SRCS_SPDIFLOCKED 0x02000000 /* SPDIF stream locked */ 741 746 #define SRCS_RATELOCKED 0x01000000 /* Sample rate locked */ … … 765 770 #define FXIDX_IDX 0x10000065 766 771 767 /* The 32-bit HLIx and HLIPx registers all have one bit per channel control/status */768 #define HLIEL 0x66 /* Channel half loop interrupt enable low register*/769 770 #define HLIEH 0x67 /* Channel half loop interrupt enable high register*/771 772 #define HLIPL 0x68 /* Channel half loop interrupt pending low register*/773 774 #define HLIPH 0x69 /* Channel half loop interrupt pending high register*/772 /* The 32-bit HLIx and HLIPx registers all have one bit per channel control/status */ 773 #define HLIEL 0x66 /* Channel half loop interrupt enable low register */ 774 775 #define HLIEH 0x67 /* Channel half loop interrupt enable high register */ 776 777 #define HLIPL 0x68 /* Channel half loop interrupt pending low register */ 778 779 #define HLIPH 0x69 /* Channel half loop interrupt pending high register */ 775 780 776 781 // 0x6a,6b,6c used for some recording … … 786 791 #define A_MUDATA2 0x72 787 792 #define A_MUCMD2 0x73 788 #define A_MUSTAT2 A_MUCMD2 793 #define A_MUSTAT2 A_MUCMD2 789 794 790 795 /* The next two are the Audigy equivalent of FXWC */ … … 795 800 796 801 #define A_SPDIF_SAMPLERATE 0x76 /* Set the sample rate of SPDIF output */ 797 #define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */ 798 #define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */ 799 #define A_SAMPLE_RATE_UNKNOWN 0xf0030001 /* Bits that can be set, but have unknown use. */ 800 #define A_SPDIF_RATE_MASK 0x000000e0 /* Any other values for rates, just use 48000 */ 801 #define A_SPDIF_48000 0x00000000 802 #define A_SPDIF_192000 0x00000020 803 #define A_SPDIF_96000 0x00000040 804 #define A_SPDIF_44100 0x00000080 805 806 #define A_I2S_CAPTURE_RATE_MASK 0x00000e00 /* This sets the capture PCM rate, but it is */ 807 #define A_I2S_CAPTURE_48000 0x00000000 /* unclear if this sets the ADC rate as well. */ 808 #define A_I2S_CAPTURE_192000 0x00000200 809 #define A_I2S_CAPTURE_96000 0x00000400 810 #define A_I2S_CAPTURE_44100 0x00000800 811 812 #define A_PCM_RATE_MASK 0x0000e000 /* This sets the playback PCM rate on the P16V */ 813 #define A_PCM_48000 0x00000000 814 #define A_PCM_192000 0x00002000 815 #define A_PCM_96000 0x00004000 816 #define A_PCM_44100 0x00008000 817 /* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */ 802 #define A_SAMPLE_RATE 0x76 /* Various sample rate settings. */ 803 #define A_SAMPLE_RATE_NOT_USED 0x0ffc111e /* Bits that are not used and cannot be set. */ 804 #define A_SAMPLE_RATE_UNKNOWN 0xf0030001 /* Bits that can be set, but have unknown use. */ 805 #define A_SPDIF_RATE_MASK 0x000000e0 /* Any other values for rates, just use 48000 */ 806 #define A_SPDIF_48000 0x00000000 807 #define A_SPDIF_192000 0x00000020 808 #define A_SPDIF_96000 0x00000040 809 #define A_SPDIF_44100 0x00000080 810 811 #define A_I2S_CAPTURE_RATE_MASK 0x00000e00 /* This sets the capture PCM rate, but it is */ 812 #define A_I2S_CAPTURE_48000 0x00000000 /* unclear if this sets the ADC rate as well. */ 813 #define A_I2S_CAPTURE_192000 0x00000200 814 #define A_I2S_CAPTURE_96000 0x00000400 815 #define A_I2S_CAPTURE_44100 0x00000800 816 817 #define A_PCM_RATE_MASK 0x0000e000 /* This sets the playback PCM rate on the P16V */ 818 #define A_PCM_48000 0x00000000 819 #define A_PCM_192000 0x00002000 820 #define A_PCM_96000 0x00004000 821 #define A_PCM_44100 0x00008000 822 823 /* 0x77,0x78,0x79 "something i2s-related" - default to 0x01080000 on my audigy 2 ZS --rlrevell */ 818 824 /* 0x7a, 0x7b - lookup tables */ 819 825 … … 830 836 #define A_FXSENDAMOUNT_H_MASK 0x000000FF 831 837 /* 0x7c, 0x7e "high bit is used for filtering" */ 838 832 839 /* The send amounts for this one are the same as used with the emu10k1 */ 833 840 #define A_FXRT1 0x7e … … 842 849 #define A_FXGPREGBASE 0x400 /* Audigy GPRs, 0x400 to 0x5ff */ 843 850 844 #define A_TANKMEMCTLREGBASE 0x100/* Tank memory control registers base - only for Audigy */845 #define A_TANKMEMCTLREG_MASK 0x1f/* only 5 bits used - only for Audigy */851 #define A_TANKMEMCTLREGBASE 0x100 /* Tank memory control registers base - only for Audigy */ 852 #define A_TANKMEMCTLREG_MASK 0x1f /* only 5 bits used - only for Audigy */ 846 853 847 854 /* Tank audio data is logarithmically compressed down to 16 bits before writing to TRAM and is */ … … 881 888 /* ------------------- STRUCTURES -------------------- */ 882 889 883 typedef struct _snd_emu10k1 emu10k1_t; 884 typedef struct _snd_emu10k1_voice emu10k1_voice_t; 885 typedef struct _snd_emu10k1_pcm emu10k1_pcm_t; 886 887 typedef enum { 888 EMU10K1_EFX, 889 EMU10K1_PCM, 890 EMU10K1_SYNTH, 891 EMU10K1_MIDI 892 } emu10k1_voice_type_t; 893 894 struct _snd_emu10k1_voice { 895 emu10k1_t *emu; 890 enum { 891 EMU10K1_EFX, 892 EMU10K1_PCM, 893 EMU10K1_SYNTH, 894 EMU10K1_MIDI 895 }; 896 897 struct snd_emu10k1; 898 899 struct snd_emu10k1_voice { 900 struct snd_emu10k1 *emu; 896 901 int number; 897 int use: 1,898 pcm: 1,899 efx: 1,900 synth: 1,901 midi: 1;902 void (*interrupt)(emu10k1_t *emu, emu10k1_voice_t*pvoice);903 904 emu10k1_pcm_t*epcm;905 }; 906 907 typedefenum {908 PLAYBACK_EMUVOICE,909 PLAYBACK_EFX,910 CAPTURE_AC97ADC,911 CAPTURE_AC97MIC,912 CAPTURE_EFX913 } snd_emu10k1_pcm_type_t;914 915 struct _snd_emu10k1_pcm {916 emu10k1_t*emu;917 snd_emu10k1_pcm_type_t type;918 snd_pcm_substream_t*substream;919 emu10k1_voice_t*voices[NUM_EFX_PLAYBACK];920 emu10k1_voice_t*extra;902 unsigned int use: 1, 903 pcm: 1, 904 efx: 1, 905 synth: 1, 906 midi: 1; 907 void (*interrupt)(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice); 908 909 struct snd_emu10k1_pcm *epcm; 910 }; 911 912 enum { 913 PLAYBACK_EMUVOICE, 914 PLAYBACK_EFX, 915 CAPTURE_AC97ADC, 916 CAPTURE_AC97MIC, 917 CAPTURE_EFX 918 }; 919 920 struct snd_emu10k1_pcm { 921 struct snd_emu10k1 *emu; 922 int type; 923 struct snd_pcm_substream *substream; 924 struct snd_emu10k1_voice *voices[NUM_EFX_PLAYBACK]; 925 struct snd_emu10k1_voice *extra; 921 926 unsigned short running; 922 927 unsigned short first_ptr; 923 s nd_util_memblk_t*memblk;928 struct snd_util_memblk *memblk; 924 929 unsigned int start_addr; 925 930 unsigned int ccca_start_addr; … … 935 940 }; 936 941 937 typedef struct { 942 struct snd_emu10k1_pcm_mixer { 943 /* mono, left, right x 8 sends (4 on emu10k1) */ 938 944 unsigned char send_routing[3][8]; 939 945 unsigned char send_volume[3][8]; 940 946 unsigned short attn[3]; 941 emu10k1_pcm_t*epcm;942 } emu10k1_pcm_mixer_t;947 struct snd_emu10k1_pcm *epcm; 948 }; 943 949 944 950 #define snd_emu10k1_compose_send_routing(route) \ … … 951 957 ((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24)) 952 958 953 typedefstruct snd_emu10k1_memblk {954 s nd_util_memblk_tmem;959 struct snd_emu10k1_memblk { 960 struct snd_util_memblk mem; 955 961 /* private part */ 956 962 int first_page, last_page, pages, mapped_page; … … 958 964 struct list_head mapped_link; 959 965 struct list_head mapped_order_link; 960 } emu10k1_memblk_t;966 }; 961 967 962 968 #define snd_emu10k1_memblk_offset(blk) (((blk)->mapped_page << PAGE_SHIFT) | ((blk)->mem.offset & (PAGE_SIZE - 1))) … … 964 970 #define EMU10K1_MAX_TRAM_BLOCKS_PER_CODE 16 965 971 966 typedef struct{972 struct snd_emu10k1_fx8010_ctl { 967 973 struct list_head list; /* list link container */ 968 974 unsigned int vcount; 969 975 unsigned int count; /* count of GPR (1..16) */ 970 unsigned short gpr[32];/* GPR number(s) */976 unsigned short gpr[32]; /* GPR number(s) */ 971 977 unsigned int value[32]; 972 978 unsigned int min; /* minimum range */ 973 979 unsigned int max; /* maximum range */ 974 980 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 975 s nd_kcontrol_t*kcontrol;976 } snd_emu10k1_fx8010_ctl_t;977 978 typedef void (snd_fx8010_irq_handler_t)( emu10k1_t*emu, void *private_data);979 980 typedef struct _snd_emu10k1_fx8010_irq {981 struct _snd_emu10k1_fx8010_irq *next;982 snd_fx8010_irq_handler_t *handler;983 unsigned short gpr_running;981 struct snd_kcontrol *kcontrol; 982 }; 983 984 typedef void (snd_fx8010_irq_handler_t)(struct snd_emu10k1 *emu, void *private_data); 985 986 struct snd_emu10k1_fx8010_irq { 987 struct snd_emu10k1_fx8010_irq *next; 988 snd_fx8010_irq_handler_t *handler; 989 unsigned short gpr_running; 984 990 void *private_data; 985 } snd_emu10k1_fx8010_irq_t;986 987 typedef struct{991 }; 992 993 struct snd_emu10k1_fx8010_pcm { 988 994 unsigned int valid: 1, 989 995 opened: 1, … … 991 997 unsigned int channels; /* 16-bit channels count */ 992 998 unsigned int tram_start; /* initial ring buffer position in TRAM (in samples) */ 993 unsigned int buffer_size; /* count of buffered samples */994 unsigned short gpr_size;/* GPR containing size of ring buffer in samples (host) */995 unsigned short gpr_ptr;/* GPR containing current pointer in the ring buffer (host = reset, FX8010) */996 unsigned short gpr_count;/* GPR containing count of samples between two interrupts (host) */997 unsigned short gpr_tmpcount;/* GPR containing current count of samples to interrupt (host = set, FX8010) */998 unsigned short gpr_trigger;/* GPR containing trigger (activate) information (host) */999 unsigned short gpr_running;/* GPR containing info if PCM is running (FX8010) */1000 unsigned char etram[32]; /* external TRAM address & data */1001 snd_pcm_indirect_t pcm_rec;999 unsigned int buffer_size; /* count of buffered samples */ 1000 unsigned short gpr_size; /* GPR containing size of ring buffer in samples (host) */ 1001 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ 1002 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ 1003 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ 1004 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ 1005 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ 1006 unsigned char etram[32]; /* external TRAM address & data */ 1007 struct snd_pcm_indirect pcm_rec; 1002 1008 unsigned int tram_pos; 1003 1009 unsigned int tram_shift; 1004 s nd_emu10k1_fx8010_irq_t*irq;1005 } snd_emu10k1_fx8010_pcm_t;1006 1007 typedef struct{1010 struct snd_emu10k1_fx8010_irq *irq; 1011 }; 1012 1013 struct snd_emu10k1_fx8010 { 1008 1014 unsigned short fxbus_mask; /* used FX buses (bitmask) */ 1009 1015 unsigned short extin_mask; /* used external inputs (bitmask) */ 1010 1016 unsigned short extout_mask; /* used external outputs (bitmask) */ 1011 1017 unsigned short pad1; 1012 unsigned int itram_size; /* internal TRAM size in samples */1013 struct snd_dma_buffer etram_pages; /* external TRAM pages and size */1018 unsigned int itram_size; /* internal TRAM size in samples */ 1019 struct snd_dma_buffer etram_pages; /* external TRAM pages and size */ 1014 1020 unsigned int dbg; /* FX debugger register */ 1015 1021 unsigned char name[128]; … … 1018 1024 struct list_head gpr_ctl; /* GPR controls */ 1019 1025 struct semaphore lock; 1020 s nd_emu10k1_fx8010_pcm_tpcm[8];1026 struct snd_emu10k1_fx8010_pcm pcm[8]; 1021 1027 spinlock_t irq_lock; 1022 s nd_emu10k1_fx8010_irq_t*irq_handlers;1023 } snd_emu10k1_fx8010_t;1024 1025 #define emu10k1_gpr_ctl(n) list_entry(n, s nd_emu10k1_fx8010_ctl_t, list)1026 1027 typedef struct{1028 struct _snd_emu10k1 *emu;1029 s nd_rawmidi_t*rmidi;1030 s nd_rawmidi_substream_t*substream_input;1031 s nd_rawmidi_substream_t*substream_output;1028 struct snd_emu10k1_fx8010_irq *irq_handlers; 1029 }; 1030 1031 #define emu10k1_gpr_ctl(n) list_entry(n, struct snd_emu10k1_fx8010_ctl, list) 1032 1033 struct snd_emu10k1_midi { 1034 struct snd_emu10k1 *emu; 1035 struct snd_rawmidi *rmidi; 1036 struct snd_rawmidi_substream *substream_input; 1037 struct snd_rawmidi_substream *substream_output; 1032 1038 unsigned int midi_mode; 1033 1039 spinlock_t input_lock; … … 1037 1043 int port; 1038 1044 int ipr_tx, ipr_rx; 1039 void (*interrupt)( emu10k1_t*emu, unsigned int status);1040 } emu10k1_midi_t;1041 1042 typedef struct{1043 u32 vendor;1044 u32 device;1045 u32 subsystem;1046 unsigned char revision;1047 unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */1048 unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */1049 unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */1050 unsigned char ca_cardbus_chip; /* Audigy 2 ZS Notebook*/1051 unsigned char ca0108_chip; /* Audigy 2 Value*/1052 unsigned char ca0151_chip; /* P16V */1053 unsigned char spk71; /* Has 7.1 speakers */1054 unsigned char sblive51;/* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */1055 unsigned char spdif_bug; /* Has Spdif phasing bug */1056 unsigned char ac97_chip; /* Has an AC97 chip*/1057 unsigned char ecard; /* APS EEPROM */1058 const char *driver;1059 const char *name;1060 const char *id;/* for backward compatibility - can be NULL if not needed */1061 } emu_chip_details_t;1062 1063 struct _snd_emu10k1 {1045 void (*interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1046 }; 1047 1048 struct snd_emu_chip_details { 1049 u32 vendor; 1050 u32 device; 1051 u32 subsystem; 1052 unsigned char revision; 1053 unsigned char emu10k1_chip; /* Original SB Live. Not SB Live 24bit. */ 1054 unsigned char emu10k2_chip; /* Audigy 1 or Audigy 2. */ 1055 unsigned char ca0102_chip; /* Audigy 1 or Audigy 2. Not SB Audigy 2 Value. */ 1056 unsigned char ca0108_chip; /* Audigy 2 Value */ 1057 unsigned char ca_cardbus_chip; /* Audigy 2 ZS Notebook */ 1058 unsigned char ca0151_chip; /* P16V */ 1059 unsigned char spk71; /* Has 7.1 speakers */ 1060 unsigned char sblive51; /* SBLive! 5.1 - extout 0x11 -> center, 0x12 -> lfe */ 1061 unsigned char spdif_bug; /* Has Spdif phasing bug */ 1062 unsigned char ac97_chip; /* Has an AC97 chip: 1 = mandatory, 2 = optional */ 1063 unsigned char ecard; /* APS EEPROM */ 1064 const char *driver; 1065 const char *name; 1066 const char *id; /* for backward compatibility - can be NULL if not needed */ 1067 }; 1068 1069 struct snd_emu10k1 { 1064 1070 int irq; 1065 1071 1066 unsigned long port; /* I/O port number */ 1067 unsigned int tos_link: 1, /* tos link detected */ 1068 rear_ac97: 1; /* rear channels are on AC'97 */ 1069 const emu_chip_details_t *card_capabilities; /* Contains profile of card capabilities */ 1072 unsigned long port; /* I/O port number */ 1073 unsigned int tos_link: 1, /* tos link detected */ 1074 rear_ac97: 1, /* rear channels are on AC'97 */ 1075 enable_ir: 1; 1076 /* Contains profile of card capabilities */ 1077 const struct snd_emu_chip_details *card_capabilities; 1070 1078 unsigned int audigy; /* is Audigy? */ 1071 1079 unsigned int revision; /* chip revision */ … … 1074 1082 unsigned int card_type; /* EMU10K1_CARD_* */ 1075 1083 unsigned int ecard_ctrl; /* ecard control bits */ 1076 unsigned long dma_mask; /* PCI DMA mask */ 1077 int max_cache_pages; /* max memory size / PAGE_SIZE */ 1078 struct snd_dma_buffer silent_page; /* silent page */ 1079 struct snd_dma_buffer ptb_pages; /* page table pages */ 1080 struct snd_dma_device p16v_dma_dev; 1081 struct snd_dma_buffer p16v_buffer; 1082 snd_util_memhdr_t *memhdr; /* page allocation list */ 1083 emu10k1_memblk_t *reserved_page; /* reserved page */ 1084 unsigned long dma_mask; /* PCI DMA mask */ 1085 int max_cache_pages; /* max memory size / PAGE_SIZE */ 1086 struct snd_dma_buffer silent_page; /* silent page */ 1087 struct snd_dma_buffer ptb_pages; /* page table pages */ 1088 struct snd_dma_device p16v_dma_dev; 1089 struct snd_dma_buffer p16v_buffer; 1090 1091 struct snd_util_memhdr *memhdr; /* page allocation list */ 1092 struct snd_emu10k1_memblk *reserved_page; /* reserved page */ 1084 1093 1085 1094 struct list_head mapped_link_head; … … 1091 1100 unsigned int spdif_bits[3]; /* s/pdif out setup */ 1092 1101 1093 s nd_emu10k1_fx8010_tfx8010; /* FX8010 info */1102 struct snd_emu10k1_fx8010 fx8010; /* FX8010 info */ 1094 1103 int gpr_base; 1095 1096 ac97_t*ac97;1104 1105 struct snd_ac97 *ac97; 1097 1106 1098 1107 struct pci_dev *pci; 1099 snd_card_t *card; 1100 snd_pcm_t *pcm; 1101 snd_pcm_t *pcm_mic; 1102 snd_pcm_t *pcm_efx; 1103 snd_pcm_t *pcm_p16v; 1108 struct snd_card *card; 1109 struct snd_pcm *pcm; 1110 struct snd_pcm *pcm_mic; 1111 struct snd_pcm *pcm_efx; 1112 struct snd_pcm *pcm_multi; 1113 struct snd_pcm *pcm_p16v; 1104 1114 1105 1115 spinlock_t synth_lock; 1106 1116 void *synth; 1107 int (*get_synth_voice)( emu10k1_t*emu);1117 int (*get_synth_voice)(struct snd_emu10k1 *emu); 1108 1118 1109 1119 spinlock_t reg_lock; … … 1112 1122 struct semaphore ptb_lock; 1113 1123 1114 emu10k1_voice_t voices[NUM_G]; 1115 emu10k1_voice_t p16v_voices[4]; 1116 emu10k1_voice_t p16v_capture_voice; 1117 int p16v_device_offset; 1118 u32 p16v_capture_source; 1119 u32 p16v_capture_channel; 1120 emu10k1_pcm_mixer_t pcm_mixer[32]; 1121 emu10k1_pcm_mixer_t efx_pcm_mixer[NUM_EFX_PLAYBACK]; 1122 snd_kcontrol_t *ctl_send_routing; 1123 snd_kcontrol_t *ctl_send_volume; 1124 snd_kcontrol_t *ctl_attn; 1125 snd_kcontrol_t *ctl_efx_send_routing; 1126 snd_kcontrol_t *ctl_efx_send_volume; 1127 snd_kcontrol_t *ctl_efx_attn; 1128 1129 void (*hwvol_interrupt)(emu10k1_t *emu, unsigned int status); 1130 void (*capture_interrupt)(emu10k1_t *emu, unsigned int status); 1131 void (*capture_mic_interrupt)(emu10k1_t *emu, unsigned int status); 1132 void (*capture_efx_interrupt)(emu10k1_t *emu, unsigned int status); 1133 void (*spdif_interrupt)(emu10k1_t *emu, unsigned int status); 1134 void (*dsp_interrupt)(emu10k1_t *emu); 1135 1136 snd_pcm_substream_t *pcm_capture_substream; 1137 snd_pcm_substream_t *pcm_capture_mic_substream; 1138 snd_pcm_substream_t *pcm_capture_efx_substream; 1139 snd_pcm_substream_t *pcm_playback_efx_substream; 1140 1141 snd_timer_t *timer; 1142 1143 emu10k1_midi_t midi; 1144 emu10k1_midi_t midi2; /* for audigy */ 1145 1146 unsigned int efx_voices_mask[2]; 1147 unsigned int next_free_voice; 1148 }; 1149 1150 int snd_emu10k1_create(snd_card_t * card, 1124 struct snd_emu10k1_voice voices[NUM_G]; 1125 struct snd_emu10k1_voice p16v_voices[4]; 1126 struct snd_emu10k1_voice p16v_capture_voice; 1127 int p16v_device_offset; 1128 u32 p16v_capture_source; 1129 u32 p16v_capture_channel; 1130 struct snd_emu10k1_pcm_mixer pcm_mixer[32]; 1131 struct snd_emu10k1_pcm_mixer efx_pcm_mixer[NUM_EFX_PLAYBACK]; 1132 struct snd_kcontrol *ctl_send_routing; 1133 struct snd_kcontrol *ctl_send_volume; 1134 struct snd_kcontrol *ctl_attn; 1135 struct snd_kcontrol *ctl_efx_send_routing; 1136 struct snd_kcontrol *ctl_efx_send_volume; 1137 struct snd_kcontrol *ctl_efx_attn; 1138 1139 void (*hwvol_interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1140 void (*capture_interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1141 void (*capture_mic_interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1142 void (*capture_efx_interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1143 void (*spdif_interrupt)(struct snd_emu10k1 *emu, unsigned int status); 1144 void (*dsp_interrupt)(struct snd_emu10k1 *emu); 1145 1146 struct snd_pcm_substream *pcm_capture_substream; 1147 struct snd_pcm_substream *pcm_capture_mic_substream; 1148 struct snd_pcm_substream *pcm_capture_efx_substream; 1149 struct snd_pcm_substream *pcm_playback_efx_substream; 1150 1151 struct snd_timer *timer; 1152 1153 struct snd_emu10k1_midi midi; 1154 struct snd_emu10k1_midi midi2; /* for audigy */ 1155 1156 unsigned int efx_voices_mask[2]; 1157 unsigned int next_free_voice; 1158 1159 #ifdef CONFIG_PM 1160 unsigned int *saved_ptr; 1161 unsigned int *saved_gpr; 1162 unsigned int *tram_val_saved; 1163 unsigned int *tram_addr_saved; 1164 unsigned int *saved_icode; 1165 unsigned int *p16v_saved; 1166 unsigned int saved_a_iocfg, saved_hcfg; 1167 #endif 1168 1169 }; 1170 1171 int snd_emu10k1_create(struct snd_card *card, 1151 1172 struct pci_dev *pci, 1152 1173 unsigned short extin_mask, 1153 1174 unsigned short extout_mask, 1154 1175 long max_cache_bytes, 1155 int enable_ir,1156 uint subsystem,1157 emu10k1_t** remu);1158 1159 int snd_emu10k1_pcm( emu10k1_t * emu, int device, snd_pcm_t** rpcm);1160 int snd_emu10k1_pcm_mic( emu10k1_t * emu, int device, snd_pcm_t** rpcm);1161 int snd_emu10k1_pcm_efx( emu10k1_t * emu, int device, snd_pcm_t** rpcm);1162 int snd_p16v_pcm( emu10k1_t * emu, int device, snd_pcm_t** rpcm);1163 int snd_p16v_free( emu10k1_t* emu);1164 int snd_p16v_mixer( emu10k1_t* emu);1165 int snd_emu10k1_pcm_multi( emu10k1_t * emu, int device, snd_pcm_t** rpcm);1166 int snd_emu10k1_fx8010_pcm( emu10k1_t * emu, int device, snd_pcm_t** rpcm);1167 int snd_emu10k1_mixer( emu10k1_t* emu, int pcm_device, int multi_device);1168 int snd_emu10k1_timer( emu10k1_t* emu, int device);1169 int snd_emu10k1_fx8010_new( emu10k1_t *emu, int device, snd_hwdep_t** rhwdep);1176 int enable_ir, 1177 uint subsystem, 1178 struct snd_emu10k1 ** remu); 1179 1180 int snd_emu10k1_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); 1181 int snd_emu10k1_pcm_mic(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); 1182 int snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); 1183 int snd_p16v_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); 1184 int snd_p16v_free(struct snd_emu10k1 * emu); 1185 int snd_p16v_mixer(struct snd_emu10k1 * emu); 1186 int snd_emu10k1_pcm_multi(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); 1187 int snd_emu10k1_fx8010_pcm(struct snd_emu10k1 * emu, int device, struct snd_pcm ** rpcm); 1188 int snd_emu10k1_mixer(struct snd_emu10k1 * emu, int pcm_device, int multi_device); 1189 int snd_emu10k1_timer(struct snd_emu10k1 * emu, int device); 1190 int snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct snd_hwdep ** rhwdep); 1170 1191 1171 1192 irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id, struct pt_regs *regs); 1172 1193 1173 /* initialization */ 1174 void snd_emu10k1_voice_init(emu10k1_t * emu, int voice);1175 int snd_emu10k1_init_efx(emu10k1_t*emu);1176 void snd_emu10k1_free_efx(emu10k1_t *emu);1177 int snd_emu10k1_ fx8010_tram_setup(emu10k1_t *emu, u32 size);1194 void snd_emu10k1_voice_init(struct snd_emu10k1 * emu, int voice); 1195 int snd_emu10k1_init_efx(struct snd_emu10k1 *emu); 1196 void snd_emu10k1_free_efx(struct snd_emu10k1 *emu); 1197 int snd_emu10k1_fx8010_tram_setup(struct snd_emu10k1 *emu, u32 size); 1198 int snd_emu10k1_done(struct snd_emu10k1 * emu); 1178 1199 1179 1200 /* I/O functions */ 1180 unsigned int snd_emu10k1_ptr_read(emu10k1_t * emu, unsigned int reg, unsigned int chn); 1181 void snd_emu10k1_ptr_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data); 1182 unsigned int snd_emu10k1_ptr20_read(emu10k1_t * emu, unsigned int reg, unsigned int chn); 1183 void snd_emu10k1_ptr20_write(emu10k1_t *emu, unsigned int reg, unsigned int chn, unsigned int data); 1184 void snd_emu10k1_efx_write(emu10k1_t *emu, unsigned int pc, unsigned int data); 1185 unsigned int snd_emu10k1_efx_read(emu10k1_t *emu, unsigned int pc); 1186 void snd_emu10k1_intr_enable(emu10k1_t *emu, unsigned int intrenb); 1187 void snd_emu10k1_intr_disable(emu10k1_t *emu, unsigned int intrenb); 1188 void snd_emu10k1_voice_intr_enable(emu10k1_t *emu, unsigned int voicenum); 1189 void snd_emu10k1_voice_intr_disable(emu10k1_t *emu, unsigned int voicenum); 1190 void snd_emu10k1_voice_intr_ack(emu10k1_t *emu, unsigned int voicenum); 1191 void snd_emu10k1_voice_half_loop_intr_enable(emu10k1_t *emu, unsigned int voicenum); 1192 void snd_emu10k1_voice_half_loop_intr_disable(emu10k1_t *emu, unsigned int voicenum); 1193 void snd_emu10k1_voice_half_loop_intr_ack(emu10k1_t *emu, unsigned int voicenum); 1194 void snd_emu10k1_voice_set_loop_stop(emu10k1_t *emu, unsigned int voicenum); 1195 void snd_emu10k1_voice_clear_loop_stop(emu10k1_t *emu, unsigned int voicenum); 1196 void snd_emu10k1_wait(emu10k1_t *emu, unsigned int wait); 1197 static inline unsigned int snd_emu10k1_wc(emu10k1_t *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; } 1198 unsigned short snd_emu10k1_ac97_read(ac97_t *ac97, unsigned short reg); 1199 void snd_emu10k1_ac97_write(ac97_t *ac97, unsigned short reg, unsigned short data); 1201 unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn); 1202 void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); 1203 unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu, unsigned int reg, unsigned int chn); 1204 void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned int chn, unsigned int data); 1205 unsigned int snd_emu10k1_efx_read(struct snd_emu10k1 *emu, unsigned int pc); 1206 void snd_emu10k1_intr_enable(struct snd_emu10k1 *emu, unsigned int intrenb); 1207 void snd_emu10k1_intr_disable(struct snd_emu10k1 *emu, unsigned int intrenb); 1208 void snd_emu10k1_voice_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum); 1209 void snd_emu10k1_voice_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum); 1210 void snd_emu10k1_voice_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum); 1211 void snd_emu10k1_voice_half_loop_intr_enable(struct snd_emu10k1 *emu, unsigned int voicenum); 1212 void snd_emu10k1_voice_half_loop_intr_disable(struct snd_emu10k1 *emu, unsigned int voicenum); 1213 void snd_emu10k1_voice_half_loop_intr_ack(struct snd_emu10k1 *emu, unsigned int voicenum); 1214 void snd_emu10k1_voice_set_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum); 1215 void snd_emu10k1_voice_clear_loop_stop(struct snd_emu10k1 *emu, unsigned int voicenum); 1216 void snd_emu10k1_wait(struct snd_emu10k1 *emu, unsigned int wait); 1217 static inline unsigned int snd_emu10k1_wc(struct snd_emu10k1 *emu) { return (inl(emu->port + WC) >> 6) & 0xfffff; } 1218 unsigned short snd_emu10k1_ac97_read(struct snd_ac97 *ac97, unsigned short reg); 1219 void snd_emu10k1_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short data); 1200 1220 unsigned int snd_emu10k1_rate_to_pitch(unsigned int rate); 1201 unsigned char snd_emu10k1_sum_vol_attn(unsigned int value); 1221 1222 #ifdef CONFIG_PM 1223 void snd_emu10k1_suspend_regs(struct snd_emu10k1 *emu); 1224 void snd_emu10k1_resume_init(struct snd_emu10k1 *emu); 1225 void snd_emu10k1_resume_regs(struct snd_emu10k1 *emu); 1226 int snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu); 1227 void snd_emu10k1_efx_free_pm_buffer(struct snd_emu10k1 *emu); 1228 void snd_emu10k1_efx_suspend(struct snd_emu10k1 *emu); 1229 void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu); 1230 int snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu); 1231 void snd_p16v_free_pm_buffer(struct snd_emu10k1 *emu); 1232 void snd_p16v_suspend(struct snd_emu10k1 *emu); 1233 void snd_p16v_resume(struct snd_emu10k1 *emu); 1234 #endif 1202 1235 1203 1236 /* memory allocation */ 1204 s nd_util_memblk_t *snd_emu10k1_alloc_pages(emu10k1_t *emu, snd_pcm_substream_t*substream);1205 int snd_emu10k1_free_pages( emu10k1_t *emu, snd_util_memblk_t*blk);1206 s nd_util_memblk_t *snd_emu10k1_synth_alloc(emu10k1_t*emu, unsigned int size);1207 int snd_emu10k1_synth_free( emu10k1_t *emu, snd_util_memblk_t*blk);1208 int snd_emu10k1_synth_bzero( emu10k1_t *emu, snd_util_memblk_t*blk, int offset, int size);1209 int snd_emu10k1_synth_copy_from_user( emu10k1_t *emu, snd_util_memblk_t *blk, int offset, const char *data, int size);1210 int snd_emu10k1_memblk_map( emu10k1_t *emu, emu10k1_memblk_t*blk);1237 struct snd_util_memblk *snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *substream); 1238 int snd_emu10k1_free_pages(struct snd_emu10k1 *emu, struct snd_util_memblk *blk); 1239 struct snd_util_memblk *snd_emu10k1_synth_alloc(struct snd_emu10k1 *emu, unsigned int size); 1240 int snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *blk); 1241 int snd_emu10k1_synth_bzero(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, int size); 1242 int snd_emu10k1_synth_copy_from_user(struct snd_emu10k1 *emu, struct snd_util_memblk *blk, int offset, const char __user *data, int size); 1243 int snd_emu10k1_memblk_map(struct snd_emu10k1 *emu, struct snd_emu10k1_memblk *blk); 1211 1244 1212 1245 /* voice allocation */ 1213 int snd_emu10k1_voice_alloc( emu10k1_t *emu, emu10k1_voice_type_t type, int pair, emu10k1_voice_t**rvoice);1214 int snd_emu10k1_voice_free( emu10k1_t *emu, emu10k1_voice_t*pvoice);1246 int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int pair, struct snd_emu10k1_voice **rvoice); 1247 int snd_emu10k1_voice_free(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *pvoice); 1215 1248 1216 1249 /* MIDI uart */ 1217 int snd_emu10k1_midi( emu10k1_t* emu);1218 int snd_emu10k1_audigy_midi( emu10k1_t* emu);1250 int snd_emu10k1_midi(struct snd_emu10k1 * emu); 1251 int snd_emu10k1_audigy_midi(struct snd_emu10k1 * emu); 1219 1252 1220 1253 /* proc interface */ 1221 int snd_emu10k1_proc_init( emu10k1_t* emu);1254 int snd_emu10k1_proc_init(struct snd_emu10k1 * emu); 1222 1255 1223 1256 /* fx8010 irq handler */ 1224 int snd_emu10k1_fx8010_register_irq_handler( emu10k1_t*emu,1225 snd_fx8010_irq_handler_t *handler,1226 unsigned char gpr_running,1227 void *private_data,1228 snd_emu10k1_fx8010_irq_t**r_irq);1229 int snd_emu10k1_fx8010_unregister_irq_handler( emu10k1_t*emu,1230 snd_emu10k1_fx8010_irq_t*irq);1257 int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu, 1258 snd_fx8010_irq_handler_t *handler, 1259 unsigned char gpr_running, 1260 void *private_data, 1261 struct snd_emu10k1_fx8010_irq **r_irq); 1262 int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu, 1263 struct snd_emu10k1_fx8010_irq *irq); 1231 1264 1232 1265 #endif /* __KERNEL__ */ … … 1262 1295 #define FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x0f */ 1263 1296 #define EXTIN(x) (0x10 + (x)) /* x = 0x00 - 0x0f */ 1264 #define EXTOUT(x) (0x20 + (x))/* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */1265 #define FXBUS2(x) (0x30 + (x))/* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */1266 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */1297 #define EXTOUT(x) (0x20 + (x)) /* x = 0x00 - 0x0f physical outs -> FXWC low 16 bits */ 1298 #define FXBUS2(x) (0x30 + (x)) /* x = 0x00 - 0x0f copies of fx buses for capture -> FXWC high 16 bits */ 1299 /* NB: 0x31 and 0x32 are shared with Center/LFE on SB live 5.1 */ 1267 1300 1268 1301 #define C_00000000 0x40 … … 1300 1333 #define ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x80 + (x)) /* x = 0x00 - 0x1f */ 1301 1334 1302 #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */1303 #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */1304 #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */1305 #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */1306 #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */1307 #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */1308 1309 #define A_FXBUS(x) (0x00 + (x))/* x = 0x00 - 0x3f FX buses */1310 #define A_EXTIN(x) (0x40 + (x))/* x = 0x00 - 0x0f physical ins */1311 #define A_P16VIN(x) (0x50 + (x))/* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */1312 #define A_EXTOUT(x) (0x60 + (x))/* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */1313 #define A_FXBUS2(x) (0x80 + (x))/* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */1314 #define A_EMU32OUTH(x) (0xa0 + (x))/* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */1315 #define A_EMU32OUTL(x) (0xb0 + (x))/* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */1335 #define A_ITRAM_DATA(x) (TANKMEMDATAREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 1336 #define A_ETRAM_DATA(x) (TANKMEMDATAREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 1337 #define A_ITRAM_ADDR(x) (TANKMEMADDRREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 1338 #define A_ETRAM_ADDR(x) (TANKMEMADDRREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 1339 #define A_ITRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0x00 + (x)) /* x = 0x00 - 0xbf */ 1340 #define A_ETRAM_CTL(x) (A_TANKMEMCTLREGBASE + 0xc0 + (x)) /* x = 0x00 - 0x3f */ 1341 1342 #define A_FXBUS(x) (0x00 + (x)) /* x = 0x00 - 0x3f FX buses */ 1343 #define A_EXTIN(x) (0x40 + (x)) /* x = 0x00 - 0x0f physical ins */ 1344 #define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ 1345 #define A_EXTOUT(x) (0x60 + (x)) /* x = 0x00 - 0x1f physical outs -> A_FXWC1 0x79-7f unknown */ 1346 #define A_FXBUS2(x) (0x80 + (x)) /* x = 0x00 - 0x1f extra outs used for EFX capture -> A_FXWC2 */ 1347 #define A_EMU32OUTH(x) (0xa0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_10 - _1F" - ??? */ 1348 #define A_EMU32OUTL(x) (0xb0 + (x)) /* x = 0x00 - 0x0f "EMU32_OUT_1 - _F" - ??? */ 1316 1349 #define A_GPR(x) (A_FXGPREGBASE + (x)) 1317 1350 … … 1337 1370 #define FXBUS_MIDI_REVERB 0x0c 1338 1371 #define FXBUS_MIDI_CHORUS 0x0d 1339 #define FXBUS_PCM_LEFT_SIDE 0x0e1340 #define FXBUS_PCM_RIGHT_SIDE 0x0f1372 #define FXBUS_PCM_LEFT_SIDE 0x0e 1373 #define FXBUS_PCM_RIGHT_SIDE 0x0f 1341 1374 #define FXBUS_PT_LEFT 0x14 1342 1375 #define FXBUS_PT_RIGHT 0x15 … … 1363 1396 #define EXTOUT_TOSLINK_L 0x02 /* LiveDrive - TOSLink Optical - left */ 1364 1397 #define EXTOUT_TOSLINK_R 0x03 /* LiveDrive - TOSLink Optical - right */ 1365 #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */1366 #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */1398 #define EXTOUT_AC97_CENTER 0x04 /* SB Live 5.1 - center */ 1399 #define EXTOUT_AC97_LFE 0x05 /* SB Live 5.1 - LFE */ 1367 1400 #define EXTOUT_HEADPHONE_L 0x06 /* LiveDrive - Headphone - left */ 1368 1401 #define EXTOUT_HEADPHONE_R 0x07 /* LiveDrive - Headphone - right */ … … 1372 1405 #define EXTOUT_ADC_CAP_R 0x0b /* ADC Capture buffer - right */ 1373 1406 #define EXTOUT_MIC_CAP 0x0c /* MIC Capture buffer */ 1374 #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */1375 #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */1407 #define EXTOUT_AC97_REAR_L 0x0d /* SB Live 5.1 (c) 2003 - Rear Left */ 1408 #define EXTOUT_AC97_REAR_R 0x0e /* SB Live 5.1 (c) 2003 - Rear Right */ 1376 1409 #define EXTOUT_ACENTER 0x11 /* Analog Center */ 1377 1410 #define EXTOUT_ALFE 0x12 /* Analog LFE */ … … 1383 1416 #define A_EXTIN_SPDIF_CD_R 0x03 /* digital CD left */ 1384 1417 #define A_EXTIN_OPT_SPDIF_L 0x04 /* audigy drive Optical SPDIF - left */ 1385 #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ 1418 #define A_EXTIN_OPT_SPDIF_R 0x05 /* right */ 1386 1419 #define A_EXTIN_LINE2_L 0x08 /* audigy drive line2/mic2 - left */ 1387 1420 #define A_EXTIN_LINE2_R 0x09 /* right */ … … 1404 1437 #define A_EXTOUT_ACENTER 0x0a /* analog center */ 1405 1438 #define A_EXTOUT_ALFE 0x0b /* analog LFE */ 1406 #define A_EXTOUT_ASIDE_L 0x0c/* analog side left - Audigy 2 ZS */1407 #define A_EXTOUT_ASIDE_R 0x0d/* right - Audigy 2 ZS */1439 #define A_EXTOUT_ASIDE_L 0x0c /* analog side left - Audigy 2 ZS */ 1440 #define A_EXTOUT_ASIDE_R 0x0d /* right - Audigy 2 ZS */ 1408 1441 #define A_EXTOUT_AREAR_L 0x0e /* analog rear left */ 1409 1442 #define A_EXTOUT_AREAR_R 0x0f /* right */ … … 1439 1472 #define A_GPR_ACCU 0xd6 /* ACCUM, accumulator */ 1440 1473 #define A_GPR_COND 0xd7 /* CCR, condition register */ 1441 #define A_GPR_NOISE0 0xd8/* noise source */1442 #define A_GPR_NOISE1 0xd9/* noise source */1443 #define A_GPR_IRQ 0xda/* IRQ register */1444 #define A_GPR_DBAC 0xdb/* TRAM Delay Base Address Counter - internal */1445 #define A_GPR_DBACE 0xde/* TRAM Delay Base Address Counter - external */1474 #define A_GPR_NOISE0 0xd8 /* noise source */ 1475 #define A_GPR_NOISE1 0xd9 /* noise source */ 1476 #define A_GPR_IRQ 0xda /* IRQ register */ 1477 #define A_GPR_DBAC 0xdb /* TRAM Delay Base Address Counter - internal */ 1478 #define A_GPR_DBACE 0xde /* TRAM Delay Base Address Counter - external */ 1446 1479 1447 1480 /* definitions for debug register */ … … 1463 1496 #endif 1464 1497 1465 typedef struct{1498 struct snd_emu10k1_fx8010_info { 1466 1499 unsigned int internal_tram_size; /* in samples */ 1467 1500 unsigned int external_tram_size; /* in samples */ … … 1470 1503 char extout_names[32][32]; /* names of external outputs */ 1471 1504 unsigned int gpr_controls; /* count of GPR controls */ 1472 } emu10k1_fx8010_info_t;1505 }; 1473 1506 1474 1507 #define EMU10K1_GPR_TRANSLATION_NONE 0 … … 1478 1511 #define EMU10K1_GPR_TRANSLATION_ONOFF 4 1479 1512 1480 typedef struct{1481 s nd_ctl_elem_id_tid; /* full control ID definition */1513 struct snd_emu10k1_fx8010_control_gpr { 1514 struct snd_ctl_elem_id id; /* full control ID definition */ 1482 1515 unsigned int vcount; /* visible count */ 1483 1516 unsigned int count; /* count of GPR (1..16) */ 1484 unsigned short gpr[32];/* GPR number(s) */1517 unsigned short gpr[32]; /* GPR number(s) */ 1485 1518 unsigned int value[32]; /* initial values */ 1486 1519 unsigned int min; /* minimum range */ 1487 1520 unsigned int max; /* maximum range */ 1488 1521 unsigned int translation; /* translation type (EMU10K1_GPR_TRANSLATION*) */ 1489 } emu10k1_fx8010_control_gpr_t;1490 1491 typedef struct{1522 }; 1523 1524 struct snd_emu10k1_fx8010_code { 1492 1525 char name[128]; 1493 1526 1494 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */1495 u_int32_t __user *gpr_map;/* initializers */1527 DECLARE_BITMAP(gpr_valid, 0x200); /* bitmask of valid initializers */ 1528 u_int32_t __user *gpr_map; /* initializers */ 1496 1529 1497 1530 unsigned int gpr_add_control_count; /* count of GPR controls to add/replace */ 1498 emu10k1_fx8010_control_gpr_t*gpr_add_controls; /* GPR controls to add/replace */1531 struct snd_emu10k1_fx8010_control_gpr __user *gpr_add_controls; /* GPR controls to add/replace */ 1499 1532 1500 1533 unsigned int gpr_del_control_count; /* count of GPR controls to remove */ 1501 s nd_ctl_elem_id_t*gpr_del_controls; /* IDs of GPR controls to remove */1534 struct snd_ctl_elem_id __user *gpr_del_controls; /* IDs of GPR controls to remove */ 1502 1535 1503 1536 unsigned int gpr_list_control_count; /* count of GPR controls to list */ 1504 1537 unsigned int gpr_list_control_total; /* total count of GPR controls */ 1505 emu10k1_fx8010_control_gpr_t*gpr_list_controls; /* listed GPR controls */1506 1507 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */1508 u_int32_t __user *tram_data_map; /* data initializers */1509 u_int32_t __user *tram_addr_map; /* map initializers */1510 1511 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */1512 u_int32_t __user *code;/* one instruction - 64 bits */1513 } emu10k1_fx8010_code_t;1514 1515 typedef struct{1538 struct snd_emu10k1_fx8010_control_gpr __user *gpr_list_controls; /* listed GPR controls */ 1539 1540 DECLARE_BITMAP(tram_valid, 0x100); /* bitmask of valid initializers */ 1541 u_int32_t __user *tram_data_map; /* data initializers */ 1542 u_int32_t __user *tram_addr_map; /* map initializers */ 1543 1544 DECLARE_BITMAP(code_valid, 1024); /* bitmask of valid instructions */ 1545 u_int32_t __user *code; /* one instruction - 64 bits */ 1546 }; 1547 1548 struct snd_emu10k1_fx8010_tram { 1516 1549 unsigned int address; /* 31.bit == 1 -> external TRAM */ 1517 1550 unsigned int size; /* size in samples (4 bytes) */ 1518 1551 unsigned int *samples; /* pointer to samples (20-bit) */ 1519 1552 /* NULL->clear memory */ 1520 } emu10k1_fx8010_tram_t;1521 1522 typedef struct{1553 }; 1554 1555 struct snd_emu10k1_fx8010_pcm_rec { 1523 1556 unsigned int substream; /* substream number */ 1524 1557 unsigned int res1; /* reserved */ 1525 1558 unsigned int channels; /* 16-bit channels count, zero = remove this substream */ 1526 1559 unsigned int tram_start; /* ring buffer position in TRAM (in samples) */ 1527 unsigned int buffer_size; /* count of buffered samples */1528 unsigned short gpr_size;/* GPR containing size of ringbuffer in samples (host) */1529 unsigned short gpr_ptr;/* GPR containing current pointer in the ring buffer (host = reset, FX8010) */1530 unsigned short gpr_count;/* GPR containing count of samples between two interrupts (host) */1531 unsigned short gpr_tmpcount;/* GPR containing current count of samples to interrupt (host = set, FX8010) */1532 unsigned short gpr_trigger;/* GPR containing trigger (activate) information (host) */1533 unsigned short gpr_running;/* GPR containing info if PCM is running (FX8010) */1560 unsigned int buffer_size; /* count of buffered samples */ 1561 unsigned short gpr_size; /* GPR containing size of ringbuffer in samples (host) */ 1562 unsigned short gpr_ptr; /* GPR containing current pointer in the ring buffer (host = reset, FX8010) */ 1563 unsigned short gpr_count; /* GPR containing count of samples between two interrupts (host) */ 1564 unsigned short gpr_tmpcount; /* GPR containing current count of samples to interrupt (host = set, FX8010) */ 1565 unsigned short gpr_trigger; /* GPR containing trigger (activate) information (host) */ 1566 unsigned short gpr_running; /* GPR containing info if PCM is running (FX8010) */ 1534 1567 unsigned char pad; /* reserved */ 1535 1568 unsigned char etram[32]; /* external TRAM address & data (one per channel) */ 1536 1569 unsigned int res2; /* reserved */ 1537 } emu10k1_fx8010_pcm_t;1538 1539 #define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, emu10k1_fx8010_info_t)1540 #define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, emu10k1_fx8010_code_t)1541 #define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, emu10k1_fx8010_code_t)1570 }; 1571 1572 #define SNDRV_EMU10K1_IOCTL_INFO _IOR ('H', 0x10, struct snd_emu10k1_fx8010_info) 1573 #define SNDRV_EMU10K1_IOCTL_CODE_POKE _IOW ('H', 0x11, struct snd_emu10k1_fx8010_code) 1574 #define SNDRV_EMU10K1_IOCTL_CODE_PEEK _IOWR('H', 0x12, struct snd_emu10k1_fx8010_code) 1542 1575 #define SNDRV_EMU10K1_IOCTL_TRAM_SETUP _IOW ('H', 0x20, int) 1543 #define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, emu10k1_fx8010_tram_t)1544 #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, emu10k1_fx8010_tram_t)1545 #define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, emu10k1_fx8010_pcm_t)1546 #define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, emu10k1_fx8010_pcm_t)1576 #define SNDRV_EMU10K1_IOCTL_TRAM_POKE _IOW ('H', 0x21, struct snd_emu10k1_fx8010_tram) 1577 #define SNDRV_EMU10K1_IOCTL_TRAM_PEEK _IOWR('H', 0x22, struct snd_emu10k1_fx8010_tram) 1578 #define SNDRV_EMU10K1_IOCTL_PCM_POKE _IOW ('H', 0x30, struct snd_emu10k1_fx8010_pcm_rec) 1579 #define SNDRV_EMU10K1_IOCTL_PCM_PEEK _IOWR('H', 0x31, struct snd_emu10k1_fx8010_pcm_rec) 1547 1580 #define SNDRV_EMU10K1_IOCTL_STOP _IO ('H', 0x80) 1548 1581 #define SNDRV_EMU10K1_IOCTL_CONTINUE _IO ('H', 0x81) … … 1551 1584 #define SNDRV_EMU10K1_IOCTL_DBG_READ _IOR ('H', 0x84, int) 1552 1585 1586 /* typedefs for compatibility to user-space */ 1587 typedef struct snd_emu10k1_fx8010_info emu10k1_fx8010_info_t; 1588 typedef struct snd_emu10k1_fx8010_control_gpr emu10k1_fx8010_control_gpr_t; 1589 typedef struct snd_emu10k1_fx8010_code emu10k1_fx8010_code_t; 1590 typedef struct snd_emu10k1_fx8010_tram emu10k1_fx8010_tram_t; 1591 typedef struct snd_emu10k1_fx8010_pcm_rec emu10k1_fx8010_pcm_t; 1592 1553 1593 #endif /* __SOUND_EMU10K1_H */ -
GPL/trunk/alsa-kernel/include/sound/emu10k1_synth.h
r33 r34 28 28 29 29 /* argument for snd_seq_device_new */ 30 typedefstruct snd_emu10k1_synth_arg {31 emu10k1_t*hwptr; /* chip */30 struct snd_emu10k1_synth_arg { 31 struct snd_emu10k1 *hwptr; /* chip */ 32 32 int index; /* sequencer client index */ 33 33 int seq_ports; /* number of sequencer ports to be created */ 34 34 int max_voices; /* maximum number of voices for wavetable */ 35 } snd_emu10k1_synth_arg_t;35 }; 36 36 37 37 #define EMU10K1_MAX_MEMSIZE (32 * 1024 * 1024) /* 32MB */ -
GPL/trunk/alsa-kernel/include/sound/emux_synth.h
r33 r34 26 26 #include "soundfont.h" 27 27 #include "seq_midi_emul.h" 28 #ifdef CONFIG_SND_ OSSEMUL28 #ifdef CONFIG_SND_SEQUENCER_OSS 29 29 #include "seq_oss.h" 30 30 #endif … … 37 37 #define SNDRV_EMUX_USE_RAW_EFFECT 38 38 39 40 /* 41 * typedefs 42 */ 43 typedef struct snd_emux_effect_table snd_emux_effect_table_t; 44 typedef struct snd_emux_port snd_emux_port_t; 45 typedef struct snd_emux_voice snd_emux_voice_t; 46 typedef struct snd_emux snd_emux_t; 47 39 struct snd_emux; 40 struct snd_emux_port; 41 struct snd_emux_voice; 42 struct snd_emux_effect_table; 48 43 49 44 /* 50 45 * operators 51 46 */ 52 typedefstruct snd_emux_operators {47 struct snd_emux_operators { 53 48 struct module *owner; 54 snd_emux_voice_t *(*get_voice)(snd_emux_t *emu, snd_emux_port_t *port); 55 int (*prepare)(snd_emux_voice_t *vp); 56 void (*trigger)(snd_emux_voice_t *vp); 57 void (*release)(snd_emux_voice_t *vp); 58 void (*update)(snd_emux_voice_t *vp, int update); 59 void (*terminate)(snd_emux_voice_t *vp); 60 void (*free_voice)(snd_emux_voice_t *vp); 61 void (*reset)(snd_emux_t *emu, int ch); 62 /* the first parameters are snd_emux_t */ 63 int (*sample_new)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr, const void *data, long count); 64 int (*sample_free)(snd_emux_t *emu, snd_sf_sample_t *sp, snd_util_memhdr_t *hdr); 65 void (*sample_reset)(snd_emux_t *emu); 66 int (*load_fx)(snd_emux_t *emu, int type, int arg, const void *data, long count); 67 void (*sysex)(snd_emux_t *emu, char *buf, int len, int parsed, snd_midi_channel_set_t *chset); 68 #ifdef CONFIG_SND_OSSEMUL 69 int (*oss_ioctl)(snd_emux_t *emu, int cmd, int p1, int p2); 70 #endif 71 } snd_emux_operators_t; 49 struct snd_emux_voice *(*get_voice)(struct snd_emux *emu, 50 struct snd_emux_port *port); 51 int (*prepare)(struct snd_emux_voice *vp); 52 void (*trigger)(struct snd_emux_voice *vp); 53 void (*release)(struct snd_emux_voice *vp); 54 void (*update)(struct snd_emux_voice *vp, int update); 55 void (*terminate)(struct snd_emux_voice *vp); 56 void (*free_voice)(struct snd_emux_voice *vp); 57 void (*reset)(struct snd_emux *emu, int ch); 58 /* the first parameters are struct snd_emux */ 59 int (*sample_new)(struct snd_emux *emu, struct snd_sf_sample *sp, 60 struct snd_util_memhdr *hdr, 61 const void __user *data, long count); 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); 69 #ifdef CONFIG_SND_SEQUENCER_OSS 70 int (*oss_ioctl)(struct snd_emux *emu, int cmd, int p1, int p2); 71 #endif 72 }; 72 73 73 74 … … 91 92 struct snd_emux { 92 93 93 s nd_card_t*card; /* assigned card */94 struct snd_card *card; /* assigned card */ 94 95 95 96 /* following should be initialized before registration */ … … 98 99 int num_ports; /* number of ports to be created */ 99 100 int pitch_shift; /* pitch shift value (for Emu10k1) */ 100 s nd_emux_operators_tops; /* operators */101 struct snd_emux_operators ops; /* operators */ 101 102 void *hw; /* hardware */ 102 103 unsigned long flags; /* other conditions */ … … 105 106 unsigned int linear_panning: 1; /* panning is linear (sbawe = 1, emu10k1 = 0) */ 106 107 int hwdep_idx; /* hwdep device index */ 107 s nd_hwdep_t*hwdep; /* hwdep device */108 struct snd_hwdep *hwdep; /* hwdep device */ 108 109 109 110 /* private */ 110 111 int num_voices; /* current number of voices */ 111 s nd_sf_list_t *sflist; /* root of SoundFont list */112 s nd_emux_voice_t*voices; /* Voices (EMU 'channel') */112 struct snd_sf_list *sflist; /* root of SoundFont list */ 113 struct snd_emux_voice *voices; /* Voices (EMU 'channel') */ 113 114 int use_time; /* allocation counter */ 114 115 spinlock_t voice_lock; /* Lock for voice access */ … … 116 117 int client; /* For the sequencer client */ 117 118 int ports[SNDRV_EMUX_MAX_PORTS]; /* The ports for this device */ 119 struct snd_emux_port *portptrs[SNDRV_EMUX_MAX_PORTS]; 118 120 int used; /* use counter */ 119 snd_emux_port_t *portptrs[SNDRV_EMUX_MAX_PORTS];120 121 char *name; /* name of the device (internal) */ 121 s nd_rawmidi_t**vmidi;122 struct snd_rawmidi **vmidi; 122 123 struct timer_list tlist; /* for pending note-offs */ 123 124 int timer_active; 124 125 125 s nd_util_memhdr_t*memhdr; /* memory chunk information */126 struct snd_util_memhdr *memhdr; /* memory chunk information */ 126 127 127 128 #ifdef CONFIG_PROC_FS 128 s nd_info_entry_t*proc;129 #endif 130 131 #ifdef CONFIG_SND_ OSSEMUL132 s nd_seq_device_t*oss_synth;129 struct snd_info_entry *proc; 130 #endif 131 132 #ifdef CONFIG_SND_SEQUENCER_OSS 133 struct snd_seq_device *oss_synth; 133 134 #endif 134 135 }; … … 140 141 struct snd_emux_port { 141 142 142 s nd_midi_channel_set_t chset;143 s nd_emux_t*emu;143 struct snd_midi_channel_set chset; 144 struct snd_emux *emu; 144 145 145 146 char port_mode; /* operation mode */ … … 148 149 int ctrls[EMUX_MD_END]; /* control parameters */ 149 150 #ifdef SNDRV_EMUX_USE_RAW_EFFECT 150 s nd_emux_effect_table_t*effect;151 #endif 152 #ifdef CONFIG_SND_ OSSEMUL153 s nd_seq_oss_arg_t*oss_arg;151 struct snd_emux_effect_table *effect; 152 #endif 153 #ifdef CONFIG_SND_SEQUENCER_OSS 154 struct snd_seq_oss_arg *oss_arg; 154 155 #endif 155 156 }; … … 180 181 unsigned char velocity; /* Velocity of current note */ 181 182 182 s nd_sf_zone_t*zone; /* Zone assigned to this note */183 struct snd_sf_zone *zone; /* Zone assigned to this note */ 183 184 void *block; /* sample block pointer (optional) */ 184 s nd_midi_channel_t*chan; /* Midi channel for this note */185 s nd_emux_port_t *port; /* associated port */186 s nd_emux_t*emu; /* assigned root info */187 void *hw; /* hardware pointer (emu8000 _t or emu10k1_t) */185 struct snd_midi_channel *chan; /* Midi channel for this note */ 186 struct snd_emux_port *port; /* associated port */ 187 struct snd_emux *emu; /* assigned root info */ 188 void *hw; /* hardware pointer (emu8000 or emu10k1) */ 188 189 unsigned long ontime; /* jiffies at note triggered */ 189 190 190 191 /* Emu8k/Emu10k1 registers */ 191 s oundfont_voice_info_treg;192 struct soundfont_voice_info reg; 192 193 193 194 /* additional registers */ … … 230 231 * prototypes - interface to Emu10k1 and Emu8k routines 231 232 */ 232 int snd_emux_new(s nd_emux_t**remu);233 int snd_emux_register(s nd_emux_t *emu, snd_card_t*card, int index, char *name);234 int snd_emux_free(s nd_emux_t*emu);233 int snd_emux_new(struct snd_emux **remu); 234 int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, char *name); 235 int snd_emux_free(struct snd_emux *emu); 235 236 236 237 /* 237 238 * exported functions 238 239 */ 239 void snd_emux_terminate_all(s nd_emux_t*emu);240 void snd_emux_lock_voice(s nd_emux_t*emu, int voice);241 void snd_emux_unlock_voice(s nd_emux_t*emu, int voice);240 void snd_emux_terminate_all(struct snd_emux *emu); 241 void snd_emux_lock_voice(struct snd_emux *emu, int voice); 242 void snd_emux_unlock_voice(struct snd_emux *emu, int voice); 242 243 243 244 #endif /* __SOUND_EMUX_SYNTH_H */ -
GPL/trunk/alsa-kernel/include/sound/instr.h
r33 r34 42 42 43 43 /** container for sequencer instrument header */ 44 typedef struct snd rv_seq_instr_header snd_instr_header_t;44 typedef struct snd_seq_instr_header snd_instr_header_t; 45 45 46 46 size_t snd_instr_header_sizeof(void); -
GPL/trunk/alsa-kernel/include/sound/pcm-indirect.h
r33 r34 25 25 #include <sound/pcm.h> 26 26 27 typedef struct sndrv_pcm_indirect {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) */30 unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */31 unsigned int hw_io; /* Ring buffer hw pointer */32 int hw_ready; /* Bytes ready for play (or captured) in hw ring buffer */33 unsigned int sw_buffer_size; /* Byte size of software buffer */34 unsigned int sw_data; /* Offset to next dst (or src) in sw ring buffer */35 unsigned int sw_io; /* Current software pointer in bytes */36 int sw_ready; /* Bytes ready to be transferred to/from hw */37 snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */38 } snd_pcm_indirect_t;27 struct snd_pcm_indirect { 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) */ 30 unsigned int hw_data; /* Offset to next dst (or src) in hw ring buffer */ 31 unsigned int hw_io; /* Ring buffer hw pointer */ 32 int hw_ready; /* Bytes ready for play (or captured) in hw ring buffer */ 33 unsigned int sw_buffer_size; /* Byte size of software buffer */ 34 unsigned int sw_data; /* Offset to next dst (or src) in sw ring buffer */ 35 unsigned int sw_io; /* Current software pointer in bytes */ 36 int sw_ready; /* Bytes ready to be transferred to/from hw */ 37 snd_pcm_uframes_t appl_ptr; /* Last seen appl_ptr */ 38 }; 39 39 40 typedef void (*snd_pcm_indirect_copy_t)(s nd_pcm_substream_t*substream,41 snd_pcm_indirect_t *rec, size_t bytes);40 typedef void (*snd_pcm_indirect_copy_t)(struct snd_pcm_substream *substream, 41 struct snd_pcm_indirect *rec, size_t bytes); 42 42 43 43 /* … … 45 45 */ 46 46 static inline void 47 snd_pcm_indirect_playback_transfer(snd_pcm_substream_t*substream,48 snd_pcm_indirect_t *rec,49 snd_pcm_indirect_copy_t copy)47 snd_pcm_indirect_playback_transfer(struct snd_pcm_substream *substream, 48 struct snd_pcm_indirect *rec, 49 snd_pcm_indirect_copy_t copy) 50 50 { 51 snd_pcm_runtime_t*runtime = substream->runtime;52 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;53 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;54 int qsize;51 struct snd_pcm_runtime *runtime = substream->runtime; 52 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; 53 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; 54 int qsize; 55 55 56 if (diff) {57 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))58 diff += runtime->boundary;59 rec->sw_ready += (int)frames_to_bytes(runtime, diff);60 rec->appl_ptr = appl_ptr;61 }62 qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size;63 while (rec->hw_ready < qsize && rec->sw_ready > 0) {64 unsigned int hw_to_end = rec->hw_buffer_size - rec->hw_data;65 unsigned int sw_to_end = rec->sw_buffer_size - rec->sw_data;66 unsigned int bytes = qsize - rec->hw_ready;67 if (rec->sw_ready < (int)bytes)68 bytes = rec->sw_ready;69 if (hw_to_end < bytes)70 bytes = hw_to_end;71 if (sw_to_end < bytes)72 bytes = sw_to_end;73 if (! bytes)74 break;75 copy(substream, rec, bytes);76 rec->hw_data += bytes;77 if (rec->hw_data == rec->hw_buffer_size)78 rec->hw_data = 0;79 rec->sw_data += bytes;80 if (rec->sw_data == rec->sw_buffer_size)81 rec->sw_data = 0;82 rec->hw_ready += bytes;83 rec->sw_ready -= bytes;84 }56 if (diff) { 57 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) 58 diff += runtime->boundary; 59 rec->sw_ready += (int)frames_to_bytes(runtime, diff); 60 rec->appl_ptr = appl_ptr; 61 } 62 qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size; 63 while (rec->hw_ready < qsize && rec->sw_ready > 0) { 64 unsigned int hw_to_end = rec->hw_buffer_size - rec->hw_data; 65 unsigned int sw_to_end = rec->sw_buffer_size - rec->sw_data; 66 unsigned int bytes = qsize - rec->hw_ready; 67 if (rec->sw_ready < (int)bytes) 68 bytes = rec->sw_ready; 69 if (hw_to_end < bytes) 70 bytes = hw_to_end; 71 if (sw_to_end < bytes) 72 bytes = sw_to_end; 73 if (! bytes) 74 break; 75 copy(substream, rec, bytes); 76 rec->hw_data += bytes; 77 if (rec->hw_data == rec->hw_buffer_size) 78 rec->hw_data = 0; 79 rec->sw_data += bytes; 80 if (rec->sw_data == rec->sw_buffer_size) 81 rec->sw_data = 0; 82 rec->hw_ready += bytes; 83 rec->sw_ready -= bytes; 84 } 85 85 } 86 86 … … 90 90 */ 91 91 static inline snd_pcm_uframes_t 92 snd_pcm_indirect_playback_pointer(s nd_pcm_substream_t*substream,93 snd_pcm_indirect_t *rec, unsigned int ptr)92 snd_pcm_indirect_playback_pointer(struct snd_pcm_substream *substream, 93 struct snd_pcm_indirect *rec, unsigned int ptr) 94 94 { 95 int bytes = ptr - rec->hw_io;96 if (bytes < 0)97 bytes += rec->hw_buffer_size;98 rec->hw_io = ptr;99 rec->hw_ready -= bytes;100 rec->sw_io += bytes;101 if (rec->sw_io >= rec->sw_buffer_size)102 rec->sw_io -= rec->sw_buffer_size;103 if (substream->ops->ack)104 substream->ops->ack(substream);105 return bytes_to_frames(substream->runtime, rec->sw_io);95 int bytes = ptr - rec->hw_io; 96 if (bytes < 0) 97 bytes += rec->hw_buffer_size; 98 rec->hw_io = ptr; 99 rec->hw_ready -= bytes; 100 rec->sw_io += bytes; 101 if (rec->sw_io >= rec->sw_buffer_size) 102 rec->sw_io -= rec->sw_buffer_size; 103 if (substream->ops->ack) 104 substream->ops->ack(substream); 105 return bytes_to_frames(substream->runtime, rec->sw_io); 106 106 } 107 107 … … 111 111 */ 112 112 static inline void 113 snd_pcm_indirect_capture_transfer(s nd_pcm_substream_t*substream,114 snd_pcm_indirect_t *rec,115 snd_pcm_indirect_copy_t copy)113 snd_pcm_indirect_capture_transfer(struct snd_pcm_substream *substream, 114 struct snd_pcm_indirect *rec, 115 snd_pcm_indirect_copy_t copy) 116 116 { 117 snd_pcm_runtime_t*runtime = substream->runtime;118 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr;119 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr;117 struct snd_pcm_runtime *runtime = substream->runtime; 118 snd_pcm_uframes_t appl_ptr = runtime->control->appl_ptr; 119 snd_pcm_sframes_t diff = appl_ptr - rec->appl_ptr; 120 120 121 if (diff) {122 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2))123 diff += runtime->boundary;124 rec->sw_ready -= frames_to_bytes(runtime, diff);125 rec->appl_ptr = appl_ptr;126 }127 while (rec->hw_ready > 0 && 128 rec->sw_ready < (int)rec->sw_buffer_size) {129 size_t hw_to_end = rec->hw_buffer_size - rec->hw_data;130 size_t sw_to_end = rec->sw_buffer_size - rec->sw_data;131 size_t bytes = rec->sw_buffer_size - rec->sw_ready;132 if (rec->hw_ready < (int)bytes)133 bytes = rec->hw_ready;134 if (hw_to_end < bytes)135 bytes = hw_to_end;136 if (sw_to_end < bytes)137 bytes = sw_to_end;138 if (! bytes)139 break;140 copy(substream, rec, bytes);141 rec->hw_data += bytes;142 if ((int)rec->hw_data == rec->hw_buffer_size)143 rec->hw_data = 0;144 rec->sw_data += bytes;145 if (rec->sw_data == rec->sw_buffer_size)146 rec->sw_data = 0;147 rec->hw_ready -= bytes;148 rec->sw_ready += bytes;149 }121 if (diff) { 122 if (diff < -(snd_pcm_sframes_t) (runtime->boundary / 2)) 123 diff += runtime->boundary; 124 rec->sw_ready -= frames_to_bytes(runtime, diff); 125 rec->appl_ptr = appl_ptr; 126 } 127 while (rec->hw_ready > 0 && 128 rec->sw_ready < (int)rec->sw_buffer_size) { 129 size_t hw_to_end = rec->hw_buffer_size - rec->hw_data; 130 size_t sw_to_end = rec->sw_buffer_size - rec->sw_data; 131 size_t bytes = rec->sw_buffer_size - rec->sw_ready; 132 if (rec->hw_ready < (int)bytes) 133 bytes = rec->hw_ready; 134 if (hw_to_end < bytes) 135 bytes = hw_to_end; 136 if (sw_to_end < bytes) 137 bytes = sw_to_end; 138 if (! bytes) 139 break; 140 copy(substream, rec, bytes); 141 rec->hw_data += bytes; 142 if ((int)rec->hw_data == rec->hw_buffer_size) 143 rec->hw_data = 0; 144 rec->sw_data += bytes; 145 if (rec->sw_data == rec->sw_buffer_size) 146 rec->sw_data = 0; 147 rec->hw_ready -= bytes; 148 rec->sw_ready += bytes; 149 } 150 150 } 151 151 … … 155 155 */ 156 156 static inline snd_pcm_uframes_t 157 snd_pcm_indirect_capture_pointer(s nd_pcm_substream_t*substream,158 snd_pcm_indirect_t *rec, unsigned int ptr)157 snd_pcm_indirect_capture_pointer(struct snd_pcm_substream *substream, 158 struct snd_pcm_indirect *rec, unsigned int ptr) 159 159 { 160 int qsize;161 int bytes = ptr - rec->hw_io;162 if (bytes < 0)163 bytes += rec->hw_buffer_size;164 rec->hw_io = ptr;165 rec->hw_ready += bytes;166 qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size;167 if (rec->hw_ready > qsize)168 return SNDRV_PCM_POS_XRUN;169 rec->sw_io += bytes;170 if (rec->sw_io >= rec->sw_buffer_size)171 rec->sw_io -= rec->sw_buffer_size;172 if (substream->ops->ack)173 substream->ops->ack(substream);174 return bytes_to_frames(substream->runtime, rec->sw_io);160 int qsize; 161 int bytes = ptr - rec->hw_io; 162 if (bytes < 0) 163 bytes += rec->hw_buffer_size; 164 rec->hw_io = ptr; 165 rec->hw_ready += bytes; 166 qsize = rec->hw_queue_size ? rec->hw_queue_size : rec->hw_buffer_size; 167 if (rec->hw_ready > qsize) 168 return SNDRV_PCM_POS_XRUN; 169 rec->sw_io += bytes; 170 if (rec->sw_io >= rec->sw_buffer_size) 171 rec->sw_io -= rec->sw_buffer_size; 172 if (substream->ops->ack) 173 substream->ops->ack(substream); 174 return bytes_to_frames(substream->runtime, rec->sw_io); 175 175 } 176 176 -
GPL/trunk/alsa-kernel/include/sound/seq_midi_event.h
r33 r34 1 #ifndef __SOUND_SEQ_MIDI_EVENT_H 2 #define __SOUND_SEQ_MIDI_EVENT_H 3 1 4 /* 2 5 * MIDI byte <-> sequencer event coder … … 17 20 * You should have received a copy of the GNU General Public License 18 21 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 23 */ 21 22 #ifndef __MIDI_CODER_H23 #define __MIDI_CODER_H24 24 25 25 #include "asequencer.h" … … 27 27 #define MAX_MIDI_EVENT_BUF 256 28 28 29 typedef struct snd_midi_event_t snd_midi_event_t;30 31 29 /* midi status */ 32 struct snd_midi_event_t { 33 int qlen; /* queue length */ 34 int read; /* chars read */ 35 int type; /* current event type */ 36 unsigned char lastcmd; 37 int bufsize; 30 struct snd_midi_event { 31 int qlen; /* queue length */ 32 int read; /* chars read */ 33 int type; /* current event type */ 34 unsigned char lastcmd; /* last command (for MIDI state handling) */ 35 unsigned char nostat; /* no state flag */ 36 int bufsize; /* allocated buffer size */ 38 37 unsigned char *buf; /* input buffer */ 39 38 spinlock_t lock; 40 39 }; 41 40 42 int snd_midi_event_new(int bufsize, snd_midi_event_t **rdev); 43 int snd_midi_event_resize_buffer(snd_midi_event_t *dev, int bufsize); 44 void snd_midi_event_free(snd_midi_event_t *dev); 45 void snd_midi_event_init(snd_midi_event_t *dev); 46 void snd_midi_event_reset_encode(snd_midi_event_t *dev); 47 void snd_midi_event_reset_decode(snd_midi_event_t *dev); 41 int snd_midi_event_new(int bufsize, struct snd_midi_event **rdev); 42 void snd_midi_event_free(struct snd_midi_event *dev); 43 void snd_midi_event_reset_encode(struct snd_midi_event *dev); 44 void snd_midi_event_reset_decode(struct snd_midi_event *dev); 45 void snd_midi_event_no_status(struct snd_midi_event *dev, int on); 48 46 /* encode from byte stream - return number of written bytes if success */ 49 long snd_midi_event_encode(snd_midi_event_t *dev, unsigned char *buf, long count, snd_seq_event_t *ev); 50 int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev); 47 long snd_midi_event_encode(struct snd_midi_event *dev, unsigned char *buf, long count, 48 struct snd_seq_event *ev); 49 int snd_midi_event_encode_byte(struct snd_midi_event *dev, int c, struct snd_seq_event *ev); 51 50 /* decode from event to bytes - return number of written bytes if success */ 52 long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, snd_seq_event_t *ev); 51 long snd_midi_event_decode(struct snd_midi_event *dev, unsigned char *buf, long count, 52 struct snd_seq_event *ev); 53 53 54 #endif 54 #endif /* __SOUND_SEQ_MIDI_EVENT_H */ -
GPL/trunk/alsa-kernel/include/sound/seq_virmidi.h
r33 r34 1 #ifndef __S EQ_VIRMIDI_H2 #define __S EQ_VIRMIDI_H1 #ifndef __SOUND_SEQ_VIRMIDI_H 2 #define __SOUND_SEQ_VIRMIDI_H 3 3 4 4 /* … … 19 19 * You should have received a copy of the GNU General Public License 20 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 22 * 23 23 */ … … 25 25 #include "rawmidi.h" 26 26 #include "seq_midi_event.h" 27 28 typedef struct _snd_virmidi_dev snd_virmidi_dev_t;29 27 30 28 /* … … 34 32 * (buffer), and is associated with the device instance. 35 33 */ 36 typedef struct _snd_virmidi {34 struct snd_virmidi { 37 35 struct list_head list; 38 36 int seq_mode; 39 37 int client; 40 38 int port; 41 int trigger: 1;42 s nd_midi_event_t *parser;43 s nd_seq_event_t event;44 s nd_virmidi_dev_t*rdev;45 s nd_rawmidi_substream_t*substream;46 } snd_virmidi_t;39 unsigned int trigger: 1; 40 struct snd_midi_event *parser; 41 struct snd_seq_event event; 42 struct snd_virmidi_dev *rdev; 43 struct snd_rawmidi_substream *substream; 44 }; 47 45 48 #define SNDRV_VIRMIDI_SUBSCRIBE (1<<0)46 #define SNDRV_VIRMIDI_SUBSCRIBE (1<<0) 49 47 #define SNDRV_VIRMIDI_USE (1<<1) 50 48 … … 54 52 * common information and the linked-list of opened files, 55 53 */ 56 struct _snd_virmidi_dev {57 s nd_card_t*card; /* associated card */58 s nd_rawmidi_t*rmidi; /* rawmidi device */54 struct snd_virmidi_dev { 55 struct snd_card *card; /* associated card */ 56 struct snd_rawmidi *rmidi; /* rawmidi device */ 59 57 int seq_mode; /* SNDRV_VIRMIDI_XXX */ 60 58 int device; /* sequencer device */ … … 70 68 * attached sequencer port. sequencer port is not created 71 69 * by virmidi itself. 70 * the input to rawmidi must be processed by passing the 71 * incoming events via snd_virmidi_receive() 72 72 * DISPATCH = input/output events are routed to subscribers. 73 73 * sequencer port is created in virmidi. 74 74 */ 75 75 #define SNDRV_VIRMIDI_SEQ_NONE 0 76 #define SNDRV_VIRMIDI_SEQ_ATTACH 176 #define SNDRV_VIRMIDI_SEQ_ATTACH 1 77 77 #define SNDRV_VIRMIDI_SEQ_DISPATCH 2 78 78 79 int snd_virmidi_new(s nd_card_t *card, int device, snd_rawmidi_t**rrmidi);79 int snd_virmidi_new(struct snd_card *card, int device, struct snd_rawmidi **rrmidi); 80 80 81 #endif 81 #endif /* __SOUND_SEQ_VIRMIDI */ -
GPL/trunk/alsa-kernel/include/sound/sfnt_info.h
r33 r34 1 #ifndef __SOUND_SFNT_INFO_H 2 #define __SOUND_SFNT_INFO_H 3 1 4 /* 2 5 * Patch record compatible with AWE driver on OSS … … 16 19 * You should have received a copy of the GNU General Public License 17 20 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 * 20 */ 21 22 #ifndef __SFNT_INFO_H 23 #define __SFNT_INFO_H 24 25 #include "seq_oss_legacy.h" 21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 * 23 */ 24 25 #include <sound/asound.h> 26 26 27 27 /* … … 29 29 */ 30 30 31 #ifdef SNDRV_BIG_ENDIAN 32 #define SNDRV_OSS_PATCHKEY(id) (0xfd00|id) 33 #else 34 #define SNDRV_OSS_PATCHKEY(id) ((id<<8)|0xfd) 35 #endif 36 31 37 /* patch interface header: 16 bytes */ 32 typedef struct soundfont_patch_info_t{38 struct soundfont_patch_info { 33 39 unsigned short key; /* use the key below */ 34 #define SNDRV_OSS_SOUNDFONT_PATCH _PATCHKEY(0x07)40 #define SNDRV_OSS_SOUNDFONT_PATCH SNDRV_OSS_PATCHKEY(0x07) 35 41 36 42 short device_no; /* synthesizer number */ … … 54 60 55 61 /* the actual patch data begins after this */ 56 } soundfont_patch_info_t;62 }; 57 63 58 64 … … 63 69 #define SNDRV_SFNT_PATCH_NAME_LEN 32 64 70 65 typedef struct soundfont_open_parm_t{71 struct soundfont_open_parm { 66 72 unsigned short type; /* sample type */ 67 73 #define SNDRV_SFNT_PAT_TYPE_MISC 0 … … 73 79 short reserved; 74 80 char name[SNDRV_SFNT_PATCH_NAME_LEN]; 75 } soundfont_open_parm_t;81 }; 76 82 77 83 … … 81 87 82 88 /* wave table envelope & effect parameters to control EMU8000 */ 83 typedef struct soundfont_voice_parm_t{89 struct soundfont_voice_parm { 84 90 unsigned short moddelay; /* modulation delay (0x8000) */ 85 91 unsigned short modatkhld; /* modulation attack & hold time (0x7f7f) */ … … 103 109 unsigned char reverb; /* reverb send (0x00) */ 104 110 unsigned short reserved[4]; /* not used */ 105 } soundfont_voice_parm_t;111 }; 106 112 107 113 108 114 /* wave table parameters: 92 bytes */ 109 typedef struct soundfont_voice_info_t{115 struct soundfont_voice_info { 110 116 unsigned short sf_id; /* file id (should be zero) */ 111 117 unsigned short sample; /* sample id */ … … 130 136 unsigned char attenuation; /* attenuation (0.375dB) */ 131 137 short scaleTuning; /* pitch scale tuning(%), normally 100 */ 132 s oundfont_voice_parm_tparm; /* voice envelope parameters */138 struct soundfont_voice_parm parm; /* voice envelope parameters */ 133 139 unsigned short sample_mode; /* sample mode_flag (set by driver) */ 134 } soundfont_voice_info_t;140 }; 135 141 136 142 137 143 /* instrument info header: 4 bytes */ 138 typedef struct soundfont_voice_rec_hdr_t{144 struct soundfont_voice_rec_hdr { 139 145 unsigned char bank; /* midi bank number */ 140 146 unsigned char instr; /* midi preset number */ … … 144 150 #define SNDRV_SFNT_WR_EXCLUSIVE 1 /* skip if already exists */ 145 151 #define SNDRV_SFNT_WR_REPLACE 2 /* replace if already exists */ 146 } soundfont_voice_rec_hdr_t;152 }; 147 153 148 154 … … 152 158 153 159 /* wave table sample header: 32 bytes */ 154 typedef struct soundfont_sample_info_t{160 struct soundfont_sample_info { 155 161 unsigned short sf_id; /* file id (should be zero) */ 156 162 unsigned short sample; /* sample id */ … … 169 175 #define SNDRV_SFNT_SAMPLE_REVERSE_LOOP 128 /* reverse looping */ 170 176 unsigned int truesize; /* used memory size (set by driver) */ 171 } soundfont_sample_info_t;177 }; 172 178 173 179 … … 176 182 */ 177 183 178 typedef struct soundfont_voice_map_t{184 struct soundfont_voice_map { 179 185 int map_bank, map_instr, map_key; /* key = -1 means all keys */ 180 186 int src_bank, src_instr, src_key; 181 } soundfont_voice_map_t; 182 183 184 #endif 187 }; 188 189 190 /* 191 * ioctls for hwdep 192 */ 193 194 #define SNDRV_EMUX_HWDEP_NAME "Emux WaveTable" 195 196 #define SNDRV_EMUX_VERSION ((1 << 16) | (0 << 8) | 0) /* 1.0.0 */ 197 198 struct snd_emux_misc_mode { 199 int port; /* -1 = all */ 200 int mode; 201 int value; 202 int value2; /* reserved */ 203 }; 204 205 enum { 206 SNDRV_EMUX_IOCTL_VERSION = _IOR('H', 0x80, unsigned int), 207 SNDRV_EMUX_IOCTL_LOAD_PATCH = _IOWR('H', 0x81, struct soundfont_patch_info), 208 SNDRV_EMUX_IOCTL_RESET_SAMPLES = _IO('H', 0x82), 209 SNDRV_EMUX_IOCTL_REMOVE_LAST_SAMPLES = _IO('H', 0x83), 210 SNDRV_EMUX_IOCTL_MEM_AVAIL = _IOW('H', 0x84, int), 211 SNDRV_EMUX_IOCTL_MISC_MODE = _IOWR('H', 0x84, struct snd_emux_misc_mode), 212 }; 213 214 #endif /* __SOUND_SFNT_INFO_H */ -
GPL/trunk/alsa-kernel/include/sound/soundfont.h
r33 r34 1 #ifndef __SOUND_SOUNDFONT_H 2 #define __SOUND_SOUNDFONT_H 3 1 4 /* 2 5 * Soundfont defines and definitions. … … 17 20 * You should have received a copy of the GNU General Public License 18 21 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 23 */ 21 22 #ifndef __SOUNDFONT_H23 #define __SOUNDFONT_H24 24 25 25 #include "sfnt_info.h" … … 30 30 #define SF_IS_DRUM_BANK(z) ((z) == 128) 31 31 32 typedefstruct snd_sf_zone {32 struct snd_sf_zone { 33 33 struct snd_sf_zone *next; /* Link to next */ 34 34 unsigned char bank; /* Midi bank for this zone */ … … 36 36 unsigned char mapped; /* True if mapped to something else */ 37 37 38 s oundfont_voice_info_tv; /* All the soundfont parameters */38 struct soundfont_voice_info v; /* All the soundfont parameters */ 39 39 int counter; 40 40 struct snd_sf_sample *sample; /* Link to sample */ … … 43 43 struct snd_sf_zone *next_instr; /* Next zone of this instrument */ 44 44 struct snd_sf_zone *next_zone; /* Next zone in play list */ 45 } snd_sf_zone_t;45 }; 46 46 47 typedefstruct snd_sf_sample {48 s oundfont_sample_info_tv;47 struct snd_sf_sample { 48 struct soundfont_sample_info v; 49 49 int counter; 50 s nd_util_memblk_t*block; /* allocated data block */50 struct snd_util_memblk *block; /* allocated data block */ 51 51 struct snd_sf_sample *next; 52 } snd_sf_sample_t;52 }; 53 53 54 54 /* 55 55 * This represents all the information relating to a soundfont. 56 56 */ 57 typedefstruct snd_soundfont {57 struct snd_soundfont { 58 58 struct snd_soundfont *next; /* Link to next */ 59 59 /*struct snd_soundfont *prev;*/ /* Link to previous */ … … 61 61 short type; /* font type */ 62 62 unsigned char name[SNDRV_SFNT_PATCH_NAME_LEN]; /* identifier */ 63 s nd_sf_zone_t*zones; /* Font information */64 s nd_sf_sample_t*samples; /* The sample headers */65 } snd_soundfont_t;63 struct snd_sf_zone *zones; /* Font information */ 64 struct snd_sf_sample *samples; /* The sample headers */ 65 }; 66 66 67 67 /* 68 68 * Type of the sample access callback 69 69 */ 70 typedef int (*snd_sf_sample_new_t)(void *private_data, snd_sf_sample_t *sp, 71 snd_util_memhdr_t *hdr, const void *buf, long count); 72 typedef int (*snd_sf_sample_free_t)(void *private_data, snd_sf_sample_t *sp, 73 snd_util_memhdr_t *hdr); 74 typedef void (*snd_sf_sample_reset_t)(void *private); 75 76 typedef struct snd_sf_callback { 70 struct snd_sf_callback { 77 71 void *private_data; 78 snd_sf_sample_new_t sample_new; 79 snd_sf_sample_free_t sample_free; 80 snd_sf_sample_reset_t sample_reset; 81 } snd_sf_callback_t; 72 int (*sample_new)(void *private_data, struct snd_sf_sample *sp, 73 struct snd_util_memhdr *hdr, 74 const void __user *buf, long count); 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 81 * List of soundfonts. 85 82 */ 86 typedefstruct snd_sf_list {87 s nd_soundfont_t *currsf; /* The currently open soundfont */83 struct snd_sf_list { 84 struct snd_soundfont *currsf; /* The currently open soundfont */ 88 85 int open_client; /* client pointer for lock */ 89 86 int mem_used; /* used memory size */ 90 s nd_sf_zone_t*presets[SF_MAX_PRESETS];91 s nd_soundfont_t *fonts; /* The list of soundfonts */87 struct snd_sf_zone *presets[SF_MAX_PRESETS]; 88 struct snd_soundfont *fonts; /* The list of soundfonts */ 92 89 int fonts_size; /* number of fonts allocated */ 93 90 int zone_counter; /* last allocated time for zone */ … … 95 92 int zone_locked; /* locked time for zone */ 96 93 int sample_locked; /* locked time for sample */ 97 s nd_sf_callback_tcallback; /* callback functions */98 char sf_locked; /* font lock flag */94 struct snd_sf_callback callback; /* callback functions */ 95 int presets_locked; 99 96 struct semaphore presets_mutex; 100 97 spinlock_t lock; 101 s nd_util_memhdr_t*memhdr;102 } snd_sf_list_t;98 struct snd_util_memhdr *memhdr; 99 }; 103 100 104 101 /* Prototypes for soundfont.c */ 105 int snd_soundfont_load(snd_sf_list_t *sflist, const void *data, long count, int client); 106 int snd_soundfont_load_guspatch(snd_sf_list_t *sflist, const char *data, 102 int snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data, 103 long count, int client); 104 int snd_soundfont_load_guspatch(struct snd_sf_list *sflist, const char __user *data, 107 105 long count, int client); 108 int snd_soundfont_close_check(s nd_sf_list_t *sflist, int client);106 int snd_soundfont_close_check(struct snd_sf_list *sflist, int client); 109 107 110 snd_sf_list_t *snd_sf_new(snd_sf_callback_t *callback, snd_util_memhdr_t *hdr); 111 void snd_sf_free(snd_sf_list_t *sflist); 108 struct snd_sf_list *snd_sf_new(struct snd_sf_callback *callback, 109 struct snd_util_memhdr *hdr); 110 void snd_sf_free(struct snd_sf_list *sflist); 112 111 113 int snd_soundfont_remove_samples(snd_sf_list_t *sflist); 114 int snd_soundfont_remove_unlocked(snd_sf_list_t *sflist); 115 int snd_soundfont_mem_used(snd_sf_list_t *sflist); 112 int snd_soundfont_remove_samples(struct snd_sf_list *sflist); 113 int snd_soundfont_remove_unlocked(struct snd_sf_list *sflist); 116 114 117 int snd_soundfont_search_zone(s nd_sf_list_t *sflist, int *notep, int vel,115 int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel, 118 116 int preset, int bank, 119 117 int def_preset, int def_bank, 120 s nd_sf_zone_t**table, int max_layers);118 struct snd_sf_zone **table, int max_layers); 121 119 122 120 /* Parameter conversions */ … … 126 124 #define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725); 127 125 extern int snd_sf_vol_table[128]; 126 int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio); 128 127 129 128 130 #endif 129 #endif /* __SOUND_SOUNDFONT_H */ -
GPL/trunk/alsa-kernel/include/sound/trident.h
r33 r34 34 34 #include "ainstr_simple.h" 35 35 36 #ifndef PCI_ VENDOR_ID_TRIDENT37 #define PCI_ VENDOR_ID_TRIDENT 0x102336 #ifndef PCI_DEVICE_ID_SI_7018 37 #define PCI_DEVICE_ID_SI_7018 0x7018 38 38 #endif 39 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 40 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x200039 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 40 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 41 41 #endif 42 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 43 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 44 #endif 45 46 #ifndef PCI_VENDOR_ID_SI 47 #define PCI_VENDOR_ID_SI 0x1039 48 #endif 49 #ifndef PCI_DEVICE_ID_SI_7018 50 #define PCI_DEVICE_ID_SI_7018 0x7018 42 #ifndef PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 43 #define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 51 44 #endif 52 45 … … 263 256 SI_AC97_POWERDOWN = 0x04000000, 264 257 }; 265 258 266 259 /* PCM defaults */ 267 260 … … 271 264 #define T4D_DEFAULT_PCM_CVOL 127 /* 0 - 127 */ 272 265 273 typedef struct _snd_trident trident_t;274 typedef struct _snd_trident_voice snd_trident_voice_t;275 typedef struct _snd_trident_pcm_mixer snd_trident_pcm_mixer_t;276 277 typedef struct{278 void (*sample_start)( trident_t *gus, snd_trident_voice_t*voice, snd_seq_position_t position);279 void (*sample_stop)( trident_t *gus, snd_trident_voice_t *voice, snd_seq_stop_mode_t mode);280 void (*sample_freq)( trident_t *gus, snd_trident_voice_t*voice, snd_seq_frequency_t freq);281 void (*sample_volume)( trident_t *gus, snd_trident_voice_t *voice, snd_seq_ev_volume_t*volume);282 void (*sample_loop)( trident_t *card, snd_trident_voice_t *voice, snd_seq_ev_loop_t*loop);283 void (*sample_pos)( trident_t *card, snd_trident_voice_t*voice, snd_seq_position_t position);284 void (*sample_private1)( trident_t *card, snd_trident_voice_t*voice, unsigned char *data);285 } snd_trident_sample_ops_t;286 287 typedef struct {288 s nd_midi_channel_set_t * chset;289 trident_t * trident;266 struct snd_trident; 267 struct snd_trident_voice; 268 struct snd_trident_pcm_mixer; 269 270 struct snd_trident_sample_ops { 271 void (*sample_start)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_position_t position); 272 void (*sample_stop)(struct snd_trident *gus, struct snd_trident_voice *voice, int mode); 273 void (*sample_freq)(struct snd_trident *gus, struct snd_trident_voice *voice, snd_seq_frequency_t freq); 274 void (*sample_volume)(struct snd_trident *gus, struct snd_trident_voice *voice, struct snd_seq_ev_volume *volume); 275 void (*sample_loop)(struct snd_trident *card, struct snd_trident_voice *voice, struct snd_seq_ev_loop *loop); 276 void (*sample_pos)(struct snd_trident *card, struct snd_trident_voice *voice, snd_seq_position_t position); 277 void (*sample_private1)(struct snd_trident *card, struct snd_trident_voice *voice, unsigned char *data); 278 }; 279 280 struct snd_trident_port { 281 struct snd_midi_channel_set * chset; 282 struct snd_trident * trident; 290 283 int mode; /* operation mode */ 291 284 int client; /* sequencer client number */ 292 285 int port; /* sequencer port number */ 293 int midi_has_voices: 1;294 } snd_trident_port_t;295 296 typedefstruct snd_trident_memblk_arg {286 unsigned int midi_has_voices: 1; 287 }; 288 289 struct snd_trident_memblk_arg { 297 290 short first_page, last_page; 298 } snd_trident_memblk_arg_t;299 300 typedef struct{291 }; 292 293 struct snd_trident_tlb { 301 294 unsigned int * entries; /* 16k-aligned TLB table */ 302 295 dma_addr_t entries_dmaaddr; /* 16k-aligned PCI address to TLB table */ 303 unsigned long * shadow_entries; /* shadow entries with virtual addresses */304 struct snd_dma_buffer buffer;305 snd_util_memhdr_t* memhdr; /* page allocation list */306 struct snd_dma_buffer silent_page;307 } snd_trident_tlb_t;308 309 struct _snd_trident_voice {296 unsigned long * shadow_entries; /* shadow entries with virtual addresses */ 297 struct snd_dma_buffer buffer; 298 struct snd_util_memhdr * memhdr; /* page allocation list */ 299 struct snd_dma_buffer silent_page; 300 }; 301 302 struct snd_trident_voice { 310 303 unsigned int number; 311 int use: 1,304 unsigned int use: 1, 312 305 pcm: 1, 313 306 synth:1, … … 318 311 unsigned char index; 319 312 320 s nd_seq_instr_tinstr;321 s nd_trident_sample_ops_t*sample_ops;313 struct snd_seq_instr instr; 314 struct snd_trident_sample_ops *sample_ops; 322 315 323 316 /* channel parameters */ … … 341 334 unsigned int negCSO; /* nonzero - use negative CSO */ 342 335 343 s nd_util_memblk_t*memblk; /* memory block if TLB enabled */336 struct snd_util_memblk *memblk; /* memory block if TLB enabled */ 344 337 345 338 /* PCM data */ 346 339 347 trident_t *trident;348 s nd_pcm_substream_t*substream;349 s nd_trident_voice_t*extra; /* extra PCM voice (acts as interrupt generator) */350 int running: 1,340 struct snd_trident *trident; 341 struct snd_pcm_substream *substream; 342 struct snd_trident_voice *extra; /* extra PCM voice (acts as interrupt generator) */ 343 unsigned int running: 1, 351 344 capture: 1, 352 345 spdif: 1, … … 365 358 366 359 void *private_data; 367 void (*private_free)(s nd_trident_voice_t*voice);368 }; 369 370 struct _snd_4dwave {360 void (*private_free)(struct snd_trident_voice *voice); 361 }; 362 363 struct snd_4dwave { 371 364 int seq_client; 372 365 373 s nd_trident_port_t seq_ports[4];374 s nd_simple_ops_tsimple_ops;375 s nd_seq_kinstr_list_t *ilist;376 377 s nd_trident_voice_tvoices[64];366 struct snd_trident_port seq_ports[4]; 367 struct snd_simple_ops simple_ops; 368 struct snd_seq_kinstr_list *ilist; 369 370 struct snd_trident_voice voices[64]; 378 371 379 372 int ChanSynthCount; /* number of allocated synth channels */ … … 382 375 }; 383 376 384 struct _snd_trident_pcm_mixer {385 s nd_trident_voice_t*voice; /* active voice */377 struct snd_trident_pcm_mixer { 378 struct snd_trident_voice *voice; /* active voice */ 386 379 unsigned short vol; /* front volume */ 387 380 unsigned char pan; /* pan control */ … … 391 384 }; 392 385 393 struct _snd_trident {386 struct snd_trident { 394 387 int irq; 395 388 … … 404 397 unsigned int spurious_irq_max_delta; 405 398 406 s nd_trident_tlb_ttlb; /* TLB entries for NX cards */399 struct snd_trident_tlb tlb; /* TLB entries for NX cards */ 407 400 408 401 unsigned char spdif_ctrl; … … 410 403 unsigned int spdif_bits; 411 404 unsigned int spdif_pcm_bits; 412 s nd_kcontrol_t*spdif_pcm_ctl; /* S/PDIF settings */405 struct snd_kcontrol *spdif_pcm_ctl; /* S/PDIF settings */ 413 406 unsigned int ac97_ctrl; 414 407 … … 421 414 unsigned int in_suspend: 1; /* 1 during suspend/resume */ 422 415 423 struct _snd_4dwave synth; /* synth specific variables */416 struct snd_4dwave synth; /* synth specific variables */ 424 417 425 418 spinlock_t event_lock; 426 419 spinlock_t voice_alloc; 427 420 428 struct snd_dma_device dma_dev; 421 struct snd_dma_device dma_dev; 422 429 423 struct pci_dev *pci; 430 s nd_card_t*card;431 s nd_pcm_t*pcm; /* ADC/DAC PCM */432 s nd_pcm_t*foldback; /* Foldback PCM */433 s nd_pcm_t*spdif; /* SPDIF PCM */434 s nd_rawmidi_t*rmidi;435 s nd_seq_device_t*seq_dev;436 437 ac97_bus_t*ac97_bus;438 ac97_t*ac97;439 ac97_t*ac97_sec;424 struct snd_card *card; 425 struct snd_pcm *pcm; /* ADC/DAC PCM */ 426 struct snd_pcm *foldback; /* Foldback PCM */ 427 struct snd_pcm *spdif; /* SPDIF PCM */ 428 struct snd_rawmidi *rmidi; 429 struct snd_seq_device *seq_dev; 430 431 struct snd_ac97_bus *ac97_bus; 432 struct snd_ac97 *ac97; 433 struct snd_ac97 *ac97_sec; 440 434 441 435 unsigned int musicvol_wavevol; 442 s nd_trident_pcm_mixer_tpcm_mixer[32];443 s nd_kcontrol_t*ctl_vol; /* front volume */444 s nd_kcontrol_t*ctl_pan; /* pan */445 s nd_kcontrol_t*ctl_rvol; /* rear volume */446 s nd_kcontrol_t*ctl_cvol; /* center volume */436 struct snd_trident_pcm_mixer pcm_mixer[32]; 437 struct snd_kcontrol *ctl_vol; /* front volume */ 438 struct snd_kcontrol *ctl_pan; /* pan */ 439 struct snd_kcontrol *ctl_rvol; /* rear volume */ 440 struct snd_kcontrol *ctl_cvol; /* center volume */ 447 441 448 442 spinlock_t reg_lock; 449 443 450 struct snd_trident_gameport *gameport;451 }; 452 453 int snd_trident_create(s nd_card_t *card,444 struct gameport *gameport; 445 }; 446 447 int snd_trident_create(struct snd_card *card, 454 448 struct pci_dev *pci, 455 449 int pcm_streams, 456 450 int pcm_spdif_device, 457 451 int max_wavetable_size, 458 trident_t ** rtrident);459 int snd_trident_ free(trident_t *trident);460 void snd_trident_gameport(trident_t *trident); 461 462 int snd_trident_ pcm(trident_t * trident, int device, snd_pcm_t**rpcm);463 int snd_trident_ foldback_pcm(trident_t * trident, int device, snd_pcm_t**rpcm);464 int snd_trident_ spdif_pcm(trident_t * trident, int device, snd_pcm_t **rpcm);465 int snd_trident_attach_synthesizer(trident_t * trident); 466 int snd_trident_detach_synthesizer(trident_t * trident);467 snd_trident_voice_t *snd_trident_alloc_voice(trident_t * trident, int type, int client, int port);468 void snd_trident_ free_voice(trident_t * trident, snd_trident_voice_t *voice);469 void snd_trident_st art_voice(trident_t * trident, unsigned int voice);470 void snd_trident_ stop_voice(trident_t * trident, unsigned intvoice);471 void snd_trident_write_voice_regs(trident_t * trident, snd_trident_voice_t *voice);472 void snd_trident_clear_voices(trident_t * trident, unsigned short v_min, unsigned short v_max);452 struct snd_trident ** rtrident); 453 int snd_trident_create_gameport(struct snd_trident *trident); 454 455 int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 456 int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 457 int snd_trident_spdif_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm); 458 int snd_trident_attach_synthesizer(struct snd_trident * trident); 459 struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident, int type, 460 int client, int port); 461 void snd_trident_free_voice(struct snd_trident * trident, struct snd_trident_voice *voice); 462 void snd_trident_start_voice(struct snd_trident * trident, unsigned int voice); 463 void snd_trident_stop_voice(struct snd_trident * trident, unsigned int voice); 464 void snd_trident_write_voice_regs(struct snd_trident * trident, struct snd_trident_voice *voice); 465 int snd_trident_suspend(struct pci_dev *pci, pm_message_t state); 466 int snd_trident_resume(struct pci_dev *pci); 473 467 474 468 /* TLB memory allocation */ 475 snd_util_memblk_t *snd_trident_alloc_pages(trident_t *trident, snd_pcm_substream_t *substream); 476 int snd_trident_free_pages(trident_t *trident, snd_util_memblk_t *blk); 477 snd_util_memblk_t *snd_trident_synth_alloc(trident_t *trident, unsigned int size); 478 int snd_trident_synth_free(trident_t *trident, snd_util_memblk_t *blk); 479 int snd_trident_synth_bzero(trident_t *trident, snd_util_memblk_t *blk, int offset, int size); 480 int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int offset, const char *data, int size); 469 struct snd_util_memblk *snd_trident_alloc_pages(struct snd_trident *trident, 470 struct snd_pcm_substream *substream); 471 int snd_trident_free_pages(struct snd_trident *trident, struct snd_util_memblk *blk); 472 struct snd_util_memblk *snd_trident_synth_alloc(struct snd_trident *trident, unsigned int size); 473 int snd_trident_synth_free(struct snd_trident *trident, struct snd_util_memblk *blk); 474 int snd_trident_synth_copy_from_user(struct snd_trident *trident, struct snd_util_memblk *blk, 475 int offset, const char __user *data, int size); 481 476 482 477 #endif /* __SOUND_TRIDENT_H */
Note:
See TracChangeset
for help on using the changeset viewer.
