Skip to content

Commit 23c671b

Browse files
takaswietiwai
authored andcommitted
ALSA: firewire-motu: add support for MOTU 896HD
Mark of the Unicorn (MOTU) shipped 896HD 2003 as one of models in second generation of its FireWire series, and already discontinued it. The model consists of below ICs: * Texas Instruments TSB41AB2 * Phillips Semiconductors PDI1394L40 * Altera cyclone EP1C3 * Texas Instruments TMS320VC5402 It supports sampling transmission frequency up to 192.0 kHz. The packet format differs depending on both of sampling transfer frequency and enabling ADAT channels. The model doesn't support MIDI message transmission. This commit adds support for it. $ python3 crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04101b66 bus_info_length 4, crc_length 16, crc 7014 404 31333934 bus_name "1394" 408 20001000 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 0, max_rec 1 (4) 40c 0001f200 company_id 0001f2 | 410 0001dbce device_id 000001dbce | EUI-64 0001f2000001dbce root directory ----------------------------------------------------------------- 414 0004c65c directory_length 4, crc 50780 418 030001f2 vendor 41c 0c0083c0 node capabilities per IEEE 1394 420 8d000006 --> eui-64 leaf at 438 424 d1000001 --> unit directory at 428 unit directory at 428 ----------------------------------------------------------------- 428 0003dcc1 directory_length 3, crc 56513 42c 120001f specifier id 430 13000005 version 434 17102800 model eui-64 leaf at 438 ----------------------------------------------------------------- 438 000264f2 leaf_length 2, crc 25842 43c 0001f200 company_id 0001f2 | 440 0001dbce device_id 000001dbce | EUI-64 0001f2000001dbce Signed-off-by: Takashi Sakamoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent d2d8375 commit 23c671b

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

sound/firewire/motu/motu-protocol-v2.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
#define V2_CLOCK_RATE_SHIFT 3
1313
#define V2_CLOCK_SRC_MASK 0x00000007
1414
#define V2_CLOCK_SRC_SHIFT 0
15-
#define V2_CLOCK_SRC_AESEBU_ON_XLR 0x07
15+
#define V2_CLOCK_SRC_AESEBU_ON_XLR 0x07 // In Traveler.
1616
#define V2_CLOCK_SRC_ADAT_ON_DSUB 0x05
1717
#define V2_CLOCK_SRC_WORD_ON_BNC 0x04
1818
#define V2_CLOCK_SRC_SPH 0x03
19-
#define V2_CLOCK_SRC_SPDIF 0x02 // on either coaxial or optical
19+
#define V2_CLOCK_SRC_SPDIF 0x02 // on either coaxial or optical. AES/EBU in 896HD.
2020
#define V2_CLOCK_SRC_ADAT_ON_OPT 0x01
2121
#define V2_CLOCK_SRC_INTERNAL 0x00
2222
#define V2_CLOCK_FETCH_ENABLE 0x02000000
@@ -100,7 +100,9 @@ static int get_clock_source(struct snd_motu *motu, u32 data,
100100
bool support_iec60958_on_opt = (motu->spec == &snd_motu_spec_828mk2 ||
101101
motu->spec == &snd_motu_spec_traveler);
102102

103-
if (!support_iec60958_on_opt) {
103+
if (motu->spec == &snd_motu_spec_896hd) {
104+
*src = SND_MOTU_CLOCK_SOURCE_AESEBU_ON_XLR;
105+
} else if (!support_iec60958_on_opt) {
104106
*src = SND_MOTU_CLOCK_SOURCE_SPDIF_ON_COAX;
105107
} else {
106108
__be32 reg;
@@ -129,6 +131,7 @@ static int get_clock_source(struct snd_motu *motu, u32 data,
129131
*src = SND_MOTU_CLOCK_SOURCE_ADAT_ON_DSUB;
130132
break;
131133
case V2_CLOCK_SRC_AESEBU_ON_XLR:
134+
// For Traveler.
132135
*src = SND_MOTU_CLOCK_SOURCE_AESEBU_ON_XLR;
133136
break;
134137
default:
@@ -153,7 +156,7 @@ int snd_motu_protocol_v2_get_clock_source(struct snd_motu *motu,
153156
return get_clock_source(motu, be32_to_cpu(reg), src);
154157
}
155158

156-
// Expected for Traveler and 896HD, which implements Altera Cyclone EP1C3.
159+
// Expected for Traveler, which implements Altera Cyclone EP1C3.
157160
static int switch_fetching_mode_cyclone(struct snd_motu *motu, u32 *data,
158161
bool enable)
159162
{
@@ -190,6 +193,9 @@ int snd_motu_protocol_v2_switch_fetching_mode(struct snd_motu *motu,
190193
if (motu->spec == &snd_motu_spec_828mk2) {
191194
// 828mkII implements Altera ACEX 1K EP1K30. Nothing to do.
192195
return 0;
196+
} else if (motu->spec == &snd_motu_spec_896hd) {
197+
// 896HD implements Altera Cyclone EP1C3 but nothing to do.
198+
return 0;
193199
} else {
194200
__be32 reg;
195201
u32 data;
@@ -274,6 +280,14 @@ const struct snd_motu_spec snd_motu_spec_828mk2 = {
274280
.rx_fixed_pcm_chunks = {14, 14, 0},
275281
};
276282

283+
const struct snd_motu_spec snd_motu_spec_896hd = {
284+
.name = "896HD",
285+
.protocol_version = SND_MOTU_PROTOCOL_V2,
286+
// No support for MIDI.
287+
.tx_fixed_pcm_chunks = {14, 14, 8},
288+
.rx_fixed_pcm_chunks = {14, 14, 8},
289+
};
290+
277291
const struct snd_motu_spec snd_motu_spec_traveler = {
278292
.name = "Traveler",
279293
.protocol_version = SND_MOTU_PROTOCOL_V2,

sound/firewire/motu/motu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ static const struct ieee1394_device_id motu_id_table[] = {
153153
SND_MOTU_DEV_ENTRY(0x000001, &snd_motu_spec_828),
154154
SND_MOTU_DEV_ENTRY(0x000002, &snd_motu_spec_896),
155155
SND_MOTU_DEV_ENTRY(0x000003, &snd_motu_spec_828mk2),
156+
SND_MOTU_DEV_ENTRY(0x000005, &snd_motu_spec_896hd),
156157
SND_MOTU_DEV_ENTRY(0x000009, &snd_motu_spec_traveler),
157158
SND_MOTU_DEV_ENTRY(0x00000d, &snd_motu_spec_ultralite),
158159
SND_MOTU_DEV_ENTRY(0x00000f, &snd_motu_spec_8pre),

sound/firewire/motu/motu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ extern const struct snd_motu_spec snd_motu_spec_828;
126126
extern const struct snd_motu_spec snd_motu_spec_896;
127127

128128
extern const struct snd_motu_spec snd_motu_spec_828mk2;
129+
extern const struct snd_motu_spec snd_motu_spec_896hd;
129130
extern const struct snd_motu_spec snd_motu_spec_traveler;
130131
extern const struct snd_motu_spec snd_motu_spec_ultralite;
131132
extern const struct snd_motu_spec snd_motu_spec_8pre;

0 commit comments

Comments
 (0)