diff options
Diffstat (limited to 'include/sound/sb.h')
| -rw-r--r-- | include/sound/sb.h | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/include/sound/sb.h b/include/sound/sb.h index 7960452445e6..431d06675e36 100644 --- a/include/sound/sb.h +++ b/include/sound/sb.h | |||
| @@ -60,7 +60,7 @@ enum sb_hw_type { | |||
| 60 | 60 | ||
| 61 | #define SB_MPU_INPUT 1 | 61 | #define SB_MPU_INPUT 1 |
| 62 | 62 | ||
| 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,24 +92,26 @@ struct _snd_sb { | |||
| 92 | 92 | ||
| 93 | void *csp; /* used only when CONFIG_SND_SB16_CSP is set */ | 93 | void *csp; /* used only when CONFIG_SND_SB16_CSP is set */ |
| 94 | 94 | ||
| 95 | snd_card_t *card; | 95 | struct snd_card *card; |
| 96 | snd_pcm_t *pcm; | 96 | struct snd_pcm *pcm; |
| 97 | snd_pcm_substream_t *playback_substream; | 97 | struct snd_pcm_substream *playback_substream; |
| 98 | snd_pcm_substream_t *capture_substream; | 98 | struct snd_pcm_substream *capture_substream; |
| 99 | 99 | ||
| 100 | snd_rawmidi_t *rmidi; | 100 | struct snd_rawmidi *rmidi; |
| 101 | snd_rawmidi_substream_t *midi_substream_input; | 101 | struct snd_rawmidi_substream *midi_substream_input; |
| 102 | snd_rawmidi_substream_t *midi_substream_output; | 102 | struct snd_rawmidi_substream *midi_substream_output; |
| 103 | irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); | 103 | irqreturn_t (*rmidi_callback)(int irq, void *dev_id, struct pt_regs *regs); |
| 104 | 104 | ||
| 105 | spinlock_t reg_lock; | 105 | spinlock_t reg_lock; |
| 106 | spinlock_t open_lock; | 106 | spinlock_t open_lock; |
| 107 | spinlock_t midi_input_lock; | 107 | spinlock_t midi_input_lock; |
| 108 | 108 | ||
| 109 | snd_info_entry_t *proc_entry; | 109 | struct snd_info_entry *proc_entry; |
| 110 | }; | ||
| 111 | 110 | ||
| 112 | typedef struct _snd_sb sb_t; | 111 | #ifdef CONFIG_PM |
| 112 | unsigned char saved_regs[0x20]; | ||
| 113 | #endif | ||
| 114 | }; | ||
| 113 | 115 | ||
| 114 | /* I/O ports */ | 116 | /* I/O ports */ |
| 115 | 117 | ||
| @@ -267,48 +269,52 @@ typedef struct _snd_sb sb_t; | |||
| 267 | * | 269 | * |
| 268 | */ | 270 | */ |
| 269 | 271 | ||
| 270 | static inline void snd_sb_ack_8bit(sb_t *chip) | 272 | static inline void snd_sb_ack_8bit(struct snd_sb *chip) |
| 271 | { | 273 | { |
| 272 | inb(SBP(chip, DATA_AVAIL)); | 274 | inb(SBP(chip, DATA_AVAIL)); |
| 273 | } | 275 | } |
| 274 | 276 | ||
| 275 | static inline void snd_sb_ack_16bit(sb_t *chip) | 277 | static inline void snd_sb_ack_16bit(struct snd_sb *chip) |
| 276 | { | 278 | { |
| 277 | inb(SBP(chip, DATA_AVAIL_16)); | 279 | inb(SBP(chip, DATA_AVAIL_16)); |
| 278 | } | 280 | } |
| 279 | 281 | ||
| 280 | /* sb_common.c */ | 282 | /* sb_common.c */ |
| 281 | int snd_sbdsp_command(sb_t *chip, unsigned char val); | 283 | int snd_sbdsp_command(struct snd_sb *chip, unsigned char val); |
| 282 | int snd_sbdsp_get_byte(sb_t *chip); | 284 | int snd_sbdsp_get_byte(struct snd_sb *chip); |
| 283 | int snd_sbdsp_reset(sb_t *chip); | 285 | int snd_sbdsp_reset(struct snd_sb *chip); |
| 284 | int snd_sbdsp_create(snd_card_t *card, | 286 | int snd_sbdsp_create(struct snd_card *card, |
| 285 | unsigned long port, | 287 | unsigned long port, |
| 286 | int irq, | 288 | int irq, |
| 287 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), | 289 | irqreturn_t (*irq_handler)(int, void *, struct pt_regs *), |
| 288 | int dma8, int dma16, | 290 | int dma8, int dma16, |
| 289 | unsigned short hardware, | 291 | unsigned short hardware, |
| 290 | sb_t **r_chip); | 292 | struct snd_sb **r_chip); |
| 291 | /* sb_mixer.c */ | 293 | /* sb_mixer.c */ |
| 292 | void snd_sbmixer_write(sb_t *chip, unsigned char reg, unsigned char data); | 294 | 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); | 295 | unsigned char snd_sbmixer_read(struct snd_sb *chip, unsigned char reg); |
| 294 | int snd_sbmixer_new(sb_t *chip); | 296 | int snd_sbmixer_new(struct snd_sb *chip); |
| 297 | #ifdef CONFIG_PM | ||
| 298 | void snd_sbmixer_suspend(struct snd_sb *chip); | ||
| 299 | void snd_sbmixer_resume(struct snd_sb *chip); | ||
| 300 | #endif | ||
| 295 | 301 | ||
| 296 | /* sb8_init.c */ | 302 | /* sb8_init.c */ |
| 297 | int snd_sb8dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); | 303 | int snd_sb8dsp_pcm(struct snd_sb *chip, int device, struct snd_pcm ** rpcm); |
| 298 | /* sb8.c */ | 304 | /* sb8.c */ |
| 299 | irqreturn_t snd_sb8dsp_interrupt(sb_t *chip); | 305 | irqreturn_t snd_sb8dsp_interrupt(struct snd_sb *chip); |
| 300 | int snd_sb8_playback_open(snd_pcm_substream_t *substream); | 306 | int snd_sb8_playback_open(struct snd_pcm_substream *substream); |
| 301 | int snd_sb8_capture_open(snd_pcm_substream_t *substream); | 307 | int snd_sb8_capture_open(struct snd_pcm_substream *substream); |
| 302 | int snd_sb8_playback_close(snd_pcm_substream_t *substream); | 308 | int snd_sb8_playback_close(struct snd_pcm_substream *substream); |
| 303 | int snd_sb8_capture_close(snd_pcm_substream_t *substream); | 309 | int snd_sb8_capture_close(struct snd_pcm_substream *substream); |
| 304 | /* midi8.c */ | 310 | /* midi8.c */ |
| 305 | irqreturn_t snd_sb8dsp_midi_interrupt(sb_t *chip); | 311 | irqreturn_t snd_sb8dsp_midi_interrupt(struct snd_sb *chip); |
| 306 | int snd_sb8dsp_midi(sb_t *chip, int device, snd_rawmidi_t ** rrawmidi); | 312 | int snd_sb8dsp_midi(struct snd_sb *chip, int device, struct snd_rawmidi ** rrawmidi); |
| 307 | 313 | ||
| 308 | /* sb16_init.c */ | 314 | /* sb16_init.c */ |
| 309 | int snd_sb16dsp_pcm(sb_t *chip, int device, snd_pcm_t ** rpcm); | 315 | 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); | 316 | const struct snd_pcm_ops *snd_sb16dsp_get_pcm_ops(int direction); |
| 311 | int snd_sb16dsp_configure(sb_t *chip); | 317 | int snd_sb16dsp_configure(struct snd_sb *chip); |
| 312 | /* sb16.c */ | 318 | /* sb16.c */ |
| 313 | irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); | 319 | irqreturn_t snd_sb16dsp_interrupt(int irq, void *dev_id, struct pt_regs *regs); |
| 314 | 320 | ||
| @@ -328,7 +334,7 @@ enum { | |||
| 328 | #define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \ | 334 | #define SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) \ |
| 329 | ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24)) | 335 | ((reg1) | ((reg2) << 8) | ((left_shift) << 16) | ((right_shift) << 24)) |
| 330 | 336 | ||
| 331 | int snd_sbmixer_add_ctl(sb_t *chip, const char *name, int index, int type, unsigned long value); | 337 | int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int type, unsigned long value); |
| 332 | 338 | ||
| 333 | /* for ease of use */ | 339 | /* for ease of use */ |
| 334 | struct sbmix_elem { | 340 | struct sbmix_elem { |
| @@ -352,7 +358,7 @@ struct sbmix_elem { | |||
| 352 | .type = SB_MIX_INPUT_SW, \ | 358 | .type = SB_MIX_INPUT_SW, \ |
| 353 | .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) } | 359 | .private_value = SB_MIXVAL_INPUT_SW(reg1, reg2, left_shift, right_shift) } |
| 354 | 360 | ||
| 355 | static inline int snd_sbmixer_add_ctl_elem(sb_t *chip, const struct sbmix_elem *c) | 361 | static inline int snd_sbmixer_add_ctl_elem(struct snd_sb *chip, const struct sbmix_elem *c) |
| 356 | { | 362 | { |
| 357 | return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value); | 363 | return snd_sbmixer_add_ctl(chip, c->name, 0, c->type, c->private_value); |
| 358 | } | 364 | } |
