hwdep.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef __SOUND_HWDEP_H
  2. #define __SOUND_HWDEP_H
  3. /*
  4. * Hardware dependent layer
  5. * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. #include <sound/asound.h>
  24. #include <linux/poll.h>
  25. typedef enum sndrv_hwdep_iface snd_hwdep_iface_t;
  26. typedef struct sndrv_hwdep_info snd_hwdep_info_t;
  27. typedef struct sndrv_hwdep_dsp_status snd_hwdep_dsp_status_t;
  28. typedef struct sndrv_hwdep_dsp_image snd_hwdep_dsp_image_t;
  29. typedef struct _snd_hwdep_ops {
  30. long long (*llseek) (snd_hwdep_t *hw, struct file * file, long long offset, int orig);
  31. long (*read) (snd_hwdep_t * hw, char __user *buf, long count, loff_t *offset);
  32. long (*write) (snd_hwdep_t * hw, const char __user *buf, long count, loff_t *offset);
  33. int (*open) (snd_hwdep_t * hw, struct file * file);
  34. int (*release) (snd_hwdep_t * hw, struct file * file);
  35. unsigned int (*poll) (snd_hwdep_t * hw, struct file * file, poll_table * wait);
  36. int (*ioctl) (snd_hwdep_t * hw, struct file * file, unsigned int cmd, unsigned long arg);
  37. int (*ioctl_compat) (snd_hwdep_t * hw, struct file * file, unsigned int cmd, unsigned long arg);
  38. int (*mmap) (snd_hwdep_t * hw, struct file * file, struct vm_area_struct * vma);
  39. int (*dsp_status) (snd_hwdep_t * hw, snd_hwdep_dsp_status_t * status);
  40. int (*dsp_load) (snd_hwdep_t * hw, snd_hwdep_dsp_image_t * image);
  41. } snd_hwdep_ops_t;
  42. struct _snd_hwdep {
  43. snd_card_t *card;
  44. int device;
  45. char id[32];
  46. char name[80];
  47. int iface;
  48. #ifdef CONFIG_SND_OSSEMUL
  49. char oss_dev[32];
  50. int oss_type;
  51. int ossreg;
  52. #endif
  53. snd_hwdep_ops_t ops;
  54. wait_queue_head_t open_wait;
  55. void *private_data;
  56. void (*private_free) (snd_hwdep_t *hwdep);
  57. struct semaphore open_mutex;
  58. int used;
  59. unsigned int dsp_loaded;
  60. unsigned int exclusive: 1;
  61. };
  62. extern int snd_hwdep_new(snd_card_t * card, char *id, int device, snd_hwdep_t ** rhwdep);
  63. #endif /* __SOUND_HWDEP_H */