--- /dev/null
+/*
+ * ff-protocol-ff800.c - a part of driver for RME Fireface series
+ *
+ * Copyright (c) 2018 Takashi Sakamoto
+ *
+ * Licensed under the terms of the GNU General Public License, version 2.
+ */
+
+#include "ff.h"
+
+static void ff800_handle_midi_msg(struct snd_ff *ff, __le32 *buf, size_t length)
+{
+ int i;
+
+ for (i = 0; i < length / 4; i++) {
+ u8 byte = le32_to_cpu(buf[i]) & 0xff;
+ struct snd_rawmidi_substream *substream;
+
+ substream = READ_ONCE(ff->tx_midi_substreams[0]);
+ if (substream)
+ snd_rawmidi_receive(substream, &byte, 1);
+ }
+}
+
+const struct snd_ff_protocol snd_ff_protocol_ff800 = {
+ .handle_midi_msg = ff800_handle_midi_msg,
+};
{
struct snd_ff *ff = card->private_data;
- snd_ff_stream_destroy_duplex(ff);
+ if (ff->spec->protocol->begin_session)
+ snd_ff_stream_destroy_duplex(ff);
snd_ff_transaction_unregister(ff);
}
name_card(ff);
- err = snd_ff_stream_init_duplex(ff);
- if (err < 0)
- goto error;
+ if (ff->spec->protocol->begin_session) {
+ err = snd_ff_stream_init_duplex(ff);
+ if (err < 0)
+ goto error;
+ }
snd_ff_proc_init(ff);
if (err < 0)
goto error;
- err = snd_ff_create_pcm_devices(ff);
- if (err < 0)
- goto error;
+ if (ff->spec->protocol->begin_session) {
+ err = snd_ff_create_pcm_devices(ff);
+ if (err < 0)
+ goto error;
- err = snd_ff_create_hwdep_devices(ff);
- if (err < 0)
- goto error;
+ err = snd_ff_create_hwdep_devices(ff);
+ if (err < 0)
+ goto error;
+ }
err = snd_card_register(ff->card);
if (err < 0)
snd_ff_transaction_reregister(ff);
- if (ff->registered)
+ if (ff->registered && ff->spec->protocol->begin_session)
snd_ff_stream_update_duplex(ff);
}
fw_unit_put(ff->unit);
}
+static const struct snd_ff_spec spec_ff800 = {
+ .name = "Fireface800",
+ .midi_in_ports = 1,
+ .midi_out_ports = 1,
+ .protocol = &snd_ff_protocol_ff800,
+ .regs = {
+ [SND_FF_REG_TYPE_MIDI_HIGH_ADDR] = 0x000200000320ull,
+ },
+};
+
static const struct snd_ff_spec spec_ff400 = {
.name = "Fireface400",
.pcm_capture_channels = {18, 14, 10},
};
static const struct ieee1394_device_id snd_ff_id_table[] = {
+ /* Fireface 800 */
+ {
+ .match_flags = IEEE1394_MATCH_VENDOR_ID |
+ IEEE1394_MATCH_SPECIFIER_ID |
+ IEEE1394_MATCH_VERSION |
+ IEEE1394_MATCH_MODEL_ID,
+ .vendor_id = OUI_RME,
+ .specifier_id = OUI_RME,
+ .version = 0x000001,
+ .model_id = 0x101800,
+ .driver_data = (kernel_ulong_t)&spec_ff800,
+ },
/* Fireface 400 */
{
.match_flags = IEEE1394_MATCH_VENDOR_ID |
IEEE1394_MATCH_VERSION |
IEEE1394_MATCH_MODEL_ID,
.vendor_id = OUI_RME,
- .specifier_id = 0x000a35,
+ .specifier_id = OUI_RME,
.version = 0x000002,
.model_id = 0x101800,
.driver_data = (kernel_ulong_t)&spec_ff400,