[alsa-devel] [PATCH 2/2] caiaq/NativeInstruments: control support
Hi,
This patch adds support for input controllers on "Kore controller" and uses ALSA's control API to enable LED switching on several hardware products as well as some internal audio related functions of "Audio 8 DJ".
Subject: SOUND: caiaq - add control API and more input features From: Daniel Mack daniel@caiaq.de
SOUND: caiaq - add control API and more input features
- added support for all input controllers on Native Instrument's "Kore controller". - added ALSA controls to switch LEDs on "RigKontrol 2", "RigKontrol3", "Audio Kontrol 1" and "Kore controller". - added ALSA controls to switch input mode, software lock and ground lift features on "Audio 8 DJ".
Signed-off-by: Daniel Mack daniel@caiaq.de
On Tue, Nov 20, 2007 at 02:32:10PM +0100, Daniel Mack wrote:
Subject: SOUND: caiaq - add control API and more input features From: Daniel Mack daniel@caiaq.de
SOUND: caiaq - add control API and more input features
- added support for all input controllers on Native Instrument's "Kore controller".
- added ALSA controls to switch LEDs on "RigKontrol 2", "RigKontrol3", "Audio Kontrol 1" and "Kore controller".
- added ALSA controls to switch input mode, software lock and ground lift features on "Audio 8 DJ".
Signed-off-by: Daniel Mack daniel@caiaq.de
Attached now.
At Tue, 20 Nov 2007 14:37:46 +0100, Daniel Mack wrote:
--- /dev/null +++ b/sound/usb/caiaq/caiaq-control.c
(snip)
+#ifdef CONFIG_SND_USB_CAIAQ_INPUT +#include <linux/input.h> +#endif
Do you really need ifdef here?
+static int control_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
+{
- struct snd_usb_audio *chip = snd_kcontrol_chip(kcontrol);
- struct snd_usb_caiaqdev *dev = caiaqdev(chip->card);
- int pos = kcontrol->private_value;
- 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,
dev->control_state, sizeof(dev->control_state));
- } else {
if (ucontrol->value.integer.value[0])
dev->control_state[pos / 8] |= 1 << (pos % 8);
else
dev->control_state[pos / 8] &= ~(1 << (pos % 8));
snd_usb_caiaq_send_command(dev, EP1_CMD_WRITE_IO,
dev->control_state, sizeof(dev->control_state));
- }
- return 0;
+}
The put callback is supposed to return 1 if a value is changed. It's no strict requirement, so far, but if this still doesn't follow put a comment like FIXME.
+/*
- 0
- 1 << 1
- 1 << 0 | 1 << 1
- 1 << 0 | 1 << 1 | 1 << 2
- 1 << 0
- 0
- */
What's this? :)
thanks,
Takashi
On Wed, Nov 21, 2007 at 11:01:54AM +0100, Takashi Iwai wrote:
+#ifdef CONFIG_SND_USB_CAIAQ_INPUT +#include <linux/input.h> +#endif
Do you really need ifdef here?
No, I agree. Also removed that from other places.
The put callback is supposed to return 1 if a value is changed. It's no strict requirement, so far, but if this still doesn't follow put a comment like FIXME.
Changed.
+/*
- 0
- 1 << 1
- 1 << 0 | 1 << 1
- 1 << 0 | 1 << 1 | 1 << 2
- 1 << 0
- 0
- */
What's this? :)
I developement left-over - I'm still not yet used to git-update-index ;)
New version attached.
Greets, Daniel
participants (2)
-
Daniel Mack
-
Takashi Iwai