From 2165592b837e086f2b94835a2d81e6f3199c1319 Mon Sep 17 00:00:00 2001 From: Daniel Mack Date: Fri, 16 Jan 2009 11:03:19 +0100 Subject: ALSA: snd-usb-caiaq: support for two more audio devices - Added support for two new audio devices from Native Instuments, 'Audio4DJ' and 'GuitarRig mobile' - Add missing statement about 'Session IO' in Kconfig help text - Version number bumped to 1.3.11 Signed-off-by: Daniel Mack Signed-off-by: Takashi Iwai --- sound/usb/caiaq/caiaq-control.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'sound/usb/caiaq/caiaq-control.c') diff --git a/sound/usb/caiaq/caiaq-control.c b/sound/usb/caiaq/caiaq-control.c index ccd763dd716..6ac5489a0f2 100644 --- a/sound/usb/caiaq/caiaq-control.c +++ b/sound/usb/caiaq/caiaq-control.c @@ -39,14 +39,15 @@ static int control_info(struct snd_kcontrol *kcontrol, struct snd_usb_caiaqdev *dev = caiaqdev(chip->card); int pos = kcontrol->private_value; int is_intval = pos & CNT_INTVAL; + unsigned int id = dev->chip.usb_id; uinfo->count = 1; pos &= ~CNT_INTVAL; - if (dev->chip.usb_id == - USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ) + if (((id == USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ)) || + (id == USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ))) && (pos == 0)) { - /* current input mode of A8DJ */ + /* current input mode of A8DJ and A4DJ */ uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->value.integer.min = 0; uinfo->value.integer.max = 2; @@ -247,6 +248,10 @@ static struct caiaq_controller a8dj_controller[] = { { "Software lock", 40 } }; +static struct caiaq_controller a4dj_controller[] = { + { "Current input mode", 0 | CNT_INTVAL } +}; + static int __devinit add_controls(struct caiaq_controller *c, int num, struct snd_usb_caiaqdev *dev) { @@ -295,6 +300,10 @@ int __devinit snd_usb_caiaq_control_init(struct snd_usb_caiaqdev *dev) ret = add_controls(a8dj_controller, ARRAY_SIZE(a8dj_controller), dev); break; + case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): + ret = add_controls(a4dj_controller, + ARRAY_SIZE(a4dj_controller), dev); + break; } return ret; -- cgit v1.2.3 From 705350f8bd6b44fda3f0dcc3e6f4b453da4378dd Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 4 Feb 2009 22:34:30 +0000 Subject: ALSA: snd-usb-caiaq: Send the correct command when setting controls Fixes a bug where an incorrect command was sent which had no effect on the device. Signed-off-by: Mark Hills Acked-by: Daniel Mack Signed-off-by: Takashi Iwai --- sound/usb/caiaq/caiaq-control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/usb/caiaq/caiaq-control.c') diff --git a/sound/usb/caiaq/caiaq-control.c b/sound/usb/caiaq/caiaq-control.c index 6ac5489a0f2..1f9531d0fce 100644 --- a/sound/usb/caiaq/caiaq-control.c +++ b/sound/usb/caiaq/caiaq-control.c @@ -94,7 +94,7 @@ static int control_put(struct snd_kcontrol *kcontrol, if (pos & CNT_INTVAL) { dev->control_state[pos & ~CNT_INTVAL] = ucontrol->value.integer.value[0]; - snd_usb_caiaq_send_command(dev, EP1_CMD_DIMM_LEDS, + snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO, dev->control_state, sizeof(dev->control_state)); } else { if (ucontrol->value.integer.value[0]) -- cgit v1.2.3 From 9a9527ed49f45e75a5b005592a261ab2bd7c1b1d Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 4 Feb 2009 22:34:32 +0000 Subject: ALSA: snd-usb-caiaq: Do not expose hardware input mode 0 of A4DJ In the context of the Audio 4 DJ (when compared to Audio 8 DJ), hardware input mode 0 is not used. Expose modes 1 (line) and 2 (phono) to the user as modes 0 and 1 respectively. Signed-off-by: Mark Hills Acked-by: Daniel Mack Signed-off-by: Takashi Iwai --- sound/usb/caiaq/caiaq-control.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'sound/usb/caiaq/caiaq-control.c') diff --git a/sound/usb/caiaq/caiaq-control.c b/sound/usb/caiaq/caiaq-control.c index 1f9531d0fce..136ef34300d 100644 --- a/sound/usb/caiaq/caiaq-control.c +++ b/sound/usb/caiaq/caiaq-control.c @@ -44,16 +44,24 @@ static int control_info(struct snd_kcontrol *kcontrol, uinfo->count = 1; pos &= ~CNT_INTVAL; - if (((id == USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ)) || - (id == USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ))) + if (id == USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ) && (pos == 0)) { - /* current input mode of A8DJ and A4DJ */ + /* current input mode of A8DJ */ uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->value.integer.min = 0; uinfo->value.integer.max = 2; return 0; } + if (id == USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ) + && (pos == 0)) { + /* current input mode of A4DJ */ + uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; + uinfo->value.integer.min = 0; + uinfo->value.integer.max = 1; + return 0; + } + if (is_intval) { uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->value.integer.min = 0; @@ -74,6 +82,14 @@ static int control_get(struct snd_kcontrol *kcontrol, struct snd_usb_caiaqdev *dev = caiaqdev(chip->card); int pos = kcontrol->private_value; + if (dev->chip.usb_id == + USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ)) { + /* A4DJ has only one control */ + /* do not expose hardware input mode 0 */ + ucontrol->value.integer.value[0] = dev->control_state[0] - 1; + return 0; + } + if (pos & CNT_INTVAL) ucontrol->value.integer.value[0] = dev->control_state[pos & ~CNT_INTVAL]; @@ -91,6 +107,16 @@ static int control_put(struct snd_kcontrol *kcontrol, struct snd_usb_caiaqdev *dev = caiaqdev(chip->card); int pos = kcontrol->private_value; + if (dev->chip.usb_id == + USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ)) { + /* A4DJ has only one control */ + /* do not expose hardware input mode 0 */ + dev->control_state[0] = ucontrol->value.integer.value[0] + 1; + snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO, + dev->control_state, sizeof(dev->control_state)); + return 1; + } + if (pos & CNT_INTVAL) { dev->control_state[pos & ~CNT_INTVAL] = ucontrol->value.integer.value[0]; -- cgit v1.2.3 From a8564155a9cb3b5c4a18afc451679a1f02c647b5 Mon Sep 17 00:00:00 2001 From: Mark Hills Date: Wed, 4 Feb 2009 22:34:33 +0000 Subject: ALSA: snd-usb-caiaq: Remove duplicate A8DJ control Remove a duplicate control which causes an error when it is registered, and causes later controls to not be registered. The device does not have a fourth ground lift control. Signed-off-by: Mark Hills Acked-by: Daniel Mack Signed-off-by: Takashi Iwai --- sound/usb/caiaq/caiaq-control.c | 1 - 1 file changed, 1 deletion(-) (limited to 'sound/usb/caiaq/caiaq-control.c') diff --git a/sound/usb/caiaq/caiaq-control.c b/sound/usb/caiaq/caiaq-control.c index 136ef34300d..e92c2bbf4fe 100644 --- a/sound/usb/caiaq/caiaq-control.c +++ b/sound/usb/caiaq/caiaq-control.c @@ -270,7 +270,6 @@ static struct caiaq_controller a8dj_controller[] = { { "GND lift for TC Vinyl mode", 24 + 0 }, { "GND lift for TC CD/Line mode", 24 + 1 }, { "GND lift for phono mode", 24 + 2 }, - { "GND lift for TC Vinyl mode", 24 + 3 }, { "Software lock", 40 } }; -- cgit v1.2.3