diff options
author | Mark Hills <mark@pogo.org.uk> | 2010-05-29 11:53:23 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-05-29 15:48:24 -0400 |
commit | bd4cbf6c7689d35d5d1248369d2c350f4711ca0a (patch) | |
tree | 218009160ca8d53ab3f29c0407b6383e84a39b33 /sound/usb | |
parent | e8d0fee70b66694959eab10c41788b9279d73629 (diff) |
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 9a9527e.
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/caiaq/control.c | 30 |
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; |