hwdep.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. struct snd_hwdep;
  26. struct snd_hwdep_ops {
  27. long long (*llseek) (struct snd_hwdep *hw, struct file * file, long long offset, int orig);
  28. long (*read) (struct snd_hwdep *hw, char __user *buf, long count, loff_t *offset);
  29. long (*write) (struct snd_hwdep *hw, const char __user *buf, long count, loff_t *offset);
  30. int (*open) (struct snd_hwdep * hw, struct file * file);
  31. int (*release) (struct snd_hwdep *hw, struct file * file);
  32. unsigned int (*poll) (struct snd_hwdep *hw, struct file * file, poll_table * wait);
  33. int (*ioctl) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg);
  34. int (*ioctl_compat) (struct snd_hwdep *hw, struct file * file, unsigned int cmd, unsigned long arg);
  35. int (*mmap) (struct snd_hwdep *hw, struct file * file, struct vm_area_struct * vma);
  36. int (*dsp_status) (struct snd_hwdep *hw, struct snd_hwdep_dsp_status *status);
  37. int (*dsp_load) (struct snd_hwdep *hw, struct snd_hwdep_dsp_image *image);
  38. };
  39. struct snd_hwdep {
  40. struct snd_card *card;
  41. struct list_head list;
  42. int device;
  43. char id[32];
  44. char name[80];
  45. int iface;
  46. #ifdef CONFIG_SND_OSSEMUL
  47. char oss_dev[32];
  48. int oss_type;
  49. int ossreg;
  50. #endif
  51. struct snd_hwdep_ops ops;
  52. wait_queue_head_t open_wait;
  53. void *private_data;
  54. void (*private_free) (struct snd_hwdep *hwdep);
  55. struct mutex open_mutex;
  56. int used;
  57. unsigned int dsp_loaded;
  58. unsigned int exclusive: 1;
  59. };
  60. extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
  61. struct snd_hwdep **rhwdep);
  62. #endif /* __SOUND_HWDEP_H */