瀏覽代碼

ALSA: oxfw: add scs1x layer

Stanton Controllers and Systems 1 (SCS.1) series is supported by ALSA
scs1x driver. This driver just supports MIDI functionality. On the other
hand, models in this series are based on OXFW971 and ALSA OXFW driver can
support them.

SCS.1 series has MIDI functionality to control its surface state such as
LED lighting. When operating physical knobs and faders, the models
generate MIDI messages. These MIDI messages are transferred by asynchronous
transactions. These transactions are really model-specific and ALSA OXFW
driver requires the functionality so as scs1x module implements.

This commit adds scs1x layer as a preparation to merge scs1x driver to
oxfw driver.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Sakamoto 9 年之前
父節點
當前提交
3f47152a1c
共有 4 個文件被更改,包括 30 次插入3 次删除
  1. 1 1
      sound/firewire/oxfw/Makefile
  2. 26 0
      sound/firewire/oxfw/oxfw-scs1x.c
  3. 2 2
      sound/firewire/oxfw/oxfw.c
  4. 1 0
      sound/firewire/oxfw/oxfw.h

+ 1 - 1
sound/firewire/oxfw/Makefile

@@ -1,3 +1,3 @@
 snd-oxfw-objs := oxfw-command.o oxfw-stream.o oxfw-pcm.o oxfw-proc.o \
 snd-oxfw-objs := oxfw-command.o oxfw-stream.o oxfw-pcm.o oxfw-proc.o \
-		 oxfw-midi.o oxfw-hwdep.o oxfw-spkr.o oxfw.o
+		 oxfw-midi.o oxfw-hwdep.o oxfw-spkr.o oxfw-scs1x.o oxfw.o
 obj-$(CONFIG_SND_OXFW) += snd-oxfw.o
 obj-$(CONFIG_SND_OXFW) += snd-oxfw.o

+ 26 - 0
sound/firewire/oxfw/oxfw-scs1x.c

@@ -0,0 +1,26 @@
+/*
+ * oxfw-scs1x.c - a part of driver for OXFW970/971 based devices
+ *
+ * Copyright (c) Clemens Ladisch <clemens@ladisch.de>
+ * Copyright (c) 2015 Takashi Sakamoto <o-takashi@sakamocchi.jp>
+ *
+ * Licensed under the terms of the GNU General Public License, version 2.
+ */
+
+#include "oxfw.h"
+
+int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw)
+{
+	struct snd_rawmidi *rmidi;
+	int err;
+
+	/* Use unique name for backward compatibility to scs1x module. */
+	err = snd_rawmidi_new(oxfw->card, "SCS.1x", 0, 0, 0, &rmidi);
+	if (err < 0)
+		return err;
+
+	snprintf(rmidi->name, sizeof(rmidi->name),
+		 "%s MIDI", oxfw->card->shortname);
+
+	return err;
+}

+ 2 - 2
sound/firewire/oxfw/oxfw.c

@@ -216,11 +216,11 @@ static int oxfw_probe(struct fw_unit *unit,
 	if (err < 0)
 	if (err < 0)
 		goto error;
 		goto error;
 
 
-	err = detect_quirks(oxfw);
+	err = name_card(oxfw);
 	if (err < 0)
 	if (err < 0)
 		goto error;
 		goto error;
 
 
-	err = name_card(oxfw);
+	err = detect_quirks(oxfw);
 	if (err < 0)
 	if (err < 0)
 		goto error;
 		goto error;
 
 

+ 1 - 0
sound/firewire/oxfw/oxfw.h

@@ -134,3 +134,4 @@ int snd_oxfw_create_midi(struct snd_oxfw *oxfw);
 int snd_oxfw_create_hwdep(struct snd_oxfw *oxfw);
 int snd_oxfw_create_hwdep(struct snd_oxfw *oxfw);
 
 
 int snd_oxfw_add_spkr(struct snd_oxfw *oxfw, bool is_lacie);
 int snd_oxfw_add_spkr(struct snd_oxfw *oxfw, bool is_lacie);
+int snd_oxfw_scs1x_add(struct snd_oxfw *oxfw);