summaryrefslogtreecommitdiffstats
path: root/sound/usb/caiaq/device.c
diff options
context:
space:
mode:
authorHannes Gräuler <hgraeule@uos.de>2013-09-28 21:51:08 +0200
committerTakashi Iwai <tiwai@suse.de>2013-09-30 11:19:16 +0200
commitd2724de1874917be2a12939657820616742bd8ec (patch)
treec21a2e0857e4dca3a1148ea2d6bbe4d4deae642f /sound/usb/caiaq/device.c
parente84841f9ba134d3aa4cad5c16d05712672583c76 (diff)
downloadlinux-d2724de1874917be2a12939657820616742bd8ec.tar.bz2
ALSA: snd-usb-caiaq: LED support for Maschine Controller
This patch adds LED support for the Native Instruments Maschine Controller. It adds ALSA controls for dimming the LEDs of all buttons and the backlight of the two displays. Signed-off-by: Hannes Gräuler <hgraeule@uos.de> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/caiaq/device.c')
-rw-r--r--sound/usb/caiaq/device.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
index 1a61dd12fe38..bc55f708a696 100644
--- a/sound/usb/caiaq/device.c
+++ b/sound/usb/caiaq/device.c
@@ -235,6 +235,31 @@ int snd_usb_caiaq_send_command(struct snd_usb_caiaqdev *cdev,
cdev->ep1_out_buf, len+1, &actual_len, 200);
}
+int snd_usb_caiaq_send_command_bank(struct snd_usb_caiaqdev *cdev,
+ unsigned char command,
+ unsigned char bank,
+ const unsigned char *buffer,
+ int len)
+{
+ int actual_len;
+ struct usb_device *usb_dev = cdev->chip.dev;
+
+ if (!usb_dev)
+ return -EIO;
+
+ if (len > EP1_BUFSIZE - 2)
+ len = EP1_BUFSIZE - 2;
+
+ if (buffer && len > 0)
+ memcpy(cdev->ep1_out_buf+2, buffer, len);
+
+ cdev->ep1_out_buf[0] = command;
+ cdev->ep1_out_buf[1] = bank;
+
+ return usb_bulk_msg(usb_dev, usb_sndbulkpipe(usb_dev, 1),
+ cdev->ep1_out_buf, len+2, &actual_len, 200);
+}
+
int snd_usb_caiaq_set_audio_params (struct snd_usb_caiaqdev *cdev,
int rate, int depth, int bpp)
{