Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * dice-mytek.c - a part of driver for DICE based devices
0004  *
0005  * Copyright (c) 2018 Melvin Vermeeren
0006  */
0007 
0008 #include "dice.h"
0009 
0010 struct dice_mytek_spec {
0011     unsigned int tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT];
0012     unsigned int rx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT];
0013 };
0014 
0015 static const struct dice_mytek_spec stereo_192_dsd_dac = {
0016     /* AES, TOSLINK, SPDIF, ADAT inputs on device */
0017     .tx_pcm_chs = {{8, 8, 8}, {0, 0, 0} },
0018     /* PCM 44.1-192, native DSD64/DSD128 to device */
0019     .rx_pcm_chs = {{4, 4, 4}, {0, 0, 0} }
0020 };
0021 
0022 /*
0023  * Mytek has a few other firewire-capable devices, though newer models appear
0024  * to lack the port more often than not. As I don't have access to any of them
0025  * they are missing here. An example is the Mytek 8x192 ADDA, which is DICE.
0026  */
0027 
0028 int snd_dice_detect_mytek_formats(struct snd_dice *dice)
0029 {
0030     int i;
0031     const struct dice_mytek_spec *dev;
0032 
0033     dev = &stereo_192_dsd_dac;
0034 
0035     memcpy(dice->tx_pcm_chs, dev->tx_pcm_chs,
0036            MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * sizeof(unsigned int));
0037     memcpy(dice->rx_pcm_chs, dev->rx_pcm_chs,
0038            MAX_STREAMS * SND_DICE_RATE_MODE_COUNT * sizeof(unsigned int));
0039 
0040     for (i = 0; i < MAX_STREAMS; ++i) {
0041         dice->tx_midi_ports[i] = 0;
0042         dice->rx_midi_ports[i] = 0;
0043     }
0044 
0045     return 0;
0046 }