mixer.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. };
  23. #define MAX_CHANNELS 16 /* max logical channels */
  24. enum {
  25. USB_MIXER_BOOLEAN,
  26. USB_MIXER_INV_BOOLEAN,
  27. USB_MIXER_S8,
  28. USB_MIXER_U8,
  29. USB_MIXER_S16,
  30. USB_MIXER_U16,
  31. };
  32. struct usb_mixer_elem_info {
  33. struct usb_mixer_interface *mixer;
  34. struct usb_mixer_elem_info *next_id_elem; /* list of controls with same id */
  35. struct snd_ctl_elem_id *elem_id;
  36. unsigned int id;
  37. unsigned int control; /* CS or ICN (high byte) */
  38. unsigned int cmask; /* channel mask bitmap: 0 = master */
  39. unsigned int ch_readonly;
  40. unsigned int master_readonly;
  41. int channels;
  42. int val_type;
  43. int min, max, res;
  44. int dBmin, dBmax;
  45. int cached;
  46. int cache_val[MAX_CHANNELS];
  47. u8 initialized;
  48. };
  49. int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
  50. int ignore_error);
  51. void snd_usb_mixer_disconnect(struct list_head *p);
  52. void snd_usb_mixer_notify_id(struct usb_mixer_interface *mixer, int unitid);
  53. int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
  54. int request, int validx, int value_set);
  55. void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer);
  56. int snd_usb_mixer_activate(struct usb_mixer_interface *mixer);
  57. int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer,
  58. struct snd_kcontrol *kctl);
  59. #endif /* __USBMIXER_H */