From: Takashi Sakamoto Date: Fri, 17 Oct 2025 11:11:45 +0000 (+0900) Subject: ALSA: dice: add support for TASCAM IF-FW/DM MkII X-Git-Tag: v6.19-rc1~156^2~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28bcb2169693d6e02642c45ddc3ca63cd8a4e1f2;p=thirdparty%2Fkernel%2Flinux.git ALSA: dice: add support for TASCAM IF-FW/DM MkII 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 Link: https://patch.msgid.link/20251017111145.263295-1-o-takashi@sakamocchi.jp Signed-off-by: Takashi Iwai --- diff --git a/sound/firewire/dice/Makefile b/sound/firewire/dice/Makefile index 36e25a3cf3c63..478cd7a08fb56 100644 --- a/sound/firewire/dice/Makefile +++ b/sound/firewire/dice/Makefile @@ -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 index 0000000000000..29febddfe3a59 --- /dev/null +++ b/sound/firewire/dice/dice-teac.c @@ -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, ®, 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, ®, 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; +} diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c index bcbe80344328e..85d265c7d5444 100644 --- a/sound/firewire/dice/dice.c +++ b/sound/firewire/dice/dice.c @@ -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); diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h index 4c0ad7335998c..7744ea6a0791d 100644 --- a/sound/firewire/dice/dice.h +++ b/sound/firewire/dice/dice.h @@ -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