]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: dice: add support for TASCAM IF-FW/DM MkII
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 17 Oct 2025 11:11:45 +0000 (20:11 +0900)
committerTakashi Iwai <tiwai@suse.de>
Sat, 18 Oct 2025 16:37:33 +0000 (18:37 +0200)
TEAC Corporation launched IF-FW/DM MkII as an add-in card for TASCAM
DM-3200 and DM-4800. This card uses TC Applied Technologies DICE II
ASIC.

This commit supports the add-in card. The configuration ROM content
includes some quirks:

- The category value stored in chip_ID_hi field of bus information block
  is zero.
- The value of model in unit directory (0x00022e) is different from the
  one in root directory (0x000006).

The hardware allows users to select the total number of audio data channels
available for system from 16 and 32 channels for both input and output
direction. In 16-channel mode,  all audio data are transferred in a
single isochronous packet stream, while in 32-channel mode, they are
transferred across two streams. After the user changes the channel
configuration on the hardware panel, the device temporarily disappears
from the bus and reappears with the new stream formats. During device
probing the ALSA dice driver checks the number of available isochronous
packet streams to determine the active mode of the hardware.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://patch.msgid.link/20251017111145.263295-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/dice/Makefile
sound/firewire/dice/dice-teac.c [new file with mode: 0644]
sound/firewire/dice/dice.c
sound/firewire/dice/dice.h

index 36e25a3cf3c639ee6489faabd89912e8c60d9148..478cd7a08fb56f044d441cadf12c27450866d587 100644 (file)
@@ -2,5 +2,5 @@
 snd-dice-y := dice-transaction.o dice-stream.o dice-proc.o dice-midi.o \
                 dice-pcm.o dice-hwdep.o dice.o dice-tcelectronic.o \
                 dice-alesis.o dice-extension.o dice-mytek.o dice-presonus.o \
-                dice-harman.o dice-focusrite.o dice-weiss.o
+                dice-harman.o dice-focusrite.o dice-weiss.o dice-teac.o
 obj-$(CONFIG_SND_DICE) += snd-dice.o
diff --git a/sound/firewire/dice/dice-teac.c b/sound/firewire/dice/dice-teac.c
new file mode 100644 (file)
index 0000000..29febdd
--- /dev/null
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+// dice-teac.c - a part of driver for DICE based devices
+//
+// Copyright (c) 2025 Takashi Sakamoto
+
+#include "dice.h"
+
+int snd_dice_detect_teac_formats(struct snd_dice *dice)
+{
+       __be32 reg;
+       u32 data;
+       int err;
+
+       err = snd_dice_transaction_read_tx(dice, TX_NUMBER, &reg, sizeof(reg));
+       if (err  < 0)
+               return err;
+
+       dice->tx_pcm_chs[0][SND_DICE_RATE_MODE_LOW] = 16;
+       dice->tx_pcm_chs[0][SND_DICE_RATE_MODE_MIDDLE] = 16;
+       dice->tx_midi_ports[0] = 1;
+
+       data = be32_to_cpu(reg);
+       if (data > 1) {
+               dice->tx_pcm_chs[1][SND_DICE_RATE_MODE_LOW] = 16;
+               dice->tx_pcm_chs[1][SND_DICE_RATE_MODE_MIDDLE] = 16;
+       }
+
+       err = snd_dice_transaction_read_rx(dice, RX_NUMBER, &reg, sizeof(reg));
+       if (err  < 0)
+               return err;
+
+       dice->rx_pcm_chs[0][SND_DICE_RATE_MODE_LOW] = 16;
+       dice->rx_pcm_chs[0][SND_DICE_RATE_MODE_MIDDLE] = 16;
+       dice->rx_midi_ports[0] = 1;
+
+       data = be32_to_cpu(reg);
+       if (data > 1) {
+               dice->rx_pcm_chs[1][SND_DICE_RATE_MODE_LOW] = 16;
+               dice->rx_pcm_chs[1][SND_DICE_RATE_MODE_MIDDLE] = 16;
+       }
+
+       return 0;
+}
index bcbe80344328e7821cfebabb9a3bfc7ee13d9aed..85d265c7d5444d693f62044eb730dec78962eeed 100644 (file)
@@ -22,6 +22,7 @@ MODULE_LICENSE("GPL");
 #define OUI_PRESONUS           0x000a92
 #define OUI_HARMAN             0x000fd7
 #define OUI_AVID               0x00a07e
+#define OUI_TEAC               0x00022e
 
 #define DICE_CATEGORY_ID       0x04
 #define WEISS_CATEGORY_ID      0x00
@@ -458,6 +459,18 @@ static const struct ieee1394_device_id dice_id_table[] = {
                .match_flags = IEEE1394_MATCH_VERSION,
                .version     = DICE_INTERFACE,
        },
+       // Tascam IF-FW/DM MkII for DM-3200 and DM-4800.
+       {
+               .match_flags    = IEEE1394_MATCH_VENDOR_ID |
+                                 IEEE1394_MATCH_MODEL_ID |
+                                 IEEE1394_MATCH_SPECIFIER_ID |
+                                 IEEE1394_MATCH_VERSION,
+               .vendor_id      = OUI_TEAC,
+               .model_id       = OUI_TEAC,
+               .specifier_id   = OUI_TEAC,
+               .version        = 0x800006,
+               .driver_data = (kernel_ulong_t)snd_dice_detect_teac_formats,
+       },
        { }
 };
 MODULE_DEVICE_TABLE(ieee1394, dice_id_table);
index 4c0ad7335998c0f0a06eca534ce208d14910acf9..7744ea6a0791d3256da8e3392dd2b9be61b1d76b 100644 (file)
@@ -233,5 +233,6 @@ int snd_dice_detect_presonus_formats(struct snd_dice *dice);
 int snd_dice_detect_harman_formats(struct snd_dice *dice);
 int snd_dice_detect_focusrite_pro40_tcd3070_formats(struct snd_dice *dice);
 int snd_dice_detect_weiss_formats(struct snd_dice *dice);
+int snd_dice_detect_teac_formats(struct snd_dice *dice);
 
 #endif