xref: /linux/sound/usb/caiaq/control.c (revision 8dd06ef34b6e2f41b29fbf5fc1663780f2524285)
11a59d1b8SThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
2936e7d03SDaniel Mack /*
3936e7d03SDaniel Mack  *   Copyright (c) 2007 Daniel Mack
4936e7d03SDaniel Mack  *   friendly supported by NI.
5936e7d03SDaniel Mack  */
6936e7d03SDaniel Mack 
7f1f6b8f6SDaniel Mack #include <linux/device.h>
8936e7d03SDaniel Mack #include <linux/init.h>
9936e7d03SDaniel Mack #include <linux/usb.h>
10936e7d03SDaniel Mack #include <sound/control.h>
11936e7d03SDaniel Mack #include <sound/core.h>
12936e7d03SDaniel Mack #include <sound/pcm.h>
13936e7d03SDaniel Mack 
14936e7d03SDaniel Mack #include "device.h"
15936e7d03SDaniel Mack #include "control.h"
16936e7d03SDaniel Mack 
17936e7d03SDaniel Mack #define CNT_INTVAL 0x10000
18d2724de1SHannes Gräuler #define MASCHINE_BANK_SIZE 32
19936e7d03SDaniel Mack 
control_info(struct snd_kcontrol * kcontrol,struct snd_ctl_elem_info * uinfo)20936e7d03SDaniel Mack static int control_info(struct snd_kcontrol *kcontrol,
21936e7d03SDaniel Mack 			struct snd_ctl_elem_info *uinfo)
22936e7d03SDaniel Mack {
23936e7d03SDaniel Mack 	struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol);
241c8470ceSDaniel Mack 	struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card);
25936e7d03SDaniel Mack 	int pos = kcontrol->private_value;
26936e7d03SDaniel Mack 	int is_intval = pos & CNT_INTVAL;
276da7a2aaSDaniel Mack 	int maxval = 63;
28936e7d03SDaniel Mack 
29936e7d03SDaniel Mack 	uinfo->count = 1;
30936e7d03SDaniel Mack 	pos &= ~CNT_INTVAL;
31936e7d03SDaniel Mack 
321c8470ceSDaniel Mack 	switch (cdev->chip.usb_id) {
336da7a2aaSDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
34bd4cbf6cSMark Hills 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ):
356da7a2aaSDaniel Mack 		if (pos == 0) {
36bd4cbf6cSMark Hills 			/* current input mode of A8DJ and A4DJ */
37936e7d03SDaniel Mack 			uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
38936e7d03SDaniel Mack 			uinfo->value.integer.min = 0;
39936e7d03SDaniel Mack 			uinfo->value.integer.max = 2;
40936e7d03SDaniel Mack 			return 0;
41936e7d03SDaniel Mack 		}
426da7a2aaSDaniel Mack 		break;
43936e7d03SDaniel Mack 
446da7a2aaSDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
456da7a2aaSDaniel Mack 		maxval = 127;
466da7a2aaSDaniel Mack 		break;
4715c5ab60SDaniel Mack 
4815c5ab60SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4):
4915c5ab60SDaniel Mack 		maxval = 31;
5015c5ab60SDaniel Mack 		break;
516da7a2aaSDaniel Mack 	}
52936e7d03SDaniel Mack 
53936e7d03SDaniel Mack 	if (is_intval) {
54936e7d03SDaniel Mack 		uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
55936e7d03SDaniel Mack 		uinfo->value.integer.min = 0;
566da7a2aaSDaniel Mack 		uinfo->value.integer.max = maxval;
57936e7d03SDaniel Mack 	} else {
58936e7d03SDaniel Mack 		uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
59936e7d03SDaniel Mack 		uinfo->value.integer.min = 0;
60936e7d03SDaniel Mack 		uinfo->value.integer.max = 1;
61936e7d03SDaniel Mack 	}
62936e7d03SDaniel Mack 
63936e7d03SDaniel Mack 	return 0;
64936e7d03SDaniel Mack }
65936e7d03SDaniel Mack 
control_get(struct snd_kcontrol * kcontrol,struct snd_ctl_elem_value * ucontrol)66936e7d03SDaniel Mack static int control_get(struct snd_kcontrol *kcontrol,
67936e7d03SDaniel Mack 		       struct snd_ctl_elem_value *ucontrol)
68936e7d03SDaniel Mack {
69936e7d03SDaniel Mack 	struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol);
701c8470ceSDaniel Mack 	struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card);
71936e7d03SDaniel Mack 	int pos = kcontrol->private_value;
72936e7d03SDaniel Mack 
73936e7d03SDaniel Mack 	if (pos & CNT_INTVAL)
74936e7d03SDaniel Mack 		ucontrol->value.integer.value[0]
751c8470ceSDaniel Mack 			= cdev->control_state[pos & ~CNT_INTVAL];
76936e7d03SDaniel Mack 	else
77936e7d03SDaniel Mack 		ucontrol->value.integer.value[0]
781c8470ceSDaniel Mack 			= !!(cdev->control_state[pos / 8] & (1 << pos % 8));
79936e7d03SDaniel Mack 
80936e7d03SDaniel Mack 	return 0;
81936e7d03SDaniel Mack }
82936e7d03SDaniel Mack 
control_put(struct snd_kcontrol * kcontrol,struct snd_ctl_elem_value * ucontrol)83936e7d03SDaniel Mack static int control_put(struct snd_kcontrol *kcontrol,
84936e7d03SDaniel Mack 		       struct snd_ctl_elem_value *ucontrol)
85936e7d03SDaniel Mack {
86936e7d03SDaniel Mack 	struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol);
871c8470ceSDaniel Mack 	struct snd_usb_caiaqdev *cdev = caiaqdev(chip->card);
88936e7d03SDaniel Mack 	int pos = kcontrol->private_value;
8915c5ab60SDaniel Mack 	int v = ucontrol->value.integer.value[0];
90e76bf634SDaniel Mack 	unsigned char cmd;
91936e7d03SDaniel Mack 
92e76bf634SDaniel Mack 	switch (cdev->chip.usb_id) {
93e76bf634SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER):
94e76bf634SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
95e76bf634SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
96e76bf634SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
976da7a2aaSDaniel Mack 		cmd = EP1_CMD_DIMM_LEDS;
98e76bf634SDaniel Mack 		break;
99e76bf634SDaniel Mack 	default:
100e76bf634SDaniel Mack 		cmd = EP1_CMD_WRITE_IO;
101e76bf634SDaniel Mack 		break;
102e76bf634SDaniel Mack 	}
103d2724de1SHannes Gräuler 
104936e7d03SDaniel Mack 	if (pos & CNT_INTVAL) {
10515c5ab60SDaniel Mack 		int i = pos & ~CNT_INTVAL;
10615c5ab60SDaniel Mack 
1071c8470ceSDaniel Mack 		cdev->control_state[i] = v;
10815c5ab60SDaniel Mack 
1091c8470ceSDaniel Mack 		if (cdev->chip.usb_id ==
11015c5ab60SDaniel Mack 			USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4)) {
11115c5ab60SDaniel Mack 			int actual_len;
11215c5ab60SDaniel Mack 
1131c8470ceSDaniel Mack 			cdev->ep8_out_buf[0] = i;
1141c8470ceSDaniel Mack 			cdev->ep8_out_buf[1] = v;
11515c5ab60SDaniel Mack 
1161c8470ceSDaniel Mack 			usb_bulk_msg(cdev->chip.dev,
1171c8470ceSDaniel Mack 				     usb_sndbulkpipe(cdev->chip.dev, 8),
1181c8470ceSDaniel Mack 				     cdev->ep8_out_buf, sizeof(cdev->ep8_out_buf),
11915c5ab60SDaniel Mack 				     &actual_len, 200);
120d2724de1SHannes Gräuler 		} else if (cdev->chip.usb_id ==
121d2724de1SHannes Gräuler 			USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER)) {
122d2724de1SHannes Gräuler 
123d2724de1SHannes Gräuler 			int bank = 0;
124d2724de1SHannes Gräuler 			int offset = 0;
125d2724de1SHannes Gräuler 
126d2724de1SHannes Gräuler 			if (i >= MASCHINE_BANK_SIZE) {
127d2724de1SHannes Gräuler 				bank = 0x1e;
128d2724de1SHannes Gräuler 				offset = MASCHINE_BANK_SIZE;
129d2724de1SHannes Gräuler 			}
130d2724de1SHannes Gräuler 
131d2724de1SHannes Gräuler 			snd_usb_caiaq_send_command_bank(cdev, cmd, bank,
132d2724de1SHannes Gräuler 					cdev->control_state + offset,
133d2724de1SHannes Gräuler 					MASCHINE_BANK_SIZE);
13415c5ab60SDaniel Mack 		} else {
1351c8470ceSDaniel Mack 			snd_usb_caiaq_send_command(cdev, cmd,
1361c8470ceSDaniel Mack 					cdev->control_state, sizeof(cdev->control_state));
13715c5ab60SDaniel Mack 		}
138936e7d03SDaniel Mack 	} else {
13915c5ab60SDaniel Mack 		if (v)
1401c8470ceSDaniel Mack 			cdev->control_state[pos / 8] |= 1 << (pos % 8);
141936e7d03SDaniel Mack 		else
1421c8470ceSDaniel Mack 			cdev->control_state[pos / 8] &= ~(1 << (pos % 8));
143936e7d03SDaniel Mack 
1441c8470ceSDaniel Mack 		snd_usb_caiaq_send_command(cdev, cmd,
1451c8470ceSDaniel Mack 				cdev->control_state, sizeof(cdev->control_state));
146936e7d03SDaniel Mack 	}
147936e7d03SDaniel Mack 
148936e7d03SDaniel Mack 	return 1;
149936e7d03SDaniel Mack }
150936e7d03SDaniel Mack 
15114c56706SBill Pemberton static struct snd_kcontrol_new kcontrol_template = {
152936e7d03SDaniel Mack 	.iface = SNDRV_CTL_ELEM_IFACE_HWDEP,
153936e7d03SDaniel Mack 	.access = SNDRV_CTL_ELEM_ACCESS_READWRITE,
154936e7d03SDaniel Mack 	.index = 0,
155936e7d03SDaniel Mack 	.info = control_info,
156936e7d03SDaniel Mack 	.get  = control_get,
157936e7d03SDaniel Mack 	.put  = control_put,
158936e7d03SDaniel Mack 	/* name and private_value filled later */
159936e7d03SDaniel Mack };
160936e7d03SDaniel Mack 
161936e7d03SDaniel Mack struct caiaq_controller {
162936e7d03SDaniel Mack 	char *name;
163936e7d03SDaniel Mack 	int index;
164936e7d03SDaniel Mack };
165936e7d03SDaniel Mack 
166*56d7058eSTakashi Iwai static const struct caiaq_controller ak1_controller[] = {
167936e7d03SDaniel Mack 	{ "LED left", 	2 },
168936e7d03SDaniel Mack 	{ "LED middle", 1 },
169936e7d03SDaniel Mack 	{ "LED right", 	0 },
170936e7d03SDaniel Mack 	{ "LED ring", 	3 }
171936e7d03SDaniel Mack };
172936e7d03SDaniel Mack 
173*56d7058eSTakashi Iwai static const struct caiaq_controller rk2_controller[] = {
174936e7d03SDaniel Mack 	{ "LED 1",		5  },
175936e7d03SDaniel Mack 	{ "LED 2",		4  },
176936e7d03SDaniel Mack 	{ "LED 3",		3  },
177936e7d03SDaniel Mack 	{ "LED 4",		2  },
178936e7d03SDaniel Mack 	{ "LED 5",		1  },
179936e7d03SDaniel Mack 	{ "LED 6",		0  },
180936e7d03SDaniel Mack 	{ "LED pedal",		6  },
181936e7d03SDaniel Mack 	{ "LED 7seg_1b",	8  },
182936e7d03SDaniel Mack 	{ "LED 7seg_1c",	9  },
183936e7d03SDaniel Mack 	{ "LED 7seg_2a",	10 },
184936e7d03SDaniel Mack 	{ "LED 7seg_2b",	11 },
185936e7d03SDaniel Mack 	{ "LED 7seg_2c",	12 },
186936e7d03SDaniel Mack 	{ "LED 7seg_2d",	13 },
187936e7d03SDaniel Mack 	{ "LED 7seg_2e",	14 },
188936e7d03SDaniel Mack 	{ "LED 7seg_2f",	15 },
189936e7d03SDaniel Mack 	{ "LED 7seg_2g",	16 },
190936e7d03SDaniel Mack 	{ "LED 7seg_3a",	17 },
191936e7d03SDaniel Mack 	{ "LED 7seg_3b",	18 },
192936e7d03SDaniel Mack 	{ "LED 7seg_3c",	19 },
193936e7d03SDaniel Mack 	{ "LED 7seg_3d",	20 },
194936e7d03SDaniel Mack 	{ "LED 7seg_3e",	21 },
195936e7d03SDaniel Mack 	{ "LED 7seg_3f",	22 },
196936e7d03SDaniel Mack 	{ "LED 7seg_3g",	23 }
197936e7d03SDaniel Mack };
198936e7d03SDaniel Mack 
199*56d7058eSTakashi Iwai static const struct caiaq_controller rk3_controller[] = {
200936e7d03SDaniel Mack 	{ "LED 7seg_1a",        0 + 0 },
201936e7d03SDaniel Mack 	{ "LED 7seg_1b",        0 + 1 },
202936e7d03SDaniel Mack 	{ "LED 7seg_1c",        0 + 2 },
203936e7d03SDaniel Mack 	{ "LED 7seg_1d",        0 + 3 },
204936e7d03SDaniel Mack 	{ "LED 7seg_1e",        0 + 4 },
205936e7d03SDaniel Mack 	{ "LED 7seg_1f",        0 + 5 },
206936e7d03SDaniel Mack 	{ "LED 7seg_1g",        0 + 6 },
207936e7d03SDaniel Mack 	{ "LED 7seg_1p",        0 + 7 },
208936e7d03SDaniel Mack 
209936e7d03SDaniel Mack 	{ "LED 7seg_2a",        8 + 0 },
210936e7d03SDaniel Mack 	{ "LED 7seg_2b",        8 + 1 },
211936e7d03SDaniel Mack 	{ "LED 7seg_2c",        8 + 2 },
212936e7d03SDaniel Mack 	{ "LED 7seg_2d",        8 + 3 },
213936e7d03SDaniel Mack 	{ "LED 7seg_2e",        8 + 4 },
214936e7d03SDaniel Mack 	{ "LED 7seg_2f",        8 + 5 },
215936e7d03SDaniel Mack 	{ "LED 7seg_2g",        8 + 6 },
216936e7d03SDaniel Mack 	{ "LED 7seg_2p",        8 + 7 },
217936e7d03SDaniel Mack 
218936e7d03SDaniel Mack 	{ "LED 7seg_3a",        16 + 0 },
219936e7d03SDaniel Mack 	{ "LED 7seg_3b",        16 + 1 },
220936e7d03SDaniel Mack 	{ "LED 7seg_3c",        16 + 2 },
221936e7d03SDaniel Mack 	{ "LED 7seg_3d",        16 + 3 },
222936e7d03SDaniel Mack 	{ "LED 7seg_3e",        16 + 4 },
223936e7d03SDaniel Mack 	{ "LED 7seg_3f",        16 + 5 },
224936e7d03SDaniel Mack 	{ "LED 7seg_3g",        16 + 6 },
225936e7d03SDaniel Mack 	{ "LED 7seg_3p",        16 + 7 },
226936e7d03SDaniel Mack 
227936e7d03SDaniel Mack 	{ "LED 7seg_4a",        24 + 0 },
228936e7d03SDaniel Mack 	{ "LED 7seg_4b",        24 + 1 },
229936e7d03SDaniel Mack 	{ "LED 7seg_4c",        24 + 2 },
230936e7d03SDaniel Mack 	{ "LED 7seg_4d",        24 + 3 },
231936e7d03SDaniel Mack 	{ "LED 7seg_4e",        24 + 4 },
232936e7d03SDaniel Mack 	{ "LED 7seg_4f",        24 + 5 },
233936e7d03SDaniel Mack 	{ "LED 7seg_4g",        24 + 6 },
234936e7d03SDaniel Mack 	{ "LED 7seg_4p",        24 + 7 },
235936e7d03SDaniel Mack 
236936e7d03SDaniel Mack 	{ "LED 1",		32 + 0 },
237936e7d03SDaniel Mack 	{ "LED 2",		32 + 1 },
238936e7d03SDaniel Mack 	{ "LED 3",		32 + 2 },
239936e7d03SDaniel Mack 	{ "LED 4",		32 + 3 },
240936e7d03SDaniel Mack 	{ "LED 5",		32 + 4 },
241936e7d03SDaniel Mack 	{ "LED 6",		32 + 5 },
242936e7d03SDaniel Mack 	{ "LED 7",		32 + 6 },
243936e7d03SDaniel Mack 	{ "LED 8",		32 + 7 },
244936e7d03SDaniel Mack 	{ "LED pedal",		32 + 8 }
245936e7d03SDaniel Mack };
246936e7d03SDaniel Mack 
247*56d7058eSTakashi Iwai static const struct caiaq_controller kore_controller[] = {
248936e7d03SDaniel Mack 	{ "LED F1",		8   | CNT_INTVAL },
249936e7d03SDaniel Mack 	{ "LED F2",		12  | CNT_INTVAL },
250936e7d03SDaniel Mack 	{ "LED F3",		0   | CNT_INTVAL },
251936e7d03SDaniel Mack 	{ "LED F4",		4   | CNT_INTVAL },
252936e7d03SDaniel Mack 	{ "LED F5",		11  | CNT_INTVAL },
253936e7d03SDaniel Mack 	{ "LED F6",		15  | CNT_INTVAL },
254936e7d03SDaniel Mack 	{ "LED F7",		3   | CNT_INTVAL },
255936e7d03SDaniel Mack 	{ "LED F8",		7   | CNT_INTVAL },
256936e7d03SDaniel Mack 	{ "LED touch1",	     	10  | CNT_INTVAL },
257936e7d03SDaniel Mack 	{ "LED touch2",	     	14  | CNT_INTVAL },
258936e7d03SDaniel Mack 	{ "LED touch3",	     	2   | CNT_INTVAL },
259936e7d03SDaniel Mack 	{ "LED touch4",	     	6   | CNT_INTVAL },
260936e7d03SDaniel Mack 	{ "LED touch5",	     	9   | CNT_INTVAL },
261936e7d03SDaniel Mack 	{ "LED touch6",	     	13  | CNT_INTVAL },
262936e7d03SDaniel Mack 	{ "LED touch7",	     	1   | CNT_INTVAL },
263936e7d03SDaniel Mack 	{ "LED touch8",	     	5   | CNT_INTVAL },
264936e7d03SDaniel Mack 	{ "LED left",	       	18  | CNT_INTVAL },
265936e7d03SDaniel Mack 	{ "LED right",	     	22  | CNT_INTVAL },
266936e7d03SDaniel Mack 	{ "LED up",		16  | CNT_INTVAL },
267936e7d03SDaniel Mack 	{ "LED down",	       	20  | CNT_INTVAL },
268936e7d03SDaniel Mack 	{ "LED stop",	       	23  | CNT_INTVAL },
269936e7d03SDaniel Mack 	{ "LED play",	       	21  | CNT_INTVAL },
270936e7d03SDaniel Mack 	{ "LED record",	     	19  | CNT_INTVAL },
271936e7d03SDaniel Mack 	{ "LED listen",		17  | CNT_INTVAL },
272936e7d03SDaniel Mack 	{ "LED lcd",		30  | CNT_INTVAL },
273936e7d03SDaniel Mack 	{ "LED menu",		28  | CNT_INTVAL },
274936e7d03SDaniel Mack 	{ "LED sound",	 	31  | CNT_INTVAL },
275936e7d03SDaniel Mack 	{ "LED esc",		29  | CNT_INTVAL },
276936e7d03SDaniel Mack 	{ "LED view",		27  | CNT_INTVAL },
277936e7d03SDaniel Mack 	{ "LED enter",		24  | CNT_INTVAL },
278936e7d03SDaniel Mack 	{ "LED control",	26  | CNT_INTVAL }
279936e7d03SDaniel Mack };
280936e7d03SDaniel Mack 
281*56d7058eSTakashi Iwai static const struct caiaq_controller a8dj_controller[] = {
282936e7d03SDaniel Mack 	{ "Current input mode",			0 | CNT_INTVAL 	},
283936e7d03SDaniel Mack 	{ "GND lift for TC Vinyl mode", 	24 + 0 		},
284936e7d03SDaniel Mack 	{ "GND lift for TC CD/Line mode", 	24 + 1 		},
285936e7d03SDaniel Mack 	{ "GND lift for phono mode", 		24 + 2 		},
286936e7d03SDaniel Mack 	{ "Software lock", 			40 		}
287936e7d03SDaniel Mack };
288936e7d03SDaniel Mack 
289*56d7058eSTakashi Iwai static const struct caiaq_controller a4dj_controller[] = {
290936e7d03SDaniel Mack 	{ "Current input mode",	0 | CNT_INTVAL 	}
291936e7d03SDaniel Mack };
292936e7d03SDaniel Mack 
293*56d7058eSTakashi Iwai static const struct caiaq_controller kontrolx1_controller[] = {
2946da7a2aaSDaniel Mack 	{ "LED FX A: ON",		7 | CNT_INTVAL	},
2956da7a2aaSDaniel Mack 	{ "LED FX A: 1",		6 | CNT_INTVAL	},
2966da7a2aaSDaniel Mack 	{ "LED FX A: 2",		5 | CNT_INTVAL	},
2976da7a2aaSDaniel Mack 	{ "LED FX A: 3",		4 | CNT_INTVAL	},
2986da7a2aaSDaniel Mack 	{ "LED FX B: ON",		3 | CNT_INTVAL	},
2996da7a2aaSDaniel Mack 	{ "LED FX B: 1",		2 | CNT_INTVAL	},
3006da7a2aaSDaniel Mack 	{ "LED FX B: 2",		1 | CNT_INTVAL	},
3016da7a2aaSDaniel Mack 	{ "LED FX B: 3",		0 | CNT_INTVAL	},
3026da7a2aaSDaniel Mack 
3036da7a2aaSDaniel Mack 	{ "LED Hotcue",			28 | CNT_INTVAL	},
3046da7a2aaSDaniel Mack 	{ "LED Shift (white)",		29 | CNT_INTVAL	},
3056da7a2aaSDaniel Mack 	{ "LED Shift (green)",		30 | CNT_INTVAL	},
3066da7a2aaSDaniel Mack 
3076da7a2aaSDaniel Mack 	{ "LED Deck A: FX1",		24 | CNT_INTVAL	},
3086da7a2aaSDaniel Mack 	{ "LED Deck A: FX2",		25 | CNT_INTVAL	},
3096da7a2aaSDaniel Mack 	{ "LED Deck A: IN",		17 | CNT_INTVAL	},
3106da7a2aaSDaniel Mack 	{ "LED Deck A: OUT",		16 | CNT_INTVAL	},
3116da7a2aaSDaniel Mack 	{ "LED Deck A: < BEAT",		19 | CNT_INTVAL	},
3126da7a2aaSDaniel Mack 	{ "LED Deck A: BEAT >",		18 | CNT_INTVAL	},
3136da7a2aaSDaniel Mack 	{ "LED Deck A: CUE/ABS",	21 | CNT_INTVAL	},
3146da7a2aaSDaniel Mack 	{ "LED Deck A: CUP/REL",	20 | CNT_INTVAL	},
3156da7a2aaSDaniel Mack 	{ "LED Deck A: PLAY",		23 | CNT_INTVAL	},
3166da7a2aaSDaniel Mack 	{ "LED Deck A: SYNC",		22 | CNT_INTVAL	},
3176da7a2aaSDaniel Mack 
3186da7a2aaSDaniel Mack 	{ "LED Deck B: FX1",		26 | CNT_INTVAL	},
3196da7a2aaSDaniel Mack 	{ "LED Deck B: FX2",		27 | CNT_INTVAL	},
3206da7a2aaSDaniel Mack 	{ "LED Deck B: IN",		15 | CNT_INTVAL	},
3216da7a2aaSDaniel Mack 	{ "LED Deck B: OUT",		14 | CNT_INTVAL	},
3226da7a2aaSDaniel Mack 	{ "LED Deck B: < BEAT",		13 | CNT_INTVAL	},
3236da7a2aaSDaniel Mack 	{ "LED Deck B: BEAT >",		12 | CNT_INTVAL	},
3246da7a2aaSDaniel Mack 	{ "LED Deck B: CUE/ABS",	11 | CNT_INTVAL	},
3256da7a2aaSDaniel Mack 	{ "LED Deck B: CUP/REL",	10 | CNT_INTVAL	},
3266da7a2aaSDaniel Mack 	{ "LED Deck B: PLAY",		9  | CNT_INTVAL	},
3276da7a2aaSDaniel Mack 	{ "LED Deck B: SYNC",		8  | CNT_INTVAL	},
3286da7a2aaSDaniel Mack };
3296da7a2aaSDaniel Mack 
330*56d7058eSTakashi Iwai static const struct caiaq_controller kontrols4_controller[] = {
33115c5ab60SDaniel Mack 	{ "LED: Master: Quant",			10  | CNT_INTVAL },
33215c5ab60SDaniel Mack 	{ "LED: Master: Headphone",		11  | CNT_INTVAL },
33315c5ab60SDaniel Mack 	{ "LED: Master: Master",		12  | CNT_INTVAL },
33415c5ab60SDaniel Mack 	{ "LED: Master: Snap",			14  | CNT_INTVAL },
33515c5ab60SDaniel Mack 	{ "LED: Master: Warning",		15  | CNT_INTVAL },
33615c5ab60SDaniel Mack 	{ "LED: Master: Master button",		112 | CNT_INTVAL },
33715c5ab60SDaniel Mack 	{ "LED: Master: Snap button",		113 | CNT_INTVAL },
33815c5ab60SDaniel Mack 	{ "LED: Master: Rec",			118 | CNT_INTVAL },
33915c5ab60SDaniel Mack 	{ "LED: Master: Size",			119 | CNT_INTVAL },
34015c5ab60SDaniel Mack 	{ "LED: Master: Quant button",		120 | CNT_INTVAL },
34115c5ab60SDaniel Mack 	{ "LED: Master: Browser button",	121 | CNT_INTVAL },
34215c5ab60SDaniel Mack 	{ "LED: Master: Play button",		126 | CNT_INTVAL },
34315c5ab60SDaniel Mack 	{ "LED: Master: Undo button",		127 | CNT_INTVAL },
34415c5ab60SDaniel Mack 
34515c5ab60SDaniel Mack 	{ "LED: Channel A: >",			4   | CNT_INTVAL },
34615c5ab60SDaniel Mack 	{ "LED: Channel A: <",			5   | CNT_INTVAL },
34715c5ab60SDaniel Mack 	{ "LED: Channel A: Meter 1",		97  | CNT_INTVAL },
34815c5ab60SDaniel Mack 	{ "LED: Channel A: Meter 2",		98  | CNT_INTVAL },
34915c5ab60SDaniel Mack 	{ "LED: Channel A: Meter 3",		99  | CNT_INTVAL },
35015c5ab60SDaniel Mack 	{ "LED: Channel A: Meter 4",		100 | CNT_INTVAL },
35115c5ab60SDaniel Mack 	{ "LED: Channel A: Meter 5",		101 | CNT_INTVAL },
35215c5ab60SDaniel Mack 	{ "LED: Channel A: Meter 6",		102 | CNT_INTVAL },
35315c5ab60SDaniel Mack 	{ "LED: Channel A: Meter clip",		103 | CNT_INTVAL },
35415c5ab60SDaniel Mack 	{ "LED: Channel A: Active",		114 | CNT_INTVAL },
35515c5ab60SDaniel Mack 	{ "LED: Channel A: Cue",		116 | CNT_INTVAL },
35615c5ab60SDaniel Mack 	{ "LED: Channel A: FX1",		149 | CNT_INTVAL },
35715c5ab60SDaniel Mack 	{ "LED: Channel A: FX2",		148 | CNT_INTVAL },
35815c5ab60SDaniel Mack 
35915c5ab60SDaniel Mack 	{ "LED: Channel B: >",			2   | CNT_INTVAL },
36015c5ab60SDaniel Mack 	{ "LED: Channel B: <",			3   | CNT_INTVAL },
36115c5ab60SDaniel Mack 	{ "LED: Channel B: Meter 1",		89  | CNT_INTVAL },
36215c5ab60SDaniel Mack 	{ "LED: Channel B: Meter 2",		90  | CNT_INTVAL },
36315c5ab60SDaniel Mack 	{ "LED: Channel B: Meter 3",		91  | CNT_INTVAL },
36415c5ab60SDaniel Mack 	{ "LED: Channel B: Meter 4",		92  | CNT_INTVAL },
36515c5ab60SDaniel Mack 	{ "LED: Channel B: Meter 5",		93  | CNT_INTVAL },
36615c5ab60SDaniel Mack 	{ "LED: Channel B: Meter 6",		94  | CNT_INTVAL },
36715c5ab60SDaniel Mack 	{ "LED: Channel B: Meter clip",		95  | CNT_INTVAL },
36815c5ab60SDaniel Mack 	{ "LED: Channel B: Active",		122 | CNT_INTVAL },
36915c5ab60SDaniel Mack 	{ "LED: Channel B: Cue",		125 | CNT_INTVAL },
37015c5ab60SDaniel Mack 	{ "LED: Channel B: FX1",		147 | CNT_INTVAL },
37115c5ab60SDaniel Mack 	{ "LED: Channel B: FX2",		146 | CNT_INTVAL },
37215c5ab60SDaniel Mack 
37315c5ab60SDaniel Mack 	{ "LED: Channel C: >",			6   | CNT_INTVAL },
37415c5ab60SDaniel Mack 	{ "LED: Channel C: <",			7   | CNT_INTVAL },
37515c5ab60SDaniel Mack 	{ "LED: Channel C: Meter 1",		105 | CNT_INTVAL },
37615c5ab60SDaniel Mack 	{ "LED: Channel C: Meter 2",		106 | CNT_INTVAL },
37715c5ab60SDaniel Mack 	{ "LED: Channel C: Meter 3",		107 | CNT_INTVAL },
37815c5ab60SDaniel Mack 	{ "LED: Channel C: Meter 4",		108 | CNT_INTVAL },
37915c5ab60SDaniel Mack 	{ "LED: Channel C: Meter 5",		109 | CNT_INTVAL },
38015c5ab60SDaniel Mack 	{ "LED: Channel C: Meter 6",		110 | CNT_INTVAL },
38115c5ab60SDaniel Mack 	{ "LED: Channel C: Meter clip",		111 | CNT_INTVAL },
38215c5ab60SDaniel Mack 	{ "LED: Channel C: Active",		115 | CNT_INTVAL },
38315c5ab60SDaniel Mack 	{ "LED: Channel C: Cue",		117 | CNT_INTVAL },
38415c5ab60SDaniel Mack 	{ "LED: Channel C: FX1",		151 | CNT_INTVAL },
38515c5ab60SDaniel Mack 	{ "LED: Channel C: FX2",		150 | CNT_INTVAL },
38615c5ab60SDaniel Mack 
38715c5ab60SDaniel Mack 	{ "LED: Channel D: >",			0   | CNT_INTVAL },
38815c5ab60SDaniel Mack 	{ "LED: Channel D: <",			1   | CNT_INTVAL },
38915c5ab60SDaniel Mack 	{ "LED: Channel D: Meter 1",		81  | CNT_INTVAL },
39015c5ab60SDaniel Mack 	{ "LED: Channel D: Meter 2",		82  | CNT_INTVAL },
39115c5ab60SDaniel Mack 	{ "LED: Channel D: Meter 3",		83  | CNT_INTVAL },
39215c5ab60SDaniel Mack 	{ "LED: Channel D: Meter 4",		84  | CNT_INTVAL },
39315c5ab60SDaniel Mack 	{ "LED: Channel D: Meter 5",		85  | CNT_INTVAL },
39415c5ab60SDaniel Mack 	{ "LED: Channel D: Meter 6",		86  | CNT_INTVAL },
39515c5ab60SDaniel Mack 	{ "LED: Channel D: Meter clip",		87  | CNT_INTVAL },
39615c5ab60SDaniel Mack 	{ "LED: Channel D: Active",		123 | CNT_INTVAL },
39715c5ab60SDaniel Mack 	{ "LED: Channel D: Cue",		124 | CNT_INTVAL },
39815c5ab60SDaniel Mack 	{ "LED: Channel D: FX1",		145 | CNT_INTVAL },
39915c5ab60SDaniel Mack 	{ "LED: Channel D: FX2",		144 | CNT_INTVAL },
40015c5ab60SDaniel Mack 
40115c5ab60SDaniel Mack 	{ "LED: Deck A: 1 (blue)",		22  | CNT_INTVAL },
40215c5ab60SDaniel Mack 	{ "LED: Deck A: 1 (green)",		23  | CNT_INTVAL },
40315c5ab60SDaniel Mack 	{ "LED: Deck A: 2 (blue)",		20  | CNT_INTVAL },
40415c5ab60SDaniel Mack 	{ "LED: Deck A: 2 (green)",		21  | CNT_INTVAL },
40515c5ab60SDaniel Mack 	{ "LED: Deck A: 3 (blue)",		18  | CNT_INTVAL },
40615c5ab60SDaniel Mack 	{ "LED: Deck A: 3 (green)",		19  | CNT_INTVAL },
40715c5ab60SDaniel Mack 	{ "LED: Deck A: 4 (blue)",		16  | CNT_INTVAL },
40815c5ab60SDaniel Mack 	{ "LED: Deck A: 4 (green)",		17  | CNT_INTVAL },
40915c5ab60SDaniel Mack 	{ "LED: Deck A: Load",			44  | CNT_INTVAL },
41015c5ab60SDaniel Mack 	{ "LED: Deck A: Deck C button",		45  | CNT_INTVAL },
41115c5ab60SDaniel Mack 	{ "LED: Deck A: In",			47  | CNT_INTVAL },
41215c5ab60SDaniel Mack 	{ "LED: Deck A: Out",			46  | CNT_INTVAL },
41315c5ab60SDaniel Mack 	{ "LED: Deck A: Shift",			24  | CNT_INTVAL },
41415c5ab60SDaniel Mack 	{ "LED: Deck A: Sync",			27  | CNT_INTVAL },
41515c5ab60SDaniel Mack 	{ "LED: Deck A: Cue",			26  | CNT_INTVAL },
41615c5ab60SDaniel Mack 	{ "LED: Deck A: Play",			25  | CNT_INTVAL },
41715c5ab60SDaniel Mack 	{ "LED: Deck A: Tempo up",		33  | CNT_INTVAL },
41815c5ab60SDaniel Mack 	{ "LED: Deck A: Tempo down",		32  | CNT_INTVAL },
41915c5ab60SDaniel Mack 	{ "LED: Deck A: Master",		34  | CNT_INTVAL },
42015c5ab60SDaniel Mack 	{ "LED: Deck A: Keylock",		35  | CNT_INTVAL },
42115c5ab60SDaniel Mack 	{ "LED: Deck A: Deck A",		37  | CNT_INTVAL },
42215c5ab60SDaniel Mack 	{ "LED: Deck A: Deck C",		36  | CNT_INTVAL },
42315c5ab60SDaniel Mack 	{ "LED: Deck A: Samples",		38  | CNT_INTVAL },
42415c5ab60SDaniel Mack 	{ "LED: Deck A: On Air",		39  | CNT_INTVAL },
42515c5ab60SDaniel Mack 	{ "LED: Deck A: Sample 1",		31  | CNT_INTVAL },
42615c5ab60SDaniel Mack 	{ "LED: Deck A: Sample 2",		30  | CNT_INTVAL },
42715c5ab60SDaniel Mack 	{ "LED: Deck A: Sample 3",		29  | CNT_INTVAL },
42815c5ab60SDaniel Mack 	{ "LED: Deck A: Sample 4",		28  | CNT_INTVAL },
42915c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - A",		55  | CNT_INTVAL },
43015c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - B",		54  | CNT_INTVAL },
43115c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - C",		53  | CNT_INTVAL },
43215c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - D",		52  | CNT_INTVAL },
43315c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - E",		51  | CNT_INTVAL },
43415c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - F",		50  | CNT_INTVAL },
43515c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - G",		49  | CNT_INTVAL },
43615c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 1 - dot",		48  | CNT_INTVAL },
43715c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - A",		63  | CNT_INTVAL },
43815c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - B",		62  | CNT_INTVAL },
43915c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - C",		61  | CNT_INTVAL },
44015c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - D",		60  | CNT_INTVAL },
44115c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - E",		59  | CNT_INTVAL },
44215c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - F",		58  | CNT_INTVAL },
44315c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - G",		57  | CNT_INTVAL },
44415c5ab60SDaniel Mack 	{ "LED: Deck A: Digit 2 - dot",		56  | CNT_INTVAL },
44515c5ab60SDaniel Mack 
44615c5ab60SDaniel Mack 	{ "LED: Deck B: 1 (blue)",		78  | CNT_INTVAL },
44715c5ab60SDaniel Mack 	{ "LED: Deck B: 1 (green)",		79  | CNT_INTVAL },
44815c5ab60SDaniel Mack 	{ "LED: Deck B: 2 (blue)",		76  | CNT_INTVAL },
44915c5ab60SDaniel Mack 	{ "LED: Deck B: 2 (green)",		77  | CNT_INTVAL },
45015c5ab60SDaniel Mack 	{ "LED: Deck B: 3 (blue)",		74  | CNT_INTVAL },
45115c5ab60SDaniel Mack 	{ "LED: Deck B: 3 (green)",		75  | CNT_INTVAL },
45215c5ab60SDaniel Mack 	{ "LED: Deck B: 4 (blue)",		72  | CNT_INTVAL },
45315c5ab60SDaniel Mack 	{ "LED: Deck B: 4 (green)",		73  | CNT_INTVAL },
45415c5ab60SDaniel Mack 	{ "LED: Deck B: Load",			180 | CNT_INTVAL },
45515c5ab60SDaniel Mack 	{ "LED: Deck B: Deck D button",		181 | CNT_INTVAL },
45615c5ab60SDaniel Mack 	{ "LED: Deck B: In",			183 | CNT_INTVAL },
45715c5ab60SDaniel Mack 	{ "LED: Deck B: Out",			182 | CNT_INTVAL },
45815c5ab60SDaniel Mack 	{ "LED: Deck B: Shift",			64  | CNT_INTVAL },
45915c5ab60SDaniel Mack 	{ "LED: Deck B: Sync",			67  | CNT_INTVAL },
46015c5ab60SDaniel Mack 	{ "LED: Deck B: Cue",			66  | CNT_INTVAL },
46115c5ab60SDaniel Mack 	{ "LED: Deck B: Play",			65  | CNT_INTVAL },
46215c5ab60SDaniel Mack 	{ "LED: Deck B: Tempo up",		185 | CNT_INTVAL },
46315c5ab60SDaniel Mack 	{ "LED: Deck B: Tempo down",		184 | CNT_INTVAL },
46415c5ab60SDaniel Mack 	{ "LED: Deck B: Master",		186 | CNT_INTVAL },
46515c5ab60SDaniel Mack 	{ "LED: Deck B: Keylock",		187 | CNT_INTVAL },
46615c5ab60SDaniel Mack 	{ "LED: Deck B: Deck B",		189 | CNT_INTVAL },
46715c5ab60SDaniel Mack 	{ "LED: Deck B: Deck D",		188 | CNT_INTVAL },
46815c5ab60SDaniel Mack 	{ "LED: Deck B: Samples",		190 | CNT_INTVAL },
46915c5ab60SDaniel Mack 	{ "LED: Deck B: On Air",		191 | CNT_INTVAL },
47015c5ab60SDaniel Mack 	{ "LED: Deck B: Sample 1",		71  | CNT_INTVAL },
47115c5ab60SDaniel Mack 	{ "LED: Deck B: Sample 2",		70  | CNT_INTVAL },
47215c5ab60SDaniel Mack 	{ "LED: Deck B: Sample 3",		69  | CNT_INTVAL },
47315c5ab60SDaniel Mack 	{ "LED: Deck B: Sample 4",		68  | CNT_INTVAL },
47415c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - A",		175 | CNT_INTVAL },
47515c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - B",		174 | CNT_INTVAL },
47615c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - C",		173 | CNT_INTVAL },
47715c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - D",		172 | CNT_INTVAL },
47815c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - E",		171 | CNT_INTVAL },
47915c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - F",		170 | CNT_INTVAL },
48015c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - G",		169 | CNT_INTVAL },
48115c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 1 - dot",		168 | CNT_INTVAL },
48215c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - A",		167 | CNT_INTVAL },
48315c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - B",		166 | CNT_INTVAL },
48415c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - C",		165 | CNT_INTVAL },
48515c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - D",		164 | CNT_INTVAL },
48615c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - E",		163 | CNT_INTVAL },
48715c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - F",		162 | CNT_INTVAL },
48815c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - G",		161 | CNT_INTVAL },
48915c5ab60SDaniel Mack 	{ "LED: Deck B: Digit 2 - dot",		160 | CNT_INTVAL },
49015c5ab60SDaniel Mack 
49115c5ab60SDaniel Mack 	{ "LED: FX1: dry/wet",			153 | CNT_INTVAL },
49215c5ab60SDaniel Mack 	{ "LED: FX1: 1",			154 | CNT_INTVAL },
49315c5ab60SDaniel Mack 	{ "LED: FX1: 2",			155 | CNT_INTVAL },
49415c5ab60SDaniel Mack 	{ "LED: FX1: 3",			156 | CNT_INTVAL },
49515c5ab60SDaniel Mack 	{ "LED: FX1: Mode",			157 | CNT_INTVAL },
49615c5ab60SDaniel Mack 	{ "LED: FX2: dry/wet",			129 | CNT_INTVAL },
49715c5ab60SDaniel Mack 	{ "LED: FX2: 1",			130 | CNT_INTVAL },
49815c5ab60SDaniel Mack 	{ "LED: FX2: 2",			131 | CNT_INTVAL },
49915c5ab60SDaniel Mack 	{ "LED: FX2: 3",			132 | CNT_INTVAL },
50015c5ab60SDaniel Mack 	{ "LED: FX2: Mode",			133 | CNT_INTVAL },
50115c5ab60SDaniel Mack };
50215c5ab60SDaniel Mack 
503*56d7058eSTakashi Iwai static const struct caiaq_controller maschine_controller[] = {
504d2724de1SHannes Gräuler 	{ "LED: Pad 1",				3  | CNT_INTVAL },
505d2724de1SHannes Gräuler 	{ "LED: Pad 2",				2  | CNT_INTVAL },
506d2724de1SHannes Gräuler 	{ "LED: Pad 3",				1  | CNT_INTVAL },
507d2724de1SHannes Gräuler 	{ "LED: Pad 4",				0  | CNT_INTVAL },
508d2724de1SHannes Gräuler 	{ "LED: Pad 5",				7  | CNT_INTVAL },
509d2724de1SHannes Gräuler 	{ "LED: Pad 6",				6  | CNT_INTVAL },
510d2724de1SHannes Gräuler 	{ "LED: Pad 7",				5  | CNT_INTVAL },
511d2724de1SHannes Gräuler 	{ "LED: Pad 8",				4  | CNT_INTVAL },
512d2724de1SHannes Gräuler 	{ "LED: Pad 9",				11 | CNT_INTVAL },
513d2724de1SHannes Gräuler 	{ "LED: Pad 10",			10 | CNT_INTVAL },
514d2724de1SHannes Gräuler 	{ "LED: Pad 11",			9  | CNT_INTVAL },
515d2724de1SHannes Gräuler 	{ "LED: Pad 12",			8  | CNT_INTVAL },
516d2724de1SHannes Gräuler 	{ "LED: Pad 13",			15 | CNT_INTVAL },
517d2724de1SHannes Gräuler 	{ "LED: Pad 14",			14 | CNT_INTVAL },
518d2724de1SHannes Gräuler 	{ "LED: Pad 15",			13 | CNT_INTVAL },
519d2724de1SHannes Gräuler 	{ "LED: Pad 16",			12 | CNT_INTVAL },
520d2724de1SHannes Gräuler 
521d2724de1SHannes Gräuler 	{ "LED: Mute",				16 | CNT_INTVAL },
522d2724de1SHannes Gräuler 	{ "LED: Solo",				17 | CNT_INTVAL },
523d2724de1SHannes Gräuler 	{ "LED: Select",			18 | CNT_INTVAL },
524d2724de1SHannes Gräuler 	{ "LED: Duplicate",			19 | CNT_INTVAL },
525d2724de1SHannes Gräuler 	{ "LED: Navigate",			20 | CNT_INTVAL },
526d2724de1SHannes Gräuler 	{ "LED: Pad Mode",			21 | CNT_INTVAL },
527d2724de1SHannes Gräuler 	{ "LED: Pattern",			22 | CNT_INTVAL },
528d2724de1SHannes Gräuler 	{ "LED: Scene",				23 | CNT_INTVAL },
529d2724de1SHannes Gräuler 
530d2724de1SHannes Gräuler 	{ "LED: Shift",				24 | CNT_INTVAL },
531d2724de1SHannes Gräuler 	{ "LED: Erase",				25 | CNT_INTVAL },
532d2724de1SHannes Gräuler 	{ "LED: Grid",				26 | CNT_INTVAL },
533d2724de1SHannes Gräuler 	{ "LED: Right Bottom",			27 | CNT_INTVAL },
534d2724de1SHannes Gräuler 	{ "LED: Rec",				28 | CNT_INTVAL },
535d2724de1SHannes Gräuler 	{ "LED: Play",				29 | CNT_INTVAL },
536d2724de1SHannes Gräuler 	{ "LED: Left Bottom",			32 | CNT_INTVAL },
537d2724de1SHannes Gräuler 	{ "LED: Restart",			33 | CNT_INTVAL },
538d2724de1SHannes Gräuler 
539d2724de1SHannes Gräuler 	{ "LED: Group A",			41 | CNT_INTVAL },
540d2724de1SHannes Gräuler 	{ "LED: Group B",			40 | CNT_INTVAL },
541d2724de1SHannes Gräuler 	{ "LED: Group C",			37 | CNT_INTVAL },
542d2724de1SHannes Gräuler 	{ "LED: Group D",			36 | CNT_INTVAL },
543d2724de1SHannes Gräuler 	{ "LED: Group E",			39 | CNT_INTVAL },
544d2724de1SHannes Gräuler 	{ "LED: Group F",			38 | CNT_INTVAL },
545d2724de1SHannes Gräuler 	{ "LED: Group G",			35 | CNT_INTVAL },
546d2724de1SHannes Gräuler 	{ "LED: Group H",			34 | CNT_INTVAL },
547d2724de1SHannes Gräuler 
548d2724de1SHannes Gräuler 	{ "LED: Auto Write",			42 | CNT_INTVAL },
549d2724de1SHannes Gräuler 	{ "LED: Snap",				43 | CNT_INTVAL },
550d2724de1SHannes Gräuler 	{ "LED: Right Top",			44 | CNT_INTVAL },
551d2724de1SHannes Gräuler 	{ "LED: Left Top",			45 | CNT_INTVAL },
552d2724de1SHannes Gräuler 	{ "LED: Sampling",			46 | CNT_INTVAL },
553d2724de1SHannes Gräuler 	{ "LED: Browse",			47 | CNT_INTVAL },
554d2724de1SHannes Gräuler 	{ "LED: Step",				48 | CNT_INTVAL },
555d2724de1SHannes Gräuler 	{ "LED: Control",			49 | CNT_INTVAL },
556d2724de1SHannes Gräuler 
557d2724de1SHannes Gräuler 	{ "LED: Top Button 1",			57 | CNT_INTVAL },
558d2724de1SHannes Gräuler 	{ "LED: Top Button 2",			56 | CNT_INTVAL },
559d2724de1SHannes Gräuler 	{ "LED: Top Button 3",			55 | CNT_INTVAL },
560d2724de1SHannes Gräuler 	{ "LED: Top Button 4",			54 | CNT_INTVAL },
561d2724de1SHannes Gräuler 	{ "LED: Top Button 5",			53 | CNT_INTVAL },
562d2724de1SHannes Gräuler 	{ "LED: Top Button 6",			52 | CNT_INTVAL },
563d2724de1SHannes Gräuler 	{ "LED: Top Button 7",			51 | CNT_INTVAL },
564d2724de1SHannes Gräuler 	{ "LED: Top Button 8",			50 | CNT_INTVAL },
565d2724de1SHannes Gräuler 
566d2724de1SHannes Gräuler 	{ "LED: Note Repeat",			58 | CNT_INTVAL },
567d2724de1SHannes Gräuler 
568d2724de1SHannes Gräuler 	{ "Backlight Display",			59 | CNT_INTVAL }
569d2724de1SHannes Gräuler };
570d2724de1SHannes Gräuler 
add_controls(const struct caiaq_controller * c,int num,struct snd_usb_caiaqdev * cdev)571*56d7058eSTakashi Iwai static int add_controls(const struct caiaq_controller *c, int num,
5721c8470ceSDaniel Mack 			struct snd_usb_caiaqdev *cdev)
573936e7d03SDaniel Mack {
574936e7d03SDaniel Mack 	int i, ret;
575936e7d03SDaniel Mack 	struct snd_kcontrol *kc;
576936e7d03SDaniel Mack 
577936e7d03SDaniel Mack 	for (i = 0; i < num; i++, c++) {
578936e7d03SDaniel Mack 		kcontrol_template.name = c->name;
579936e7d03SDaniel Mack 		kcontrol_template.private_value = c->index;
5801c8470ceSDaniel Mack 		kc = snd_ctl_new1(&kcontrol_template, cdev);
5811c8470ceSDaniel Mack 		ret = snd_ctl_add(cdev->chip.card, kc);
582936e7d03SDaniel Mack 		if (ret < 0)
583936e7d03SDaniel Mack 			return ret;
584936e7d03SDaniel Mack 	}
585936e7d03SDaniel Mack 
586936e7d03SDaniel Mack 	return 0;
587936e7d03SDaniel Mack }
588936e7d03SDaniel Mack 
snd_usb_caiaq_control_init(struct snd_usb_caiaqdev * cdev)5891c8470ceSDaniel Mack int snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *cdev)
590936e7d03SDaniel Mack {
591936e7d03SDaniel Mack 	int ret = 0;
592936e7d03SDaniel Mack 
5931c8470ceSDaniel Mack 	switch (cdev->chip.usb_id) {
594936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AK1):
595936e7d03SDaniel Mack 		ret = add_controls(ak1_controller,
5961c8470ceSDaniel Mack 			ARRAY_SIZE(ak1_controller), cdev);
597936e7d03SDaniel Mack 		break;
598936e7d03SDaniel Mack 
599936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL2):
600936e7d03SDaniel Mack 		ret = add_controls(rk2_controller,
6011c8470ceSDaniel Mack 			ARRAY_SIZE(rk2_controller), cdev);
602936e7d03SDaniel Mack 		break;
603936e7d03SDaniel Mack 
604936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_RIGKONTROL3):
605936e7d03SDaniel Mack 		ret = add_controls(rk3_controller,
6061c8470ceSDaniel Mack 			ARRAY_SIZE(rk3_controller), cdev);
607936e7d03SDaniel Mack 		break;
608936e7d03SDaniel Mack 
609936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER):
610936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_KORECONTROLLER2):
611936e7d03SDaniel Mack 		ret = add_controls(kore_controller,
6121c8470ceSDaniel Mack 			ARRAY_SIZE(kore_controller), cdev);
613936e7d03SDaniel Mack 		break;
614936e7d03SDaniel Mack 
615936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
616936e7d03SDaniel Mack 		ret = add_controls(a8dj_controller,
6171c8470ceSDaniel Mack 			ARRAY_SIZE(a8dj_controller), cdev);
618936e7d03SDaniel Mack 		break;
6196da7a2aaSDaniel Mack 
620936e7d03SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ):
621936e7d03SDaniel Mack 		ret = add_controls(a4dj_controller,
6221c8470ceSDaniel Mack 			ARRAY_SIZE(a4dj_controller), cdev);
623936e7d03SDaniel Mack 		break;
6246da7a2aaSDaniel Mack 
6256da7a2aaSDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
6266da7a2aaSDaniel Mack 		ret = add_controls(kontrolx1_controller,
6271c8470ceSDaniel Mack 			ARRAY_SIZE(kontrolx1_controller), cdev);
6286da7a2aaSDaniel Mack 		break;
62915c5ab60SDaniel Mack 
63015c5ab60SDaniel Mack 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLS4):
63115c5ab60SDaniel Mack 		ret = add_controls(kontrols4_controller,
6321c8470ceSDaniel Mack 			ARRAY_SIZE(kontrols4_controller), cdev);
63315c5ab60SDaniel Mack 		break;
634d2724de1SHannes Gräuler 
635d2724de1SHannes Gräuler 	case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_MASCHINECONTROLLER):
636d2724de1SHannes Gräuler 		ret = add_controls(maschine_controller,
637d2724de1SHannes Gräuler 			ARRAY_SIZE(maschine_controller), cdev);
638d2724de1SHannes Gräuler 		break;
639936e7d03SDaniel Mack 	}
640936e7d03SDaniel Mack 
641936e7d03SDaniel Mack 	return ret;
642936e7d03SDaniel Mack }
643936e7d03SDaniel Mack 
644