diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/emu8000.h | 39 | ||||
-rw-r--r-- | include/sound/sb.h | 66 | ||||
-rw-r--r-- | include/sound/sb16_csp.h | 52 |
3 files changed, 78 insertions, 79 deletions
diff --git a/include/sound/emu8000.h b/include/sound/emu8000.h index 4362c54e09d0..c8f66bde6d95 100644 --- a/include/sound/emu8000.h +++ b/include/sound/emu8000.h | |||
@@ -56,9 +56,9 @@ enum { | |||
56 | * some of the channels may be used for other things so max_channels is | 56 | * some of the channels may be used for other things so max_channels is |
57 | * the number in use for wave voices. | 57 | * the number in use for wave voices. |
58 | */ | 58 | */ |
59 | typedef struct snd_emu8000 { | 59 | struct snd_emu8000 { |
60 | 60 | ||
61 | snd_emux_t *emu; | 61 | struct snd_emux *emu; |
62 | 62 | ||
63 | int index; /* sequencer client index */ | 63 | int index; /* sequencer client index */ |
64 | int seq_ports; /* number of sequencer ports */ | 64 | int seq_ports; /* number of sequencer ports */ |
@@ -77,44 +77,45 @@ typedef struct snd_emu8000 { | |||
77 | 77 | ||
78 | int dram_checked; | 78 | int dram_checked; |
79 | 79 | ||
80 | snd_card_t *card; /* The card that this belongs to */ | 80 | struct snd_card *card; /* The card that this belongs to */ |
81 | 81 | ||
82 | int chorus_mode; | 82 | int chorus_mode; |
83 | int reverb_mode; | 83 | int reverb_mode; |
84 | int bass_level; | 84 | int bass_level; |
85 | int treble_level; | 85 | int treble_level; |
86 | 86 | ||
87 | snd_util_memhdr_t *memhdr; | 87 | struct snd_util_memhdr *memhdr; |
88 | 88 | ||
89 | spinlock_t control_lock; | 89 | spinlock_t control_lock; |
90 | snd_kcontrol_t *controls[EMU8000_NUM_CONTROLS]; | 90 | struct snd_kcontrol *controls[EMU8000_NUM_CONTROLS]; |
91 | 91 | ||
92 | snd_pcm_t *pcm; /* pcm on emu8000 wavetable */ | 92 | struct snd_pcm *pcm; /* pcm on emu8000 wavetable */ |
93 | 93 | ||
94 | } emu8000_t; | 94 | }; |
95 | 95 | ||
96 | /* sequencer device id */ | 96 | /* sequencer device id */ |
97 | #define SNDRV_SEQ_DEV_ID_EMU8000 "emu8000-synth" | 97 | #define SNDRV_SEQ_DEV_ID_EMU8000 "emu8000-synth" |
98 | 98 | ||
99 | 99 | ||
100 | /* exported functions */ | 100 | /* exported functions */ |
101 | int snd_emu8000_new(snd_card_t *card, int device, long port, int seq_ports, snd_seq_device_t **ret); | 101 | int snd_emu8000_new(struct snd_card *card, int device, long port, int seq_ports, |
102 | void snd_emu8000_poke(emu8000_t *emu, unsigned int port, unsigned int reg, | 102 | struct snd_seq_device **ret); |
103 | void snd_emu8000_poke(struct snd_emu8000 *emu, unsigned int port, unsigned int reg, | ||
103 | unsigned int val); | 104 | unsigned int val); |
104 | unsigned short snd_emu8000_peek(emu8000_t *emu, unsigned int port, | 105 | unsigned short snd_emu8000_peek(struct snd_emu8000 *emu, unsigned int port, |
105 | unsigned int reg); | 106 | unsigned int reg); |
106 | void snd_emu8000_poke_dw(emu8000_t *emu, unsigned int port, unsigned int reg, | 107 | void snd_emu8000_poke_dw(struct snd_emu8000 *emu, unsigned int port, unsigned int reg, |
107 | unsigned int val); | 108 | unsigned int val); |
108 | unsigned int snd_emu8000_peek_dw(emu8000_t *emu, unsigned int port, | 109 | unsigned int snd_emu8000_peek_dw(struct snd_emu8000 *emu, unsigned int port, |
109 | unsigned int reg); | 110 | unsigned int reg); |
110 | void snd_emu8000_dma_chan(emu8000_t *emu, int ch, int mode); | 111 | void snd_emu8000_dma_chan(struct snd_emu8000 *emu, int ch, int mode); |
111 | 112 | ||
112 | void snd_emu8000_init_fm(emu8000_t *emu); | 113 | void snd_emu8000_init_fm(struct snd_emu8000 *emu); |
113 | 114 | ||
114 | void snd_emu8000_update_chorus_mode(emu8000_t *emu); | 115 | void snd_emu8000_update_chorus_mode(struct snd_emu8000 *emu); |
115 | void snd_emu8000_update_reverb_mode(emu8000_t *emu); | 116 | void snd_emu8000_update_reverb_mode(struct snd_emu8000 *emu); |
116 | void snd_emu8000_update_equalizer(emu8000_t *emu); | 117 | void snd_emu8000_update_equalizer(struct snd_emu8000 *emu); |
117 | int snd_emu8000_load_chorus_fx(emu8000_t *emu, int mode, const void __user *buf, long len); | 118 | int snd_emu8000_load_chorus_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len); |
118 | int snd_emu8000_load_reverb_fx(emu8000_t *emu, int mode, const void __user *buf, long len); | 119 | int snd_emu8000_load_reverb_fx(struct snd_emu8000 *emu, int mode, const void __user *buf, long len); |
119 | 120 | ||
120 | #endif /* __SOUND_EMU8000_H */ | 121 | #endif /* __SOUND_EMU8000_H */ |
diff --git a/include/sound/sb.h b/include/sound/sb.h index 7960452445e6..8e82460c4d34 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h | |||
@@ -60,7 +60,7 @@ enum sb_hw_type { | |||
60 | 60 | ||
61 | #define SB_MPU_INPUT 1 | 61 | #define SB_MPU_INPUT 1 |
62 | 62 | ||
63 | struct _snd_sb { | 63 | struct snd_sb { |
64 | unsigned long port; /* base port of DSP chip */ | 64 | unsigned long port; /* base port of DSP chip */ |
65 | struct resource *res_port; | 65 | struct resource *res_port; |
66 | unsigned long mpu_port; /* MPU port for SB DSP 4.0+ */ | 66 | unsigned long mpu_port; /* MPU port for SB DSP 4.0+ */ |
@@ -92,25 +92,23 @@ struct _snd_sb { | |||
92 | 92 | ||
93 | void *csp; /* used only when CONFIG_SND_SB16_CSP is set */ | 93 | void *csp; /* used only when CONFIG_SND_SB16_CSP is set */ |
94 | 94 | ||
95 | snd_card_t *card; | 95 | struct snd_card *card; |
96 | snd_pcm_t *pcm; | 96 | struct snd_pcm *pcm; |
97 | snd_pcm_substream_t *playback_substream; | 97 | struct snd_pcm_substream *playback_substream; |
98 | snd_pcm_substream_t *capture_substream; | 98 | struct snd_pcm_substream *capture_substream; |
99 | 99 | ||
100 | snd_rawmidi_t *rmidi; | 100 | struct snd_rawmidi *rmidi; |
101 | snd_rawmidi_substream_t *midi_substream_input; | 101 | struct snd_rawmidi_substream *midi_substream_input; |
102 | snd_rawmidi_substream_t *midi_substream_output; | 102 | struct snd_rawmidi_substream *midi_substream_output; |
103 | irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); | 103 | irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); |
104 | 104 | ||
105 | spinlock_t reg_lock; | 105 | spinlock_t reg_lock; |
106 | spinlock_t open_lock; | 106 | spinlock_t open_lock; |
107 | spinlock_t midi_input_lock; | 107 | spinlock_t midi_input_lock; |
108 | 108 | ||
109 | snd_info_entry_t *proc_entry; | 109 | struct snd_info_entry *proc_entry; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | typedef struct _snd_sb sb_t; | ||
113 | |||
114 | /* I/O ports */ | 112 | /* I/O ports */ |
115 | 113 | ||
116 | #define SBP(chip, x) ((chip)->port + s_b_SB_##x) | 114 | #define SBP(chip, x) ((chip)->port + s_b_SB_##x) |
@@ -267,48 +265,48 @@ typedef struct _snd_sb sb_t; | |||
267 | * | 265 | * |
268 | */ | 266 | */ |
269 | 267 | ||
270 | static inline void snd_sb_ack_8bit(sb_t *chip) | 268 | static inline void snd_sb_ack_8bit(struct snd_sb *chip) |
271 | { | 269 | { |
272 | inb(SBP(chip, DATA_AVAIL)); | 270 | inb(SBP(chip, DATA_AVAIL)); |
273 | } | 271 | } |
274 | 272 | ||
275 | static inline void snd_sb_ack_16bit(sb_t *chip) | 273 | static inline void snd_sb_ack_16bit(struct snd_sb *chip) |
276 | { | 274 | { |
277 | inb(SBP(chip, DATA_AVAIL_16)); | 275 | inb(SBP(chip, DATA_AVAIL_16)); |
278 | } | 276 | } |
279 | 277 | ||
280 | /* sb_common.c */ | 278 | /* sb_common.c */ |
281 | int snd_sbdsp_command(sb_t *chip, unsigned char val); | 279 | int snd_sbdsp_command(struct snd_sb *chip, unsigned char val); |
282 | int snd_sbdsp_get_byte(sb_t *chip); | 280 | int snd_sbdsp_get_byte(struct snd_sb *chip); |
283 | int snd_sbdsp_reset(sb_t *chip); | 281 | int snd_sbdsp_reset(struct snd_sb *chip); |
284 | int snd_sbdsp_create(snd_card_t *card, | 282 | int snd_sbdsp_create(struct snd_card *card, |
285 | unsigned long port, | 283 | unsigned long port, |
286 | int irq, | 284 | int irq, |
287 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), | 285 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), |
288 | int dma8, int dma16, | 286 | int dma8, int dma16, |
289 | unsigned short hardware, | 287 | unsigned short hardware, |
290 | sb_t **r_chip); | 288 | struct snd_sb **r_chip); |
291 | /* sb_mixer.c */ | 289 | /* sb_mixer.c */ |
292 | void snd_sbmixer_write(sb_t *chip, unsigned char reg, unsigned char data); | 290 | void snd_sbmixer_write(struct snd_sb *chip, unsigned char reg, unsigned char data); |
293 | unsigned char snd_sbmixer_read(sb_t *chip, unsigned char reg); | 291 | unsigned char snd_sbmixer_read(struct snd_sb *chip, unsigned char reg); |
294 | int snd_sbmixer_new(sb_t *chip); | 292 | int snd_sbmixer_new(struct snd_sb *chip); |
295 | 293 | ||
296 | /* sb8_init.c */ | 294 | /* sb8_init.c */ |
297 | int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); | 295 | int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm); |
298 | /* sb8.c */ | 296 | /* sb8.c */ |
299 | irqreturn_t snd_sb8dsp_interrupt(sb_t *chip); | 297 | irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip); |
300 | int snd_sb8_playback_open(snd_pcm_substream_t *substream); | 298 | int snd_sb8_playback_open(struct snd_pcm_substream *substream); |
301 | int snd_sb8_capture_open(snd_pcm_substream_t *substream); | 299 | int snd_sb8_capture_open(struct snd_pcm_substream *substream); |
302 | int snd_sb8_playback_close(snd_pcm_substream_t *substream); | 300 | int snd_sb8_playback_close(struct snd_pcm_substream *substream); |
303 | int snd_sb8_capture_close(snd_pcm_substream_t *substream); | 301 | int snd_sb8_capture_close(struct snd_pcm_substream *substream); |
304 | /* midi8.c */ | 302 | /* midi8.c */ |
305 | irqreturn_t snd_sb8dsp_midi_interrupt(sb_t *chip); | 303 | irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip); |
306 | int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi); | 304 | int snd_sb8dsp_midi(struct snd_sb *chip, int device, struct snd_rawmidi ** rrawmidi); |
307 | 305 | ||
308 | /* sb16_init.c */ | 306 | /* sb16_init.c */ |
309 | int snd_sb16dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); | 307 | int snd_sb16dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm); |
310 | const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction); | 308 | const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction); |
311 | int snd_sb16dsp_configure(sb_t *chip); | 309 | int snd_sb16dsp_configure(struct snd_sb *chip); |
312 | /* sb16.c */ | 310 | /* sb16.c */ |
313 | irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 311 | irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); |
314 | 312 | ||
@@ -328,7 +326,7 @@ enum { | |||
328 | #define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \ | 326 | #define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \ |
329 | ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24)) | 327 | ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24)) |
330 | 328 | ||
331 | int snd_sbmixer_add_ctl(sb_t *chip, const char *name, int index, int type, unsigned long value); | 329 | int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int type, unsigned long value); |
332 | 330 | ||
333 | /* for ease of use */ | 331 | /* for ease of use */ |
334 | struct sbmix_elem { | 332 | struct sbmix_elem { |
@@ -352,7 +350,7 @@ struct sbmix_elem { | |||
352 | .type = SB_MIX_INPUT_SW, \ | 350 | .type = SB_MIX_INPUT_SW, \ |
353 | .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) } | 351 | .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) } |
354 | 352 | ||
355 | static inline int snd_sbmixer_add_ctl_elem(sb_t *chip, const struct sbmix_elem *c) | 353 | static inline int snd_sbmixer_add_ctl_elem(struct snd_sb *chip, const struct sbmix_elem *c) |
356 | { | 354 | { |
357 | return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value); | 355 | return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value); |
358 | } | 356 | } |
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h index eb8368b56b16..3b44d4b370f5 100644 --- a/include/sound/sb16_csp.h +++ b/include/sound/sb16_csp.h | |||
@@ -63,25 +63,25 @@ | |||
63 | #define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 | 63 | #define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 |
64 | 64 | ||
65 | /* microcode header */ | 65 | /* microcode header */ |
66 | typedef struct snd_sb_csp_mc_header { | 66 | struct snd_sb_csp_mc_header { |
67 | char codec_name[16]; /* id name of codec */ | 67 | char codec_name[16]; /* id name of codec */ |
68 | unsigned short func_req; /* requested function */ | 68 | unsigned short func_req; /* requested function */ |
69 | } snd_sb_csp_mc_header_t; | 69 | }; |
70 | 70 | ||
71 | /* microcode to be loaded */ | 71 | /* microcode to be loaded */ |
72 | typedef struct snd_sb_csp_microcode { | 72 | struct snd_sb_csp_microcode { |
73 | snd_sb_csp_mc_header_t info; | 73 | struct snd_sb_csp_mc_header info; |
74 | unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; | 74 | unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; |
75 | } snd_sb_csp_microcode_t; | 75 | }; |
76 | 76 | ||
77 | /* start CSP with sample_width in mono/stereo */ | 77 | /* start CSP with sample_width in mono/stereo */ |
78 | typedef struct snd_sb_csp_start { | 78 | struct snd_sb_csp_start { |
79 | int sample_width; /* sample width, look above */ | 79 | int sample_width; /* sample width, look above */ |
80 | int channels; /* channels, look above */ | 80 | int channels; /* channels, look above */ |
81 | } snd_sb_csp_start_t; | 81 | }; |
82 | 82 | ||
83 | /* CSP information */ | 83 | /* CSP information */ |
84 | typedef struct snd_sb_csp_info { | 84 | struct snd_sb_csp_info { |
85 | char codec_name[16]; /* id name of codec */ | 85 | char codec_name[16]; /* id name of codec */ |
86 | unsigned short func_nr; /* function number */ | 86 | unsigned short func_nr; /* function number */ |
87 | unsigned int acc_format; /* accepted PCM formats */ | 87 | unsigned int acc_format; /* accepted PCM formats */ |
@@ -93,17 +93,17 @@ typedef struct snd_sb_csp_info { | |||
93 | unsigned short run_width; /* current sample width */ | 93 | unsigned short run_width; /* current sample width */ |
94 | unsigned short version; /* version id: 0x10 - 0x1f */ | 94 | unsigned short version; /* version id: 0x10 - 0x1f */ |
95 | unsigned short state; /* state bits */ | 95 | unsigned short state; /* state bits */ |
96 | } snd_sb_csp_info_t; | 96 | }; |
97 | 97 | ||
98 | /* HWDEP controls */ | 98 | /* HWDEP controls */ |
99 | /* get CSP information */ | 99 | /* get CSP information */ |
100 | #define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, snd_sb_csp_info_t) | 100 | #define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info) |
101 | /* load microcode to CSP */ | 101 | /* load microcode to CSP */ |
102 | #define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, snd_sb_csp_microcode_t) | 102 | #define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, struct snd_sb_csp_microcode) |
103 | /* unload microcode from CSP */ | 103 | /* unload microcode from CSP */ |
104 | #define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) | 104 | #define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) |
105 | /* start CSP */ | 105 | /* start CSP */ |
106 | #define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, snd_sb_csp_start_t) | 106 | #define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, struct snd_sb_csp_start) |
107 | /* stop CSP */ | 107 | /* stop CSP */ |
108 | #define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) | 108 | #define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) |
109 | /* pause CSP and DMA transfer */ | 109 | /* pause CSP and DMA transfer */ |
@@ -115,25 +115,25 @@ typedef struct snd_sb_csp_info { | |||
115 | #include "sb.h" | 115 | #include "sb.h" |
116 | #include "hwdep.h" | 116 | #include "hwdep.h" |
117 | 117 | ||
118 | typedef struct snd_sb_csp snd_sb_csp_t; | 118 | struct snd_sb_csp; |
119 | 119 | ||
120 | /* | 120 | /* |
121 | * CSP operators | 121 | * CSP operators |
122 | */ | 122 | */ |
123 | typedef struct { | 123 | struct snd_sb_csp_ops { |
124 | int (*csp_use) (snd_sb_csp_t * p); | 124 | int (*csp_use) (struct snd_sb_csp * p); |
125 | int (*csp_unuse) (snd_sb_csp_t * p); | 125 | int (*csp_unuse) (struct snd_sb_csp * p); |
126 | int (*csp_autoload) (snd_sb_csp_t * p, int pcm_sfmt, int play_rec_mode); | 126 | int (*csp_autoload) (struct snd_sb_csp * p, int pcm_sfmt, int play_rec_mode); |
127 | int (*csp_start) (snd_sb_csp_t * p, int sample_width, int channels); | 127 | int (*csp_start) (struct snd_sb_csp * p, int sample_width, int channels); |
128 | int (*csp_stop) (snd_sb_csp_t * p); | 128 | int (*csp_stop) (struct snd_sb_csp * p); |
129 | int (*csp_qsound_transfer) (snd_sb_csp_t * p); | 129 | int (*csp_qsound_transfer) (struct snd_sb_csp * p); |
130 | } snd_sb_csp_ops_t; | 130 | }; |
131 | 131 | ||
132 | /* | 132 | /* |
133 | * CSP private data | 133 | * CSP private data |
134 | */ | 134 | */ |
135 | struct snd_sb_csp { | 135 | struct snd_sb_csp { |
136 | sb_t *chip; /* SB16 DSP */ | 136 | struct snd_sb *chip; /* SB16 DSP */ |
137 | int used; /* usage flag - exclusive */ | 137 | int used; /* usage flag - exclusive */ |
138 | char codec_name[16]; /* name of codec */ | 138 | char codec_name[16]; /* name of codec */ |
139 | unsigned short func_nr; /* function number */ | 139 | unsigned short func_nr; /* function number */ |
@@ -147,7 +147,7 @@ struct snd_sb_csp { | |||
147 | int version; /* CSP version (0x10 - 0x1f) */ | 147 | int version; /* CSP version (0x10 - 0x1f) */ |
148 | int running; /* running state */ | 148 | int running; /* running state */ |
149 | 149 | ||
150 | snd_sb_csp_ops_t ops; /* operators */ | 150 | struct snd_sb_csp_ops ops; /* operators */ |
151 | 151 | ||
152 | spinlock_t q_lock; /* locking */ | 152 | spinlock_t q_lock; /* locking */ |
153 | int q_enabled; /* enabled flag */ | 153 | int q_enabled; /* enabled flag */ |
@@ -155,13 +155,13 @@ struct snd_sb_csp { | |||
155 | int qpos_right; /* right position */ | 155 | int qpos_right; /* right position */ |
156 | int qpos_changed; /* position changed flag */ | 156 | int qpos_changed; /* position changed flag */ |
157 | 157 | ||
158 | snd_kcontrol_t *qsound_switch; | 158 | struct snd_kcontrol *qsound_switch; |
159 | snd_kcontrol_t *qsound_space; | 159 | struct snd_kcontrol *qsound_space; |
160 | 160 | ||
161 | struct semaphore access_mutex; /* locking */ | 161 | struct semaphore access_mutex; /* locking */ |
162 | }; | 162 | }; |
163 | 163 | ||
164 | int snd_sb_csp_new(sb_t *chip, int device, snd_hwdep_t ** rhwdep); | 164 | int snd_sb_csp_new(struct snd_sb *chip, int device, struct snd_hwdep ** rhwdep); |
165 | #endif | 165 | #endif |
166 | 166 | ||
167 | #endif /* __SOUND_SB16_CSP */ | 167 | #endif /* __SOUND_SB16_CSP */ |