Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
device.h
Go to the documentation of this file.
1 #ifndef CAIAQ_DEVICE_H
2 #define CAIAQ_DEVICE_H
3 
4 #include "../usbaudio.h"
5 
6 #define USB_VID_NATIVEINSTRUMENTS 0x17cc
7 
8 #define USB_PID_RIGKONTROL2 0x1969
9 #define USB_PID_RIGKONTROL3 0x1940
10 #define USB_PID_KORECONTROLLER 0x4711
11 #define USB_PID_KORECONTROLLER2 0x4712
12 #define USB_PID_AK1 0x0815
13 #define USB_PID_AUDIO2DJ 0x041c
14 #define USB_PID_AUDIO4DJ 0x0839
15 #define USB_PID_AUDIO8DJ 0x1978
16 #define USB_PID_SESSIONIO 0x1915
17 #define USB_PID_GUITARRIGMOBILE 0x0d8d
18 #define USB_PID_TRAKTORKONTROLX1 0x2305
19 #define USB_PID_TRAKTORKONTROLS4 0xbaff
20 #define USB_PID_TRAKTORAUDIO2 0x041d
21 #define USB_PID_MASCHINECONTROLLER 0x0808
22 
23 #define EP1_BUFSIZE 64
24 #define EP4_BUFSIZE 512
25 #define CAIAQ_USB_STR_LEN 0xff
26 #define MAX_STREAMS 32
27 
28 //#define SND_USB_CAIAQ_DEBUG
29 
30 #define MODNAME "snd-usb-caiaq"
31 #define log(x...) snd_printk(KERN_WARNING MODNAME" log: " x)
32 
33 #ifdef SND_USB_CAIAQ_DEBUG
34 #define debug(x...) snd_printk(KERN_WARNING MODNAME " debug: " x)
35 #else
36 #define debug(x...) do { } while(0)
37 #endif
38 
39 #define EP1_CMD_GET_DEVICE_INFO 0x1
40 #define EP1_CMD_READ_ERP 0x2
41 #define EP1_CMD_READ_ANALOG 0x3
42 #define EP1_CMD_READ_IO 0x4
43 #define EP1_CMD_WRITE_IO 0x5
44 #define EP1_CMD_MIDI_READ 0x6
45 #define EP1_CMD_MIDI_WRITE 0x7
46 #define EP1_CMD_AUDIO_PARAMS 0x9
47 #define EP1_CMD_AUTO_MSG 0xb
48 #define EP1_CMD_DIMM_LEDS 0xc
49 
51  unsigned short fw_version;
52  unsigned char hw_subtype;
53  unsigned char num_erp;
54  unsigned char num_analog_in;
55  unsigned char num_digital_in;
56  unsigned char num_digital_out;
57  unsigned char num_analog_audio_out;
58  unsigned char num_analog_audio_in;
59  unsigned char num_digital_audio_out;
60  unsigned char num_digital_audio_in;
61  unsigned char num_midi_out;
62  unsigned char num_midi_in;
63  unsigned char data_alignment;
64 } __attribute__ ((packed));
65 
67 
70 
71  struct urb ep1_in_urb;
72  struct urb midi_out_urb;
73  struct urb **data_urbs_in;
74  struct urb **data_urbs_out;
76 
77  unsigned char ep1_in_buf[EP1_BUFSIZE];
78  unsigned char ep1_out_buf[EP1_BUFSIZE];
79  unsigned char midi_out_buf[EP1_BUFSIZE];
80 
87 
90 
99  unsigned int samplerates, bpp;
100  unsigned long outurb_active_mask;
101 
104 
105  /* Controls */
106  unsigned char control_state[256];
107  unsigned char ep8_out_buf[2];
108 
109  /* Linux input */
110 #ifdef CONFIG_SND_USB_CAIAQ_INPUT
111  struct input_dev *input_dev;
112  char phys[64]; /* physical device path */
113  unsigned short keycode[128];
114  struct urb *ep4_in_urb;
115  unsigned char ep4_in_buf[EP4_BUFSIZE];
116 #endif
117 
118  /* ALSA */
119  struct snd_pcm *pcm;
124 };
125 
128  int index;
129 };
130 
131 #define caiaqdev(c) ((struct snd_usb_caiaqdev*)(c)->private_data)
132 
133 int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *dev, int rate, int depth, int bbp);
134 int snd_usb_caiaq_set_auto_msg (struct snd_usb_caiaqdev *dev, int digital, int analog, int erp);
136  unsigned char command,
137  const unsigned char *buffer,
138  int len);
139 
140 #endif /* CAIAQ_DEVICE_H */