diff options
author | Daniel Mack <daniel@caiaq.de> | 2007-11-26 03:00:56 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-01-31 11:29:29 -0500 |
commit | 7829d0eccbddc7431cc9af662c7cd3442b5598bd (patch) | |
tree | 87ffa944084e528ecb643f5a96591a9b550c3f21 /sound | |
parent | 389619f1063ed21cf237e2a8081be42e66d3c9a6 (diff) |
[ALSA] usb-caiaq - add support for Kore controller 2
Added support for Native Instrument's Kore controller 2. This device has
no audio but MIDI, input devices and ALSA controllers only.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/Kconfig | 2 | ||||
-rw-r--r-- | sound/usb/caiaq/caiaq-control.c | 1 | ||||
-rw-r--r-- | sound/usb/caiaq/caiaq-device.c | 28 | ||||
-rw-r--r-- | sound/usb/caiaq/caiaq-device.h | 1 | ||||
-rw-r--r-- | sound/usb/caiaq/caiaq-input.c | 7 |
5 files changed, 31 insertions, 8 deletions
diff --git a/sound/usb/Kconfig b/sound/usb/Kconfig index ccbf72e1a479..9351b8a765b9 100644 --- a/sound/usb/Kconfig +++ b/sound/usb/Kconfig | |||
@@ -42,6 +42,7 @@ config SND_USB_CAIAQ | |||
42 | * Native Instruments RigKontrol2 | 42 | * Native Instruments RigKontrol2 |
43 | * Native Instruments RigKontrol3 | 43 | * Native Instruments RigKontrol3 |
44 | * Native Instruments Kore Controller | 44 | * Native Instruments Kore Controller |
45 | * Native Instruments Kore Controller 2 | ||
45 | * Native Instruments Audio Kontrol 1 | 46 | * Native Instruments Audio Kontrol 1 |
46 | * Native Instruments Audio 8 DJ | 47 | * Native Instruments Audio 8 DJ |
47 | 48 | ||
@@ -59,6 +60,7 @@ config SND_USB_CAIAQ_INPUT | |||
59 | * Native Instruments RigKontrol2 | 60 | * Native Instruments RigKontrol2 |
60 | * Native Instruments RigKontrol3 | 61 | * Native Instruments RigKontrol3 |
61 | * Native Instruments Kore Controller | 62 | * Native Instruments Kore Controller |
63 | * Native Instruments Kore Controller 2 | ||
62 | * Native Instruments Audio Kontrol 1 | 64 | * Native Instruments Audio Kontrol 1 |
63 | 65 | ||
64 | endmenu | 66 | endmenu |
diff --git a/sound/usb/caiaq/caiaq-control.c b/sound/usb/caiaq/caiaq-control.c index 14e8e32de925..7d25f4b25534 100644 --- a/sound/usb/caiaq/caiaq-control.c +++ b/sound/usb/caiaq/caiaq-control.c | |||
@@ -288,6 +288,7 @@ int __devinit snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *dev) | |||
288 | break; | 288 | break; |
289 | 289 | ||
290 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): | 290 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): |
291 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): | ||
291 | for (i = 0; i < ARRAY_SIZE(kore_controller); i++) { | 292 | for (i = 0; i < ARRAY_SIZE(kore_controller); i++) { |
292 | struct caiaq_controller *c = kore_controller + i; | 293 | struct caiaq_controller *c = kore_controller + i; |
293 | kcontrol_template.name = c->name; | 294 | kcontrol_template.name = c->name; |
diff --git a/sound/usb/caiaq/caiaq-device.c b/sound/usb/caiaq/caiaq-device.c index dc2e7f7fef0f..48c6bedfe0f2 100644 --- a/sound/usb/caiaq/caiaq-device.c +++ b/sound/usb/caiaq/caiaq-device.c | |||
@@ -43,11 +43,12 @@ | |||
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); | 45 | MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>"); |
46 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.0"); | 46 | MODULE_DESCRIPTION("caiaq USB audio, version 1.3.1"); |
47 | MODULE_LICENSE("GPL"); | 47 | MODULE_LICENSE("GPL"); |
48 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," | 48 | MODULE_SUPPORTED_DEVICE("{{Native Instruments, RigKontrol2}," |
49 | "{Native Instruments, RigKontrol3}," | 49 | "{Native Instruments, RigKontrol3}," |
50 | "{Native Instruments, Kore Controller}," | 50 | "{Native Instruments, Kore Controller}," |
51 | "{Native Instruments, Kore Controller 2}," | ||
51 | "{Native Instruments, Audio Kontrol 1}" | 52 | "{Native Instruments, Audio Kontrol 1}" |
52 | "{Native Instruments, Audio 8 DJ}}"); | 53 | "{Native Instruments, Audio 8 DJ}}"); |
53 | 54 | ||
@@ -96,6 +97,11 @@ static struct usb_device_id snd_usb_id_table[] = { | |||
96 | .idProduct = USB_PID_KORECONTROLLER | 97 | .idProduct = USB_PID_KORECONTROLLER |
97 | }, | 98 | }, |
98 | { | 99 | { |
100 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | ||
101 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | ||
102 | .idProduct = USB_PID_KORECONTROLLER2 | ||
103 | }, | ||
104 | { | ||
99 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, | 105 | .match_flags = USB_DEVICE_ID_MATCH_DEVICE, |
100 | .idVendor = USB_VID_NATIVEINSTRUMENTS, | 106 | .idVendor = USB_VID_NATIVEINSTRUMENTS, |
101 | .idProduct = USB_PID_AK1 | 107 | .idProduct = USB_PID_AK1 |
@@ -291,13 +297,21 @@ static void setup_card(struct snd_usb_caiaqdev *dev) | |||
291 | break; | 297 | break; |
292 | } | 298 | } |
293 | 299 | ||
294 | ret = snd_usb_caiaq_audio_init(dev); | 300 | if (dev->spec.num_analog_audio_out + |
295 | if (ret < 0) | 301 | dev->spec.num_analog_audio_in + |
296 | log("Unable to set up audio system (ret=%d)\n", ret); | 302 | dev->spec.num_digital_audio_out + |
303 | dev->spec.num_digital_audio_in > 0) { | ||
304 | ret = snd_usb_caiaq_audio_init(dev); | ||
305 | if (ret < 0) | ||
306 | log("Unable to set up audio system (ret=%d)\n", ret); | ||
307 | } | ||
297 | 308 | ||
298 | ret = snd_usb_caiaq_midi_init(dev); | 309 | if (dev->spec.num_midi_in + |
299 | if (ret < 0) | 310 | dev->spec.num_midi_out > 0) { |
300 | log("Unable to set up MIDI system (ret=%d)\n", ret); | 311 | ret = snd_usb_caiaq_midi_init(dev); |
312 | if (ret < 0) | ||
313 | log("Unable to set up MIDI system (ret=%d)\n", ret); | ||
314 | } | ||
301 | 315 | ||
302 | #ifdef CONFIG_SND_USB_CAIAQ_INPUT | 316 | #ifdef CONFIG_SND_USB_CAIAQ_INPUT |
303 | ret = snd_usb_caiaq_input_init(dev); | 317 | ret = snd_usb_caiaq_input_init(dev); |
diff --git a/sound/usb/caiaq/caiaq-device.h b/sound/usb/caiaq/caiaq-device.h index 310b10ebb605..96a491379c60 100644 --- a/sound/usb/caiaq/caiaq-device.h +++ b/sound/usb/caiaq/caiaq-device.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #define USB_PID_RIGKONTROL2 0x1969 | 8 | #define USB_PID_RIGKONTROL2 0x1969 |
9 | #define USB_PID_RIGKONTROL3 0x1940 | 9 | #define USB_PID_RIGKONTROL3 0x1940 |
10 | #define USB_PID_KORECONTROLLER 0x4711 | 10 | #define USB_PID_KORECONTROLLER 0x4711 |
11 | #define USB_PID_KORECONTROLLER2 0x4712 | ||
11 | #define USB_PID_AK1 0x0815 | 12 | #define USB_PID_AK1 0x0815 |
12 | #define USB_PID_AUDIO8DJ 0x1978 | 13 | #define USB_PID_AUDIO8DJ 0x1978 |
13 | 14 | ||
diff --git a/sound/usb/caiaq/caiaq-input.c b/sound/usb/caiaq/caiaq-input.c index ded45e5a0b14..e6c410ab76f4 100644 --- a/sound/usb/caiaq/caiaq-input.c +++ b/sound/usb/caiaq/caiaq-input.c | |||
@@ -162,6 +162,7 @@ static void snd_caiaq_input_read_analog(struct snd_usb_caiaqdev *dev, | |||
162 | input_sync(input_dev); | 162 | input_sync(input_dev); |
163 | break; | 163 | break; |
164 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): | 164 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): |
165 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): | ||
165 | input_report_abs(input_dev, ABS_X, (buf[0] << 8) | buf[1]); | 166 | input_report_abs(input_dev, ABS_X, (buf[0] << 8) | buf[1]); |
166 | input_report_abs(input_dev, ABS_Y, (buf[2] << 8) | buf[3]); | 167 | input_report_abs(input_dev, ABS_Y, (buf[2] << 8) | buf[3]); |
167 | input_report_abs(input_dev, ABS_Z, (buf[4] << 8) | buf[5]); | 168 | input_report_abs(input_dev, ABS_Z, (buf[4] << 8) | buf[5]); |
@@ -183,6 +184,7 @@ static void snd_caiaq_input_read_erp(struct snd_usb_caiaqdev *dev, | |||
183 | input_sync(input_dev); | 184 | input_sync(input_dev); |
184 | break; | 185 | break; |
185 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): | 186 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): |
187 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): | ||
186 | i = decode_erp(buf[7], buf[5]); | 188 | i = decode_erp(buf[7], buf[5]); |
187 | input_report_abs(input_dev, ABS_HAT0X, i); | 189 | input_report_abs(input_dev, ABS_HAT0X, i); |
188 | i = decode_erp(buf[12], buf[14]); | 190 | i = decode_erp(buf[12], buf[14]); |
@@ -223,7 +225,9 @@ static void snd_caiaq_input_read_io(struct snd_usb_caiaqdev *dev, | |||
223 | buf[i / 8] & (1 << (i % 8))); | 225 | buf[i / 8] & (1 << (i % 8))); |
224 | 226 | ||
225 | if (dev->chip.usb_id == | 227 | if (dev->chip.usb_id == |
226 | USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER)) | 228 | USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER) || |
229 | dev->chip.usb_id == | ||
230 | USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2)) | ||
227 | input_report_abs(dev->input_dev, ABS_MISC, 255 - buf[4]); | 231 | input_report_abs(dev->input_dev, ABS_MISC, 255 - buf[4]); |
228 | 232 | ||
229 | input_sync(input_dev); | 233 | input_sync(input_dev); |
@@ -302,6 +306,7 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *dev) | |||
302 | snd_usb_caiaq_set_auto_msg(dev, 1, 0, 5); | 306 | snd_usb_caiaq_set_auto_msg(dev, 1, 0, 5); |
303 | break; | 307 | break; |
304 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): | 308 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER): |
309 | case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2): | ||
305 | input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | 310 | input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); |
306 | input->absbit[0] = BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) | | 311 | input->absbit[0] = BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) | |
307 | BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y) | | 312 | BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y) | |