X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;ds=sidebyside;f=include%2Fsound%2Fymfpci.h;h=05ead66984347be76872c0bf0e5da507cc53b760;hb=47a184a80800dd69abd1206eea1b961070ce2ca3;hp=c3bccbfd8d4c344ac7336a4084deeb3226ebea54;hpb=8cdfd2519c6c9a1e6057dc5970b2542b35895738;p=safe%2Fjmp%2Flinux-2.6 diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index c3bccbf..05ead66 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h @@ -2,7 +2,7 @@ #define __SOUND_YMFPCI_H /* - * Copyright (c) by Jaroslav Kysela + * Copyright (c) by Jaroslav Kysela * Definitions for Yahama YMF724/740/744/754 chips * * @@ -184,7 +184,7 @@ * */ -typedef struct _snd_ymfpci_playback_bank { +struct snd_ymfpci_playback_bank { u32 format; u32 loop_default; u32 base; /* 32-bit address */ @@ -215,46 +215,45 @@ typedef struct _snd_ymfpci_playback_bank { u32 eff3_gain; u32 lpfD1; u32 lpfD2; -} snd_ymfpci_playback_bank_t; + }; -typedef struct _snd_ymfpci_capture_bank { +struct snd_ymfpci_capture_bank { u32 base; /* 32-bit address */ u32 loop_end; /* 32-bit offset */ u32 start; /* 32-bit offset */ u32 num_of_loops; /* counter */ -} snd_ymfpci_capture_bank_t; +}; -typedef struct _snd_ymfpci_effect_bank { +struct snd_ymfpci_effect_bank { u32 base; /* 32-bit address */ u32 loop_end; /* 32-bit offset */ u32 start; /* 32-bit offset */ u32 temp; -} snd_ymfpci_effect_bank_t; +}; -typedef struct _snd_ymfpci_voice ymfpci_voice_t; -typedef struct _snd_ymfpci_pcm ymfpci_pcm_t; -typedef struct _snd_ymfpci ymfpci_t; +struct snd_ymfpci_pcm; +struct snd_ymfpci; -typedef enum { +enum snd_ymfpci_voice_type { YMFPCI_PCM, YMFPCI_SYNTH, YMFPCI_MIDI -} ymfpci_voice_type_t; +}; -struct _snd_ymfpci_voice { - ymfpci_t *chip; +struct snd_ymfpci_voice { + struct snd_ymfpci *chip; int number; unsigned int use: 1, pcm: 1, synth: 1, midi: 1; - snd_ymfpci_playback_bank_t *bank; + struct snd_ymfpci_playback_bank *bank; dma_addr_t bank_addr; - void (*interrupt)(ymfpci_t *chip, ymfpci_voice_t *voice); - ymfpci_pcm_t *ypcm; + void (*interrupt)(struct snd_ymfpci *chip, struct snd_ymfpci_voice *voice); + struct snd_ymfpci_pcm *ypcm; }; -typedef enum { +enum snd_ymfpci_pcm_type { PLAYBACK_VOICE, CAPTURE_REC, CAPTURE_AC97, @@ -263,16 +262,18 @@ typedef enum { EFFECT_EFF1, EFFECT_EFF2, EFFECT_EFF3 -} snd_ymfpci_pcm_type_t; - -struct _snd_ymfpci_pcm { - ymfpci_t *chip; - snd_ymfpci_pcm_type_t type; - snd_pcm_substream_t *substream; - ymfpci_voice_t *voices[2]; /* playback only */ - unsigned int running: 1; - unsigned int output_front: 1; - unsigned int output_rear: 1; +}; + +struct snd_ymfpci_pcm { + struct snd_ymfpci *chip; + enum snd_ymfpci_pcm_type type; + struct snd_pcm_substream *substream; + struct snd_ymfpci_voice *voices[2]; /* playback only */ + unsigned int running: 1, + use_441_slot: 1, + output_front: 1, + output_rear: 1, + swap_rear: 1; unsigned int update_pcm_vol; u32 period_size; /* cached from runtime->period_size */ u32 buffer_size; /* cached from runtime->buffer_size */ @@ -282,11 +283,11 @@ struct _snd_ymfpci_pcm { u32 shift; }; -struct _snd_ymfpci { +struct snd_ymfpci { int irq; unsigned int device_id; /* PCI device ID */ - unsigned int rev; /* PCI revision */ + unsigned char rev; /* PCI revision */ unsigned long reg_area_phys; void __iomem *reg_area_virt; struct resource *res_reg_area; @@ -316,47 +317,50 @@ struct _snd_ymfpci { struct snd_dma_buffer ac3_tmp_base; u32 *ctrl_playback; - snd_ymfpci_playback_bank_t *bank_playback[YDSXG_PLAYBACK_VOICES][2]; - snd_ymfpci_capture_bank_t *bank_capture[YDSXG_CAPTURE_VOICES][2]; - snd_ymfpci_effect_bank_t *bank_effect[YDSXG_EFFECT_VOICES][2]; + struct snd_ymfpci_playback_bank *bank_playback[YDSXG_PLAYBACK_VOICES][2]; + struct snd_ymfpci_capture_bank *bank_capture[YDSXG_CAPTURE_VOICES][2]; + struct snd_ymfpci_effect_bank *bank_effect[YDSXG_EFFECT_VOICES][2]; int start_count; u32 active_bank; - ymfpci_voice_t voices[64]; + struct snd_ymfpci_voice voices[64]; + int src441_used; - ac97_bus_t *ac97_bus; - ac97_t *ac97; - snd_rawmidi_t *rawmidi; - snd_timer_t *timer; + struct snd_ac97_bus *ac97_bus; + struct snd_ac97 *ac97; + struct snd_rawmidi *rawmidi; + struct snd_timer *timer; struct pci_dev *pci; - snd_card_t *card; - snd_pcm_t *pcm; - snd_pcm_t *pcm2; - snd_pcm_t *pcm_spdif; - snd_pcm_t *pcm_4ch; - snd_pcm_substream_t *capture_substream[YDSXG_CAPTURE_VOICES]; - snd_pcm_substream_t *effect_substream[YDSXG_EFFECT_VOICES]; - snd_kcontrol_t *ctl_vol_recsrc; - snd_kcontrol_t *ctl_vol_adcrec; - snd_kcontrol_t *ctl_vol_spdifrec; + struct snd_card *card; + struct snd_pcm *pcm; + struct snd_pcm *pcm2; + struct snd_pcm *pcm_spdif; + struct snd_pcm *pcm_4ch; + struct snd_pcm_substream *capture_substream[YDSXG_CAPTURE_VOICES]; + struct snd_pcm_substream *effect_substream[YDSXG_EFFECT_VOICES]; + struct snd_kcontrol *ctl_vol_recsrc; + struct snd_kcontrol *ctl_vol_adcrec; + struct snd_kcontrol *ctl_vol_spdifrec; unsigned short spdif_bits, spdif_pcm_bits; - snd_kcontrol_t *spdif_pcm_ctl; + struct snd_kcontrol *spdif_pcm_ctl; int mode_dup4ch; int rear_opened; int spdif_opened; - struct { + struct snd_ymfpci_pcm_mixer { u16 left; u16 right; - snd_kcontrol_t *ctl; + struct snd_kcontrol *ctl; } pcm_mixer[32]; spinlock_t reg_lock; spinlock_t voice_lock; wait_queue_head_t interrupt_sleep; atomic_t interrupt_sleep_count; - snd_info_entry_t *proc_entry; + struct snd_info_entry *proc_entry; + const struct firmware *dsp_microcode; + const struct firmware *controller_microcode; #ifdef CONFIG_PM u32 *saved_regs; @@ -364,17 +368,20 @@ struct _snd_ymfpci { #endif }; -int snd_ymfpci_create(snd_card_t * card, +int snd_ymfpci_create(struct snd_card *card, struct pci_dev *pci, unsigned short old_legacy_ctrl, - ymfpci_t ** rcodec); -void snd_ymfpci_free_gameport(ymfpci_t *chip); - -int snd_ymfpci_pcm(ymfpci_t *chip, int device, snd_pcm_t **rpcm); -int snd_ymfpci_pcm2(ymfpci_t *chip, int device, snd_pcm_t **rpcm); -int snd_ymfpci_pcm_spdif(ymfpci_t *chip, int device, snd_pcm_t **rpcm); -int snd_ymfpci_pcm_4ch(ymfpci_t *chip, int device, snd_pcm_t **rpcm); -int snd_ymfpci_mixer(ymfpci_t *chip, int rear_switch); -int snd_ymfpci_timer(ymfpci_t *chip, int device); + struct snd_ymfpci ** rcodec); +void snd_ymfpci_free_gameport(struct snd_ymfpci *chip); + +int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state); +int snd_ymfpci_resume(struct pci_dev *pci); + +int snd_ymfpci_pcm(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); +int snd_ymfpci_pcm2(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); +int snd_ymfpci_pcm_spdif(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); +int snd_ymfpci_pcm_4ch(struct snd_ymfpci *chip, int device, struct snd_pcm **rpcm); +int snd_ymfpci_mixer(struct snd_ymfpci *chip, int rear_switch); +int snd_ymfpci_timer(struct snd_ymfpci *chip, int device); #endif /* __SOUND_YMFPCI_H */