mixer.h 1.8 KB

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