hwdep.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #ifndef __SOUND_HWDEP_H
  2. #define __SOUND_HWDEP_H
  3. /*
  4. * Hardware dependent layer
  5. * Copyright (c) by Jaroslav Kysela <perex@perex.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. struct snd_hwdep;
  26. /* hwdep file ops; all ops can be NULL */
  27. struct snd_hwdep_ops {
  28. long long (*llseek)(struct snd_hwdep *hw, struct file *file,
  29. long long offset, int orig);
  30. long (*read)(struct snd_hwdep *hw, char __user *buf,
  31. long count, loff_t *offset);
  32. long (*write)(struct snd_hwdep *hw, const char __user *buf,
  33. long count, loff_t *offset);
  34. int (*open)(struct snd_hwdep *hw, struct file * file);
  35. int (*release)(struct snd_hwdep *hw, struct file * file);
  36. unsigned int (*poll)(struct snd_hwdep *hw, struct file *file,
  37. poll_table *wait);
  38. int (*ioctl)(struct snd_hwdep *hw, struct file *file,
  39. unsigned int cmd, unsigned long arg);
  40. int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
  41. unsigned int cmd, unsigned long arg);
  42. int (*mmap)(struct snd_hwdep *hw, struct file *file,
  43. struct vm_area_struct *vma);
  44. int (*dsp_status)(struct snd_hwdep *hw,
  45. struct snd_hwdep_dsp_status *status);
  46. int (*dsp_load)(struct snd_hwdep *hw,
  47. struct snd_hwdep_dsp_image *image);
  48. };
  49. struct snd_hwdep {
  50. struct snd_card *card;
  51. struct list_head list;
  52. int device;
  53. char id[32];
  54. char name[80];
  55. int iface;
  56. #ifdef CONFIG_SND_OSSEMUL
  57. int oss_type;
  58. int ossreg;
  59. #endif
  60. struct snd_hwdep_ops ops;
  61. wait_queue_head_t open_wait;
  62. void *private_data;
  63. void (*private_free) (struct snd_hwdep *hwdep);
  64. struct device dev;
  65. struct mutex open_mutex;
  66. int used; /* reference counter */
  67. unsigned int dsp_loaded; /* bit fields of loaded dsp indices */
  68. unsigned int exclusive:1; /* exclusive access mode */
  69. };
  70. extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
  71. struct snd_hwdep **rhwdep);
  72. #endif /* __SOUND_HWDEP_H */