aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/caiaq/control.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/sound/usb/caiaq/control.c b/sound/usb/caiaq/control.c
index 36ed703a7416..70c3866bb627 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];
@@ -113,15 +96,6 @@ static int control_put(struct snd_kcontrol *kcontrol,
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 switch (dev->chip.usb_id) {
116 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): {
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): 99 case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
126 cmd = EP1_CMD_DIMM_LEDS; 100 cmd = EP1_CMD_DIMM_LEDS;
127 break; 101 break;