support for Native Instrument's RigKontrol3
Subsystems (2)
PATCH 1/1 support for Native Instrument's RigKontrol3
Hi,
this patch addes support for Native Instrument's upcoming RigKontrol3 sound interface.
Greets,
Daniel
sound/usb/caiaq/caiaq-audio.c +1 -0
@@ -648,6 +648,7 @@ dev->samplerates = dev->pcm_info.rates;switch (dev->chip.usb_id) {case USB_ID (USB_VID_NATIVEINSTRUMENTS ,USB_PID_AK1 ): +case USB_ID (USB_VID_NATIVEINSTRUMENTS ,USB_PID_RIGKONTROL3 ): dev->samplerates |=SNDRV_PCM_RATE_88200 ; dev->samplerates |=SNDRV_PCM_RATE_192000 ;break ;
sound/usb/caiaq/caiaq-device.c +16 -2
@@ -41,9 +41,10 @@#endif MODULE_AUTHOR ("Daniel Mack <[email protected]>" ); -MODULE_DESCRIPTION ("caiaq USB audio, version 1.1.0" ); +MODULE_DESCRIPTION ("caiaq USB audio, version 1.2.0" );MODULE_LICENSE ("GPL" );MODULE_SUPPORTED_DEVICE ("{{Native Instruments, RigKontrol2}," +"{Native Instruments, RigKontrol3}," "{Native Instruments, Kore Controller}," "{Native Instruments, Audio Kontrol 1}" "{Native Instruments, Audio 8 DJ}}" );
@@ -85,6 +86,11 @@ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE, .idVendor = USB_VID_NATIVEINSTRUMENTS, + .idProduct =USB_PID_RIGKONTROL3 + }, + { + .match_flags = USB_DEVICE_ID_MATCH_DEVICE, + .idVendor = USB_VID_NATIVEINSTRUMENTS, .idProduct =USB_PID_KORECONTROLLER }, {
@@ -226,7 +232,7 @@static void setup_card (struct snd_usb_caiaqdev *dev) {int ret; -char val[3 ]; +char val[4 ];/* device-specific startup specials */ switch (dev->chip.usb_id) {
@@ -237,6 +243,14 @@ val[2 ] =0x01 ;send_command (dev,EP1_CMD_WRITE_IO , val,3 );break ; +case USB_ID (USB_VID_NATIVEINSTRUMENTS ,USB_PID_RIGKONTROL3 ): +/* RigKontrol2 - display two centered dashes ('--') */ + val[0 ] =0x00 ; + val[1 ] =0x40 ; + val[2 ] =0x40 ; + val[3 ] =0x00 ; +send_command (dev,EP1_CMD_WRITE_IO , val,4 ); +break ;case USB_ID (USB_VID_NATIVEINSTRUMENTS ,USB_PID_AK1 ):/* Audio Kontrol 1 - make USB-LED stop blinking */ val[0 ] =0x00 ;
sound/usb/caiaq/caiaq-device.h +1 -0
@@ -6,6 +6,7 @@#define USB_VID_NATIVEINSTRUMENTS 0x17cc#define USB_PID_RIGKONTROL2 0x1969 +#define USB_PID_RIGKONTROL3 0x1940#define USB_PID_KORECONTROLLER 0x4711#define USB_PID_AK1 0x0815#define USB_PID_AUDIO8DJ 0x1978
sound/usb/caiaq/caiaq-input.c +24 -2
@@ -34,6 +34,8 @@static unsigned char keycode_ak1[] = {KEY_C ,KEY_B ,KEY_A };static unsigned char keycode_rk2[] = {KEY_1 ,KEY_2 ,KEY_3 ,KEY_4 ,KEY_5 ,KEY_6 ,KEY_7 }; +static unsigned char keycode_rk3[] = {KEY_1 ,KEY_2 ,KEY_3 ,KEY_4 , +KEY_5 ,KEY_6 ,KEY_7 ,KEY_5 ,KEY_6 };#define DEG90 (range/2)#define DEG180 (range)
@@ -107,7 +109,7 @@static void snd_caiaq_input_read_analog (struct snd_usb_caiaqdev *dev, -const char *buf,unsigned int len) +const unsigned char *buf,unsigned int len) {switch (dev->input_dev->id.product) {case USB_PID_RIGKONTROL2 :
@@ -116,6 +118,12 @@input_report_abs (dev->input_dev,ABS_Z , (buf[2 ] <<8 ) |buf[3 ]);input_sync (dev->input_dev);break ; +case USB_PID_RIGKONTROL3 : +input_report_abs (dev->input_dev,ABS_X , (buf[0 ] <<8 ) |buf[1 ]); +input_report_abs (dev->input_dev,ABS_Y , (buf[2 ] <<8 ) |buf[3 ]); +input_report_abs (dev->input_dev,ABS_Z , (buf[4 ] <<8 ) |buf[5 ]); +input_sync (dev->input_dev); +break ; } }
@@ -128,7 +136,7 @@case USB_PID_AK1 : i =decode_erp (buf[0 ], buf[1 ]);input_report_abs (dev->input_dev,ABS_X , i); -input_sync (dev->input_dev); +input_sync (dev->input_dev);break ; } }
@@ -204,6 +212,20 @@input_set_abs_params (input,ABS_Z ,0 ,4096 ,0 ,10 );snd_usb_caiaq_set_auto_msg (dev,1 ,10 ,0 );break ; +case USB_ID (USB_VID_NATIVEINSTRUMENTS ,USB_PID_RIGKONTROL3 ): + input->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_ABS ); + input->absbit[0 ] =BIT (ABS_X ) |BIT (ABS_Y ) |BIT (ABS_Z ); + input->keycode = keycode_rk3; + input->keycodesize =sizeof (char ); + input->keycodemax =ARRAY_SIZE (keycode_rk3); +for (i=0 ; i<ARRAY_SIZE (keycode_rk3); i++) +set_bit (keycode_rk3[i], input->keybit); + +input_set_abs_params (input,ABS_X ,0 ,1024 ,0 ,10 ); +input_set_abs_params (input,ABS_Y ,0 ,1024 ,0 ,10 ); +input_set_abs_params (input,ABS_Z ,0 ,1024 ,0 ,10 ); +snd_usb_caiaq_set_auto_msg (dev,1 ,10 ,0 ); +break ;case USB_ID (USB_VID_NATIVEINSTRUMENTS ,USB_PID_AK1 ): input->evbit[0 ] =BIT (EV_KEY ) |BIT (EV_ABS ); input->absbit[0 ] =BIT (ABS_X );
sound/usb/Kconfig +2 -0
@@ -40,6 +40,7 @@ namely: * Native Instruments RigKontrol2 + * Native Instruments RigKontrol3 * Native Instruments Kore Controller * Native Instruments Audio Kontrol 1 * Native Instruments Audio 8 DJ
@@ -55,6 +56,7 @@ alpha dials and analog pedals on the following products: * Native Instruments RigKontrol2 + * Native Instruments RigKontrol3 * Native Instruments Audio Kontrol 1 endmenu
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel