]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ALSA: firewire-motu: add support for MOTU Track 16
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Sun, 7 Nov 2021 11:06:44 +0000 (20:06 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 8 Nov 2021 12:49:27 +0000 (13:49 +0100)
Mark of the Unicorn designed Track 16 2011 as one of models in third
generation of its FireWire series. The model is already discontinued.
It consists of below ICs:

 * Texas Instruments TSB41AB1
 * Microchip (SMSC) USB3300
 * Xilinx Spartan-3A FPGA, XC3S700A
 * Texas Instruments TMS320C6722
 * Microchip (Atmel) AT91SAM SAM7S512

It supports sampling transfer frequency up to 192.0 kHz. The packet
format differs depending on both of current sampling transfer frequency
and the type of signal in optical interfaces. The model supports
transmission of PCM frames as well as MIDI messages.

The model supports command mechanism to configure internal DSP. Hardware
meter information is available in the first 2 chunks of each data block
of tx packet.

This commit adds support for it.

$ cd linux-firewire-tools/src
$ python crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04107d95  bus_info_length 4, crc_length 16, crc 32149
404  31333934  bus_name "1394"
408  20ff7000  irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 7 (256)
40c  0001f200  company_id 0001f2     |
410  000a83c4  device_id 00000a83c4  | EUI-64 0001f200000a83c4

               root directory
               -----------------------------------------------------------------
414  0004ef04  directory_length 4, crc 61188
418  030001f2  vendor
41c  0c0083c0  node capabilities per IEEE 1394
420  d1000002  --> unit directory at 428
424  8d000005  --> eui-64 leaf at 438

               unit directory at 428
               -----------------------------------------------------------------
428  00035b04  directory_length 3, crc 23300
42c  120001f2  specifier id
430  13000039  version
434  17102800  model

               eui-64 leaf at 438
               -----------------------------------------------------------------
438  0002b25f  leaf_length 2, crc 45663
43c  0001f200  company_id 0001f2     |
440  000a83c4  device_id 00000a83c4  | EUI-64 0001f200000a83c4

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20211107110644.23511-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/Kconfig
sound/firewire/motu/motu-protocol-v3.c
sound/firewire/motu/motu.c
sound/firewire/motu/motu.h

index fd109bea4c53b4fa58d5a34a0a2d94797dd874e1..22b6c779682a3e5a565cfebdd1b74a878fa450fd 100644 (file)
@@ -169,6 +169,7 @@ config SND_FIREWIRE_MOTU
          * 828
          * 896
          * 828mk2
+         * 896hd
          * Traveler
          * Ultralite
          * 8pre
@@ -176,7 +177,9 @@ config SND_FIREWIRE_MOTU
          * 828mk3 (Hybrid)
          * Ultralite mk3 (FireWire only)
          * Ultralite mk3 (Hybrid)
+         * Traveler mk3
          * Audio Express
+         * Track 16
          * 4pre
 
         To compile this driver as a module, choose M here: the module
index 1371f38505d0c63f1f53c81ce949dd249c4c3362..8a0426920a760b838e56169dcea3c42d4ce7eeb1 100644 (file)
@@ -189,7 +189,7 @@ int snd_motu_protocol_v3_switch_fetching_mode(struct snd_motu *motu,
                                          sizeof(reg));
 }
 
-static int detect_packet_formats_dual_opt_iface(struct snd_motu *motu, u32 data)
+static int detect_packet_formats_with_opt_ifaces(struct snd_motu *motu, u32 data)
 {
        if (data & V3_ENABLE_OPT_IN_IFACE_A) {
                if (data & V3_NO_ADAT_OPT_IN_IFACE_A) {
@@ -261,8 +261,9 @@ int snd_motu_protocol_v3_cache_packet_formats(struct snd_motu *motu)
 
        if (motu->spec == &snd_motu_spec_828mk3_fw ||
            motu->spec == &snd_motu_spec_828mk3_hybrid ||
-           motu->spec == &snd_motu_spec_traveler_mk3)
-               return detect_packet_formats_dual_opt_iface(motu, data);
+           motu->spec == &snd_motu_spec_traveler_mk3 ||
+           motu->spec == &snd_motu_spec_track16)
+               return detect_packet_formats_with_opt_ifaces(motu, data);
        else
                return 0;
 }
@@ -317,6 +318,16 @@ const struct snd_motu_spec snd_motu_spec_audio_express = {
        .rx_fixed_pcm_chunks = {10, 10, 0},
 };
 
+const struct snd_motu_spec snd_motu_spec_track16 = {
+       .name = "Track16",
+       .protocol_version = SND_MOTU_PROTOCOL_V3,
+       .flags = SND_MOTU_SPEC_RX_MIDI_3RD_Q |
+                SND_MOTU_SPEC_TX_MIDI_3RD_Q |
+                SND_MOTU_SPEC_COMMAND_DSP,
+       .tx_fixed_pcm_chunks = {14, 14, 14},
+       .rx_fixed_pcm_chunks = {6, 6, 6},
+};
+
 const struct snd_motu_spec snd_motu_spec_4pre = {
        .name = "4pre",
        .protocol_version = SND_MOTU_PROTOCOL_V3,
index 080728dd278f93bb89e14a65ca77423372a6f220..f8b7fe38751c64d036519a79283d6dd63ce9cb97 100644 (file)
@@ -173,6 +173,7 @@ static const struct ieee1394_device_id motu_id_table[] = {
        SND_MOTU_DEV_ENTRY(0x000030, &snd_motu_spec_ultralite_mk3), // Hybrid.
        SND_MOTU_DEV_ENTRY(0x000035, &snd_motu_spec_828mk3_hybrid), // Hybrid.
        SND_MOTU_DEV_ENTRY(0x000033, &snd_motu_spec_audio_express),
+       SND_MOTU_DEV_ENTRY(0x000039, &snd_motu_spec_track16),
        SND_MOTU_DEV_ENTRY(0x000045, &snd_motu_spec_4pre),
        { }
 };
index 6ad1feab478b3a670d2771ab452ddeabb3124ff6..4189f2192284aba110280069028a72e915e7f7da 100644 (file)
@@ -141,6 +141,7 @@ extern const struct snd_motu_spec snd_motu_spec_828mk3_hybrid;
 extern const struct snd_motu_spec snd_motu_spec_traveler_mk3;
 extern const struct snd_motu_spec snd_motu_spec_ultralite_mk3;
 extern const struct snd_motu_spec snd_motu_spec_audio_express;
+extern const struct snd_motu_spec snd_motu_spec_track16;
 extern const struct snd_motu_spec snd_motu_spec_4pre;
 
 int amdtp_motu_init(struct amdtp_stream *s, struct fw_unit *unit,