hwdep.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. int device;
  42. char id[32];
  43. char name[80];
  44. int iface;
  45. #ifdef CONFIG_SND_OSSEMUL
  46. char oss_dev[32];
  47. int oss_type;
  48. int ossreg;
  49. #endif
  50. struct snd_hwdep_ops ops;
  51. wait_queue_head_t open_wait;
  52. void *private_data;
  53. void (*private_free) (struct snd_hwdep *hwdep);
  54. struct semaphore open_mutex;
  55. int used;
  56. unsigned int dsp_loaded;
  57. unsigned int exclusive: 1;
  58. };
  59. extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
  60. struct snd_hwdep **rhwdep);
  61. #endif /* __SOUND_HWDEP_H */