hwdep.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef __SOUND_HWDEP_H
  3. #define __SOUND_HWDEP_H
  4. /*
  5. * Hardware dependent layer
  6. * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  7. */
  8. #include <sound/asound.h>
  9. #include <linux/poll.h>
  10. struct snd_hwdep;
  11. /* hwdep file ops; all ops can be NULL */
  12. struct snd_hwdep_ops {
  13. long long (*llseek)(struct snd_hwdep *hw, struct file *file,
  14. long long offset, int orig);
  15. long (*read)(struct snd_hwdep *hw, char __user *buf,
  16. long count, loff_t *offset);
  17. long (*write)(struct snd_hwdep *hw, const char __user *buf,
  18. long count, loff_t *offset);
  19. int (*open)(struct snd_hwdep *hw, struct file * file);
  20. int (*release)(struct snd_hwdep *hw, struct file * file);
  21. __poll_t (*poll)(struct snd_hwdep *hw, struct file *file,
  22. poll_table *wait);
  23. int (*ioctl)(struct snd_hwdep *hw, struct file *file,
  24. unsigned int cmd, unsigned long arg);
  25. int (*ioctl_compat)(struct snd_hwdep *hw, struct file *file,
  26. unsigned int cmd, unsigned long arg);
  27. int (*mmap)(struct snd_hwdep *hw, struct file *file,
  28. struct vm_area_struct *vma);
  29. int (*dsp_status)(struct snd_hwdep *hw,
  30. struct snd_hwdep_dsp_status *status);
  31. int (*dsp_load)(struct snd_hwdep *hw,
  32. struct snd_hwdep_dsp_image *image);
  33. };
  34. struct snd_hwdep {
  35. struct snd_card *card;
  36. struct list_head list;
  37. int device;
  38. char id[32];
  39. char name[80];
  40. int iface;
  41. #ifdef CONFIG_SND_OSSEMUL
  42. int oss_type;
  43. int ossreg;
  44. #endif
  45. struct snd_hwdep_ops ops;
  46. wait_queue_head_t open_wait;
  47. void *private_data;
  48. void (*private_free) (struct snd_hwdep *hwdep);
  49. struct device *dev;
  50. struct mutex open_mutex;
  51. int used; /* reference counter */
  52. unsigned int dsp_loaded; /* bit fields of loaded dsp indices */
  53. unsigned int exclusive:1; /* exclusive access mode */
  54. };
  55. extern int snd_hwdep_new(struct snd_card *card, char *id, int device,
  56. struct snd_hwdep **rhwdep);
  57. #endif /* __SOUND_HWDEP_H */