mixer.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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 ch_readonly;
  41. unsigned int master_readonly;
  42. int channels;
  43. int val_type;
  44. int min, max, res;
  45. int dBmin, dBmax;
  46. int cached;
  47. int cache_val[MAX_CHANNELS];
  48. u8 initialized;
  49. };
  50. int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
  51. int ignore_error);
  52. void snd_usb_mixer_disconnect(struct list_head *p);
  53. void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
  54. int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
  55. int request, int validx, int value_set);
  56. void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer);
  57. int snd_usb_mixer_activate(struct usb_mixer_interface *mixer);
  58. int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer,
  59. struct snd_kcontrol *kctl);
  60. #endif /* __USBMIXER_H */