summaryrefslogtreecommitdiff
path: root/sound/firewire
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire')
-rw-r--r--sound/firewire/dice/Makefile2
-rw-r--r--sound/firewire/dice/dice-extension.c4
-rw-r--r--sound/firewire/dice/dice-teac.c43
-rw-r--r--sound/firewire/dice/dice.c13
-rw-r--r--sound/firewire/dice/dice.h1
-rw-r--r--sound/firewire/tascam/tascam-stream.c21
6 files changed, 71 insertions, 13 deletions
diff --git a/sound/firewire/dice/Makefile b/sound/firewire/dice/Makefile
index 36e25a3cf3c6..478cd7a08fb5 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-extension.c b/sound/firewire/dice/dice-extension.c
index 02f4a8318e38..48bfb3ad93ce 100644
--- a/sound/firewire/dice/dice-extension.c
+++ b/sound/firewire/dice/dice-extension.c
@@ -116,7 +116,7 @@ static int detect_stream_formats(struct snd_dice *dice, u64 section_addr)
break;
base_offset += EXT_APP_STREAM_ENTRIES;
- stream_count = be32_to_cpu(reg[0]);
+ stream_count = min_t(unsigned int, be32_to_cpu(reg[0]), MAX_STREAMS);
err = read_stream_entries(dice, section_addr, base_offset,
stream_count, mode,
dice->tx_pcm_chs,
@@ -125,7 +125,7 @@ static int detect_stream_formats(struct snd_dice *dice, u64 section_addr)
break;
base_offset += stream_count * EXT_APP_STREAM_ENTRY_SIZE;
- stream_count = be32_to_cpu(reg[1]);
+ stream_count = min_t(unsigned int, be32_to_cpu(reg[1]), MAX_STREAMS);
err = read_stream_entries(dice, section_addr, base_offset,
stream_count,
mode, dice->rx_pcm_chs,
diff --git a/sound/firewire/dice/dice-teac.c b/sound/firewire/dice/dice-teac.c
new file mode 100644
index 000000000000..29febddfe3a5
--- /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, &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;
+}
diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c
index bcbe80344328..85d265c7d544 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 4c0ad7335998..7744ea6a0791 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
diff --git a/sound/firewire/tascam/tascam-stream.c b/sound/firewire/tascam/tascam-stream.c
index 9c8fddd7dee1..4ecd151a46c1 100644
--- a/sound/firewire/tascam/tascam-stream.c
+++ b/sound/firewire/tascam/tascam-stream.c
@@ -282,20 +282,22 @@ static int keep_resources(struct snd_tscm *tscm, unsigned int rate,
struct amdtp_stream *stream)
{
struct fw_iso_resources *resources;
+ int speed;
int err;
- if (stream == &tscm->tx_stream)
+ if (stream == &tscm->tx_stream) {
resources = &tscm->tx_resources;
- else
+ speed = fw_parent_device(tscm->unit)->max_speed;
+ } else {
resources = &tscm->rx_resources;
+ speed = SCODE_400;
+ }
err = amdtp_tscm_set_parameters(stream, rate);
if (err < 0)
return err;
- return fw_iso_resources_allocate(resources,
- amdtp_stream_get_max_payload(stream),
- fw_parent_device(tscm->unit)->max_speed);
+ return fw_iso_resources_allocate(resources, amdtp_stream_get_max_payload(stream), speed);
}
static int init_stream(struct snd_tscm *tscm, struct amdtp_stream *s)
@@ -455,7 +457,6 @@ int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate)
}
if (!amdtp_stream_running(&tscm->rx_stream)) {
- int spd = fw_parent_device(tscm->unit)->max_speed;
unsigned int tx_init_skip_cycles;
err = set_stream_formats(tscm, rate);
@@ -466,13 +467,13 @@ int snd_tscm_stream_start_duplex(struct snd_tscm *tscm, unsigned int rate)
if (err < 0)
goto error;
- err = amdtp_domain_add_stream(&tscm->domain, &tscm->rx_stream,
- tscm->rx_resources.channel, spd);
+ err = amdtp_domain_add_stream(&tscm->domain, &tscm->rx_stream, tscm->rx_resources.channel,
+ fw_parent_device(tscm->unit)->max_speed);
if (err < 0)
goto error;
- err = amdtp_domain_add_stream(&tscm->domain, &tscm->tx_stream,
- tscm->tx_resources.channel, spd);
+ err = amdtp_domain_add_stream(&tscm->domain, &tscm->tx_stream, tscm->tx_resources.channel,
+ SCODE_400);
if (err < 0)
goto error;