bitmask: remove bitmap_scnprintf_len()
[linux-2.6.git] / sound / usb / caiaq / caiaq-input.c
index 00846b1f92b2e7b4eeca6ab3d70fe7139e7d6a9a..f743847a5e5a0a9e8aa7d1e8a67ccb204586821a 100644 (file)
 #include <linux/usb.h>
 #include <linux/usb/input.h>
 #include <linux/spinlock.h>
-#include <sound/driver.h>
 #include <sound/core.h>
 #include <sound/rawmidi.h>
 #include <sound/pcm.h>
 #include "caiaq-device.h"
 #include "caiaq-input.h"
 
-#ifdef CONFIG_SND_USB_CAIAQ_INPUT
-
 static unsigned short keycode_ak1[] =  { KEY_C, KEY_B, KEY_A };
 static unsigned short keycode_rk2[] =  { KEY_1, KEY_2, KEY_3, KEY_4,
                                         KEY_5, KEY_6, KEY_7 };
@@ -164,6 +161,7 @@ static void snd_caiaq_input_read_analog(struct snd_usb_caiaqdev *dev,
                input_sync(input_dev);
                break;
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
+       case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
                input_report_abs(input_dev, ABS_X, (buf[0] << 8) | buf[1]);
                input_report_abs(input_dev, ABS_Y, (buf[2] << 8) | buf[3]);
                input_report_abs(input_dev, ABS_Z, (buf[4] << 8) | buf[5]);
@@ -185,6 +183,7 @@ static void snd_caiaq_input_read_erp(struct snd_usb_caiaqdev *dev,
                input_sync(input_dev);
                break;
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
+       case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
                i = decode_erp(buf[7], buf[5]);
                input_report_abs(input_dev, ABS_HAT0X, i);
                i = decode_erp(buf[12], buf[14]);
@@ -225,7 +224,9 @@ static void snd_caiaq_input_read_io(struct snd_usb_caiaqdev *dev,
                                 buf[i / 8] & (1 << (i % 8)));
 
        if (dev->chip.usb_id ==
-           USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER))
+               USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER) ||
+           dev->chip.usb_id ==
+               USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2))
                input_report_abs(dev->input_dev, ABS_MISC, 255 - buf[4]);
 
        input_sync(input_dev);
@@ -304,6 +305,7 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *dev)
                snd_usb_caiaq_set_auto_msg(dev, 1, 0, 5);
                break;
        case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
+       case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
                input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
                input->absbit[0] = BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) |
                                   BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y) |
@@ -359,5 +361,3 @@ void snd_usb_caiaq_input_free(struct snd_usb_caiaqdev *dev)
        dev->input_dev = NULL;
 }
 
-#endif /* CONFIG_SND_USB_CAIAQ_INPUT */
-