-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ALSA: dice: add parameters of stream formats for models produced by A…
…lesis Alesis shipped some models with DICE ASICs. All of them just support DICE original protocol and drivers can't retrieve all of available stream formats without changing status of sampling transmission frequency actually. This commit puts some hard-coded parameters for the models. When detecting the models, the corresponding parameters are copied as cache of stream formats. I note that each of pair of iO14/iO26 and MultiMix 8/12/16 has the same model ID on their configuration ROM. The MultiMix 8/12/16 just support one mode for sampling transmission frequency and ALSA dice driver already handles them correctly. The iO14/iO26 support three modes and need hard-coded parameters. To distinguish these two models, this commit let the driver to retrieve current stream formats and compare it to known parameters, then decide it. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
- Loading branch information
Takashi Sakamoto
authored and
Takashi Iwai
committed
May 2, 2018
1 parent
f1f0f33
commit 28b208f
Showing
4 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
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-pcm.o dice-hwdep.o dice.o dice-tcelectronic.o \ | ||
dice-alesis.o | ||
obj-$(CONFIG_SND_DICE) += snd-dice.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// SPDX-License-Identifier: GPL-2.0 | ||
/* | ||
* dice-alesis.c - a part of driver for DICE based devices | ||
* | ||
* Copyright (c) 2018 Takashi Sakamoto | ||
*/ | ||
|
||
#include "dice.h" | ||
|
||
static const unsigned int | ||
alesis_io14_tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT] = { | ||
{6, 6, 4}, /* Tx0 = Analog + S/PDIF. */ | ||
{8, 4, 0}, /* Tx1 = ADAT1. */ | ||
}; | ||
|
||
static const unsigned int | ||
alesis_io26_tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT] = { | ||
{10, 10, 8}, /* Tx0 = Analog + S/PDIF. */ | ||
{16, 8, 0}, /* Tx1 = ADAT1 + ADAT2. */ | ||
}; | ||
|
||
int snd_dice_detect_alesis_formats(struct snd_dice *dice) | ||
{ | ||
__be32 reg; | ||
u32 data; | ||
int i; | ||
int err; | ||
|
||
err = snd_dice_transaction_read_tx(dice, TX_NUMBER_AUDIO, ®, | ||
sizeof(reg)); | ||
if (err < 0) | ||
return err; | ||
data = be32_to_cpu(reg); | ||
|
||
if (data == 4 || data == 6) { | ||
memcpy(dice->tx_pcm_chs, alesis_io14_tx_pcm_chs, | ||
MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * | ||
sizeof(unsigned int)); | ||
} else { | ||
memcpy(dice->rx_pcm_chs, alesis_io26_tx_pcm_chs, | ||
MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * | ||
sizeof(unsigned int)); | ||
} | ||
|
||
for (i = 0; i < SND_DICE_RATE_MODE_COUNT; ++i) | ||
dice->rx_pcm_chs[0][i] = 8; | ||
|
||
dice->tx_midi_ports[0] = 1; | ||
dice->rx_midi_ports[0] = 1; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters