mixer.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef __USBMIXER_H
  2. #define __USBMIXER_H
  3. struct usb_mixer_interface {
  4. struct snd_usb_audio *chip;
  5. struct usb_host_interface *hostif;
  6. struct list_head list;
  7. unsigned int ignore_ctl_error;
  8. struct urb *urb;
  9. /* array[MAX_ID_ELEMS], indexed by unit id */
  10. struct usb_mixer_elem_info **id_elems;
  11. /* the usb audio specification version this interface complies to */
  12. int protocol;
  13. /* Sound Blaster remote control stuff */
  14. const struct rc_config *rc_cfg;
  15. u32 rc_code;
  16. wait_queue_head_t rc_waitq;
  17. struct urb *rc_urb;
  18. struct usb_ctrlrequest *rc_setup_packet;
  19. u8 rc_buffer[6];
  20. u8 audigy2nx_leds[3];
  21. u8 xonar_u1_status;
  22. bool disconnected;
  23. };
  24. #define MAX_CHANNELS 16 /* max logical channels */
  25. enum {
  26. USB_MIXER_BOOLEAN,
  27. USB_MIXER_INV_BOOLEAN,
  28. USB_MIXER_S8,
  29. USB_MIXER_U8,
  30. USB_MIXER_S16,
  31. USB_MIXER_U16,
  32. };
  33. struct usb_mixer_elem_info {
  34. struct usb_mixer_interface *mixer;
  35. struct usb_mixer_elem_info *next_id_elem; /* list of controls with same id */
  36. struct snd_ctl_elem_id *elem_id;
  37. unsigned int id;
  38. unsigned int control; /* CS or ICN (high byte) */
  39. unsigned int cmask; /* channel mask bitmap: 0 = master */
  40. unsigned int idx_off; /* Control index offset */
  41. unsigned int ch_readonly;
  42. unsigned int master_readonly;
  43. int channels;
  44. int val_type;
  45. int min, max, res;
  46. int dBmin, dBmax;
  47. int cached;
  48. int cache_val[MAX_CHANNELS];
  49. u8 initialized;
  50. };
  51. int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
  52. int ignore_error);
  53. void snd_usb_mixer_disconnect(struct list_head *p);
  54. void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
  55. int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
  56. int request, int validx, int value_set);
  57. int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer,
  58. struct snd_kcontrol *kctl);
  59. int snd_usb_mixer_vol_tlv(struct snd_kcontrol *kcontrol, int op_flag,
  60. unsigned int size, unsigned int __user *_tlv);
  61. #ifdef CONFIG_PM
  62. int snd_usb_mixer_suspend(struct usb_mixer_interface *mixer);
  63. int snd_usb_mixer_resume(struct usb_mixer_interface *mixer, bool reset_resume);
  64. #endif
  65. #endif /* __USBMIXER_H */