ALSA: dice: add support for Lexicon I-ONIX FW810s

I-ONIX FW810s was shipped in Lexicon brand of HARMAN International
industries, Inc 2009. The model uses TCD2220 ASIC as its communication
engine. TCAT general protocol is supported, its extension isn't.

This patch adds support for the model with hard-coded stream formats.

$ python3 ~/git/linux-firewire-utils/src/crpp < /sys/bus/firewire/devices/fw1/config_rom
               ROM header and bus information block
               -----------------------------------------------------------------
400  04042b91  bus_info_length 4, crc_length 4, crc 11153
404  31333934  bus_name "1394"
408  e0008102  irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 0, max_rec 8 (512)
40c  000fd720  company_id 000fd7     |
410  007d7ecf  device_id 20007d7ecf  | EUI-64 000fd720007d7ecf

               root directory
               -----------------------------------------------------------------
414  00064c2d  directory_length 6, crc 19501
418  03000fd7  vendor
41c  8100000a  --> descriptor leaf at 444
420  17000001  model
424  8100000d  --> descriptor leaf at 458
428  0c0087c0  node capabilities per IEEE 1394
42c  d1000001  --> unit directory at 430

               unit directory at 430
               -----------------------------------------------------------------
430  000438f2  directory_length 4, crc 14578
434  12000fd7  specifier id
438  13000001  version
43c  17000001  model
440  8100000d  --> descriptor leaf at 474

               descriptor leaf at 444
               -----------------------------------------------------------------
444  000489d5  leaf_length 4, crc 35285
448  00000000  textual descriptor
44c  00000000  minimal ASCII
450  4c657869  "Lexi"
454  636f6e00  "con"

               descriptor leaf at 458
               -----------------------------------------------------------------
458  0006594b  leaf_length 6, crc 22859
45c  00000000  textual descriptor
460  00000000  minimal ASCII
464  492d4f4e  "I-ON"
468  49585f46  "IX_F"
46c  57383130  "W810"
470  53000000  "S"

               descriptor leaf at 474
               -----------------------------------------------------------------
474  0006594b  leaf_length 6, crc 22859
478  00000000  textual descriptor
47c  00000000  minimal ASCII
480  492d4f4e  "I-ON"
484  49585f46  "IX_F"
488  57383130  "W810"
48c  53000000  "S"

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Link: https://lore.kernel.org/r/20210115035623.148580-1-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Sakamoto 2021-01-15 12:56:23 +09:00 committed by Takashi Iwai
parent 42ef170d57
commit 9a08676fc5
4 changed files with 41 additions and 1 deletions

View File

@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
snd-dice-objs := 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-alesis.o dice-extension.o dice-mytek.o dice-presonus.o \
dice-harman.o
obj-$(CONFIG_SND_DICE) += snd-dice.o

View File

@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-2.0
// dice-harman.c - a part of driver for DICE based devices
//
// Copyright (c) 2021 Takashi Sakamoto
//
// Licensed under the terms of the GNU General Public License, version 2.
#include "dice.h"
int snd_dice_detect_harman_formats(struct snd_dice *dice)
{
int i;
// Lexicon I-ONYX FW810s supports sampling transfer frequency up to
// 96.0 kHz, 12 PCM channels and 1 MIDI channel in its first tx stream
// , 10 PCM channels and 1 MIDI channel in its first rx stream for all
// of the frequencies.
for (i = 0; i < 2; ++i) {
dice->tx_pcm_chs[0][i] = 12;
dice->tx_midi_ports[0] = 1;
dice->rx_pcm_chs[0][i] = 10;
dice->rx_midi_ports[0] = 1;
}
return 0;
}

View File

@ -20,10 +20,12 @@ MODULE_LICENSE("GPL v2");
#define OUI_MYTEK 0x001ee8
#define OUI_SSL 0x0050c2 // Actually ID reserved by IEEE.
#define OUI_PRESONUS 0x000a92
#define OUI_HARMAN 0x000fd7
#define DICE_CATEGORY_ID 0x04
#define WEISS_CATEGORY_ID 0x00
#define LOUD_CATEGORY_ID 0x10
#define HARMAN_CATEGORY_ID 0x20
#define MODEL_ALESIS_IO_BOTH 0x000001
@ -56,6 +58,8 @@ static int check_dice_category(struct fw_unit *unit)
category = WEISS_CATEGORY_ID;
else if (vendor == OUI_LOUD)
category = LOUD_CATEGORY_ID;
else if (vendor == OUI_HARMAN)
category = HARMAN_CATEGORY_ID;
else
category = DICE_CATEGORY_ID;
if (device->config_rom[3] != ((vendor << 8) | category) ||
@ -388,6 +392,14 @@ static const struct ieee1394_device_id dice_id_table[] = {
.model_id = 0x000008,
.driver_data = (kernel_ulong_t)snd_dice_detect_presonus_formats,
},
// Lexicon I-ONYX FW810S.
{
.match_flags = IEEE1394_MATCH_VENDOR_ID |
IEEE1394_MATCH_MODEL_ID,
.vendor_id = OUI_HARMAN,
.model_id = 0x000001,
.driver_data = (kernel_ulong_t)snd_dice_detect_harman_formats,
},
{
.match_flags = IEEE1394_MATCH_VERSION,
.version = DICE_INTERFACE,

View File

@ -233,5 +233,6 @@ int snd_dice_detect_alesis_mastercontrol_formats(struct snd_dice *dice);
int snd_dice_detect_extension_formats(struct snd_dice *dice);
int snd_dice_detect_mytek_formats(struct snd_dice *dice);
int snd_dice_detect_presonus_formats(struct snd_dice *dice);
int snd_dice_detect_harman_formats(struct snd_dice *dice);
#endif