Commit bd4cbf6c authored by Mark Hills's avatar Mark Hills Committed by Takashi Iwai

ALSA: snd-usb-caiaq: Restore 'Control vinyl' input mode on A4DJ

This feature was undocumented on early A4DJ units. It is indicated
by lighting both the 'line' and 'phono' lamps at the same time.
Newer units document this and the newer Windows drivers enable this
for all units, so restore the functionality.

This patch simplifies the code and changes the mode mapping to match
the A8DJ, favouring simpler code and consistency over keeping the
existing mapping.

Both 'Control vinyl' and 'Phono' input modes enable the hardware
preamp. The difference is the input impedance.

This reverts commit 9a9527ed.
Acked-by: default avatarDaniel Mack <daniel@caiaq.de>
Signed-off-by: default avatarMark Hills <mark@pogo.org.uk>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e8d0fee7
...@@ -42,21 +42,12 @@ static int control_info(struct snd_kcontrol *kcontrol, ...@@ -42,21 +42,12 @@ static int control_info(struct snd_kcontrol *kcontrol,
switch (dev->chip.usb_id) { switch (dev->chip.usb_id) {
case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ): case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO8DJ):
if (pos == 0) {
/* current input mode of A8DJ */
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->value.integer.min = 0;
uinfo->value.integer.max = 2;
return 0;
}
break;
case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ): case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_AUDIO4DJ):
if (pos == 0) { if (pos == 0) {
/* current input mode of A4DJ */ /* current input mode of A8DJ and A4DJ */
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->value.integer.min = 0; uinfo->value.integer.min = 0;
uinfo->value.integer.max = 1; uinfo->value.integer.max = 2;
return 0; return 0;
} }
break; break;
...@@ -86,14 +77,6 @@ static int control_get(struct snd_kcontrol *kcontrol, ...@@ -86,14 +77,6 @@ static int control_get(struct snd_kcontrol *kcontrol,
struct snd_usb_caiaqdev *dev = caiaqdev(chip->card); struct snd_usb_caiaqdev *dev = caiaqdev(chip->card);
int pos = kcontrol->private_value; 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) if (pos & CNT_INTVAL)
ucontrol->value.integer.value[0] ucontrol->value.integer.value[0]
= dev->control_state[pos & ~CNT_INTVAL]; = dev->control_state[pos & ~CNT_INTVAL];
...@@ -113,15 +96,6 @@ static int control_put(struct snd_kcontrol *kcontrol, ...@@ -113,15 +96,6 @@ static int control_put(struct snd_kcontrol *kcontrol,
unsigned char cmd = EP1_CMD_WRITE_IO; unsigned char cmd = EP1_CMD_WRITE_IO;
switch (dev->chip.usb_id) { switch (dev->chip.usb_id) {
case 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;
}
case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1): case USB_ID(USB_VID_NATIVEINSTRUMENTS, USB_PID_TRAKTORKONTROLX1):
cmd = EP1_CMD_DIMM_LEDS; cmd = EP1_CMD_DIMM_LEDS;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment