summaryrefslogtreecommitdiffstats
path: root/sound/firewire/fireface/ff-transaction.c
diff options
context:
space:
mode:
authorTakashi Sakamoto2018-12-11 11:17:31 +0100
committerTakashi Iwai2018-12-11 14:56:38 +0100
commit5bfb841e2f5952f5a6d8540dfda196769b358f8c (patch)
treeec67794c9bc82cff2067b5f856df2277a2e44dc8 /sound/firewire/fireface/ff-transaction.c
parentALSA: fireface: share helper function to get current sampling rate and clock ... (diff)
downloadkernel-qcow2-linux-5bfb841e2f5952f5a6d8540dfda196769b358f8c.tar.gz
kernel-qcow2-linux-5bfb841e2f5952f5a6d8540dfda196769b358f8c.tar.xz
kernel-qcow2-linux-5bfb841e2f5952f5a6d8540dfda196769b358f8c.zip
ALSA: fireface: add support for second optical interface for ADAT stream
Unlike Fireface 400, Fireface 800 have two pair of optical interface for ADAT signal and S/PDIF signal. ADAT signals for the interface are handled for sampling clock source separately. This commit modifies a parser for clock configuration to distinguish these two ADAT signals. Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/fireface/ff-transaction.c')
-rw-r--r--sound/firewire/fireface/ff-transaction.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/firewire/fireface/ff-transaction.c b/sound/firewire/fireface/ff-transaction.c
index 1dad51da13e0..751662b62389 100644
--- a/sound/firewire/fireface/ff-transaction.c
+++ b/sound/firewire/fireface/ff-transaction.c
@@ -46,8 +46,14 @@ int snd_ff_transaction_get_clock(struct snd_ff *ff, unsigned int *rate,
if (data & 0x01) {
*src = SND_FF_CLOCK_SRC_INTERNAL;
} else {
- /* TODO: 0x00, 0x01, 0x02, 0x06, 0x07? */
+ /* TODO: 0x02, 0x06, 0x07? */
switch ((data >> 10) & 0x07) {
+ case 0x00:
+ *src = SND_FF_CLOCK_SRC_ADAT1;
+ break;
+ case 0x01:
+ *src = SND_FF_CLOCK_SRC_ADAT2;
+ break;
case 0x03:
*src = SND_FF_CLOCK_SRC_SPDIF;
break;
@@ -57,10 +63,8 @@ int snd_ff_transaction_get_clock(struct snd_ff *ff, unsigned int *rate,
case 0x05:
*src = SND_FF_CLOCK_SRC_LTC;
break;
- case 0x00:
default:
- *src = SND_FF_CLOCK_SRC_ADAT;
- break;
+ return -EIO;
}
}