audio.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #define CS_AUDIO_UNDEFINED 0x20
  2. #define CS_AUDIO_DEVICE 0x21
  3. #define CS_AUDIO_CONFIGURATION 0x22
  4. #define CS_AUDIO_STRING 0x23
  5. #define CS_AUDIO_INTERFACE 0x24
  6. #define CS_AUDIO_ENDPOINT 0x25
  7. #define HEADER 0x01
  8. #define INPUT_TERMINAL 0x02
  9. #define OUTPUT_TERMINAL 0x03
  10. #define MIXER_UNIT 0x04
  11. #define SELECTOR_UNIT 0x05
  12. #define FEATURE_UNIT 0x06
  13. #define PROCESSING_UNIT 0x07
  14. #define EXTENSION_UNIT 0x08
  15. #define AS_GENERAL 0x01
  16. #define FORMAT_TYPE 0x02
  17. #define FORMAT_SPECIFIC 0x03
  18. #define EP_GENERAL 0x01
  19. #define MAX_CHAN 9
  20. #define MAX_FREQ 16
  21. #define MAX_IFACE 8
  22. #define MAX_FORMAT 8
  23. #define MAX_ALT 32 /* Sorry, we need quite a few for the Philips webcams */
  24. struct usb_audio_terminal
  25. {
  26. u8 flags;
  27. u8 assoc;
  28. u16 type; /* Mic etc */
  29. u8 channels;
  30. u8 source;
  31. u16 chancfg;
  32. };
  33. struct usb_audio_format
  34. {
  35. u8 type;
  36. u8 channels;
  37. u8 num_freq;
  38. u8 sfz;
  39. u8 bits;
  40. u16 freq[MAX_FREQ];
  41. };
  42. struct usb_audio_interface
  43. {
  44. u8 terminal;
  45. u8 delay;
  46. u16 num_formats;
  47. u16 format_type;
  48. u8 flags;
  49. u8 idleconf; /* Idle config */
  50. #define AU_IFACE_FOUND 1
  51. struct usb_audio_format format[MAX_FORMAT];
  52. };
  53. struct usb_audio_device
  54. {
  55. struct list_head list;
  56. u8 mixer;
  57. u8 selector;
  58. void *irq_handle;
  59. u8 num_channels;
  60. u8 num_dsp_iface;
  61. u8 channel_map[MAX_CHAN];
  62. struct usb_audio_terminal terminal[MAX_CHAN];
  63. struct usb_audio_interface interface[MAX_IFACE][MAX_ALT];
  64. };
  65. /* Audio Class specific Request Codes */
  66. #define SET_CUR 0x01
  67. #define GET_CUR 0x81
  68. #define SET_MIN 0x02
  69. #define GET_MIN 0x82
  70. #define SET_MAX 0x03
  71. #define GET_MAX 0x83
  72. #define SET_RES 0x04
  73. #define GET_RES 0x84
  74. #define SET_MEM 0x05
  75. #define GET_MEM 0x85
  76. #define GET_STAT 0xff
  77. /* Terminal Control Selectors */
  78. #define COPY_PROTECT_CONTROL 0x01
  79. /* Feature Unit Control Selectors */
  80. #define MUTE_CONTROL 0x01
  81. #define VOLUME_CONTROL 0x02
  82. #define BASS_CONTROL 0x03
  83. #define MID_CONTROL 0x04
  84. #define TREBLE_CONTROL 0x05
  85. #define GRAPHIC_EQUALIZER_CONTROL 0x06
  86. #define AUTOMATIC_GAIN_CONTROL 0x07
  87. #define DELAY_CONTROL 0x08
  88. #define BASS_BOOST_CONTROL 0x09
  89. #define LOUDNESS_CONTROL 0x0a
  90. /* Endpoint Control Selectors */
  91. #define SAMPLING_FREQ_CONTROL 0x01
  92. #define PITCH_CONTROL 0x02