aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/caiaq/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/caiaq/control.c')
-rw-r--r--sound/usb/caiaq/control.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/sound/usb/caiaq/control.c b/sound/usb/caiaq/control.c
index 36ed703a7416..91c804cd2782 100644
--- a/sound/usb/caiaq/control.c
+++ b/sound/usb/caiaq/control.c
@@ -42,21 +42,12 @@ static int control_info(struct snd_kcontrol *kcontrol,
42 42
43 switch (dev->chip.usb_id) { 43 switch (dev->chip.usb_id) {
44 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): 44 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
45 if (pos == 0) {
46 /* current input mode of A8DJ */
47 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
48 uinfo->value.integer.min = 0;
49 uinfo->value.integer.max = 2;
50 return 0;
51 }
52 break;
53
54 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): 45 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ):
55 if (pos == 0) { 46 if (pos == 0) {
56 /* current input mode of A4DJ */ 47 /* current input mode of A8DJ and A4DJ */
57 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 48 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
58 uinfo->value.integer.min = 0; 49 uinfo->value.integer.min = 0;
59 uinfo->value.integer.max = 1; 50 uinfo->value.integer.max = 2;
60 return 0; 51 return 0;
61 } 52 }
62 break; 53 break;
@@ -86,14 +77,6 @@ static int control_get(struct snd_kcontrol *kcontrol,
86 struct snd_usb_caiaqdev *dev = caiaqdev(chip->card); 77 struct snd_usb_caiaqdev *dev = caiaqdev(chip->card);
87 int pos = kcontrol->private_value; 78 int pos = kcontrol->private_value;
88 79
89 if (dev->chip.usb_id ==
90 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ)) {
91 /* A4DJ has only one control */
92 /* do not expose hardware input mode 0 */
93 ucontrol->value.integer.value[0] = dev->control_state[0] - 1;
94 return 0;
95 }
96
97 if (pos & CNT_INTVAL) 80 if (pos & CNT_INTVAL)
98 ucontrol->value.integer.value[0] 81 ucontrol->value.integer.value[0]
99 = dev->control_state[pos & ~CNT_INTVAL]; 82 = dev->control_state[pos & ~CNT_INTVAL];
@@ -112,20 +95,9 @@ static int control_put(struct snd_kcontrol *kcontrol,
112 int pos = kcontrol->private_value; 95 int pos = kcontrol->private_value;
113 unsigned char cmd = EP1_CMD_WRITE_IO; 96 unsigned char cmd = EP1_CMD_WRITE_IO;
114 97
115 switch (dev->chip.usb_id) { 98 if (dev->chip.usb_id ==
116 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): { 99 USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1))
117 /* A4DJ has only one control */
118 /* do not expose hardware input mode 0 */
119 dev->control_state[0] = ucontrol->value.integer.value[0] + 1;
120 snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO,
121 dev->control_state, sizeof(dev->control_state));
122 return 1;
123 }
124
125 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
126 cmd = EP1_CMD_DIMM_LEDS; 100 cmd = EP1_CMD_DIMM_LEDS;
127 break;
128 }
129 101
130 if (pos & CNT_INTVAL) { 102 if (pos & CNT_INTVAL) {
131 dev->control_state[pos & ~CNT_INTVAL] 103 dev->control_state[pos & ~CNT_INTVAL]