hwdep.h 2.0 KB

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