aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/sb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/sb.h')
-rw-r--r--include/sound/sb.h66
1 files changed, 32 insertions, 34 deletions
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
63struct _snd_sb { 63struct snd_sb {
64 unsigned long port; /* base port of DSP chip */ 64 unsigned long port; /* base port of DSP chip */
65 struct resource *res_port; 65 struct resource *res_port;
66 unsigned long mpu_port; /* MPU port for SB DSP 4.0+ */ 66 unsigned long mpu_port; /* MPU port for SB DSP 4.0+ */
@@ -92,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
112typedef 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
270static inline void snd_sb_ack_8bit(sb_t *chip) 268static 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
275static inline void snd_sb_ack_16bit(sb_t *chip) 273static 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 */
281int snd_sbdsp_command(sb_t *chip, unsigned char val); 279int snd_sbdsp_command(struct snd_sb *chip, unsigned char val);
282int snd_sbdsp_get_byte(sb_t *chip); 280int snd_sbdsp_get_byte(struct snd_sb *chip);
283int snd_sbdsp_reset(sb_t *chip); 281int snd_sbdsp_reset(struct snd_sb *chip);
284int snd_sbdsp_create(snd_card_t *card, 282int 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 */
292void snd_sbmixer_write(sb_t *chip, unsigned char reg, unsigned char data); 290void snd_sbmixer_write(struct snd_sb *chip, unsigned char reg, unsigned char data);
293unsigned char snd_sbmixer_read(sb_t *chip, unsigned char reg); 291unsigned char snd_sbmixer_read(struct snd_sb *chip, unsigned char reg);
294int snd_sbmixer_new(sb_t *chip); 292int snd_sbmixer_new(struct snd_sb *chip);
295 293
296/* sb8_init.c */ 294/* sb8_init.c */
297int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); 295int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm);
298/* sb8.c */ 296/* sb8.c */
299irqreturn_t snd_sb8dsp_interrupt(sb_t *chip); 297irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip);
300int snd_sb8_playback_open(snd_pcm_substream_t *substream); 298int snd_sb8_playback_open(struct snd_pcm_substream *substream);
301int snd_sb8_capture_open(snd_pcm_substream_t *substream); 299int snd_sb8_capture_open(struct snd_pcm_substream *substream);
302int snd_sb8_playback_close(snd_pcm_substream_t *substream); 300int snd_sb8_playback_close(struct snd_pcm_substream *substream);
303int snd_sb8_capture_close(snd_pcm_substream_t *substream); 301int snd_sb8_capture_close(struct snd_pcm_substream *substream);
304/* midi8.c */ 302/* midi8.c */
305irqreturn_t snd_sb8dsp_midi_interrupt(sb_t *chip); 303irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip);
306int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi); 304int snd_sb8dsp_midi(struct snd_sb *chip, int device, struct snd_rawmidi ** rrawmidi);
307 305
308/* sb16_init.c */ 306/* sb16_init.c */
309int snd_sb16dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); 307int snd_sb16dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm);
310const snd_pcm_ops_t *snd_sb16dsp_get_pcm_ops(int direction); 308const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction);
311int snd_sb16dsp_configure(sb_t *chip); 309int snd_sb16dsp_configure(struct snd_sb *chip);
312/* sb16.c */ 310/* sb16.c */
313irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); 311irqreturn_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
331int snd_sbmixer_add_ctl(sb_t *chip, const char *name, int index, int type, unsigned long value); 329int 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 */
334struct sbmix_elem { 332struct 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
355static inline int snd_sbmixer_add_ctl_elem(sb_t *chip, const struct sbmix_elem *c) 353static 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}