mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
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>
This commit is contained in:
parent
3c3b892b37
commit
5bfb841e2f
3 changed files with 30 additions and 10 deletions
|
@ -65,7 +65,10 @@ static void proc_dump_clock_config(struct snd_info_entry *entry,
|
|||
} else {
|
||||
switch ((data >> 10) & 0x07) {
|
||||
case 0x00:
|
||||
src = "ADAT";
|
||||
src = "ADAT1";
|
||||
break;
|
||||
case 0x01:
|
||||
src = "ADAT2";
|
||||
break;
|
||||
case 0x03:
|
||||
src = "S/PDIF";
|
||||
|
@ -121,7 +124,7 @@ static void proc_dump_sync_status(struct snd_info_entry *entry,
|
|||
snd_iprintf(buffer, "none\n");
|
||||
}
|
||||
|
||||
snd_iprintf(buffer, "ADAT:");
|
||||
snd_iprintf(buffer, "ADAT1:");
|
||||
if ((data >> 8) & 0x04) {
|
||||
if ((data >> 8) & 0x10)
|
||||
snd_iprintf(buffer, "sync\n");
|
||||
|
@ -131,6 +134,16 @@ static void proc_dump_sync_status(struct snd_info_entry *entry,
|
|||
snd_iprintf(buffer, "none\n");
|
||||
}
|
||||
|
||||
snd_iprintf(buffer, "ADAT2:");
|
||||
if ((data >> 8) & 0x08) {
|
||||
if ((data >> 8) & 0x20)
|
||||
snd_iprintf(buffer, "sync\n");
|
||||
else
|
||||
snd_iprintf(buffer, "lock\n");
|
||||
} else {
|
||||
snd_iprintf(buffer, "none\n");
|
||||
}
|
||||
|
||||
snd_iprintf(buffer, "\nUsed external source:\n");
|
||||
|
||||
if (((data >> 22) & 0x07) == 0x07) {
|
||||
|
@ -138,7 +151,10 @@ static void proc_dump_sync_status(struct snd_info_entry *entry,
|
|||
} else {
|
||||
switch ((data >> 22) & 0x07) {
|
||||
case 0x00:
|
||||
snd_iprintf(buffer, "ADAT:");
|
||||
snd_iprintf(buffer, "ADAT1:");
|
||||
break;
|
||||
case 0x01:
|
||||
snd_iprintf(buffer, "ADAT2:");
|
||||
break;
|
||||
case 0x03:
|
||||
snd_iprintf(buffer, "S/PDIF:");
|
||||
|
@ -149,7 +165,6 @@ static void proc_dump_sync_status(struct snd_info_entry *entry,
|
|||
case 0x07:
|
||||
snd_iprintf(buffer, "Nothing:");
|
||||
break;
|
||||
case 0x01:
|
||||
case 0x02:
|
||||
case 0x05:
|
||||
case 0x06:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,10 +94,11 @@ struct snd_ff {
|
|||
enum snd_ff_clock_src {
|
||||
SND_FF_CLOCK_SRC_INTERNAL,
|
||||
SND_FF_CLOCK_SRC_SPDIF,
|
||||
SND_FF_CLOCK_SRC_ADAT,
|
||||
SND_FF_CLOCK_SRC_ADAT1,
|
||||
SND_FF_CLOCK_SRC_ADAT2,
|
||||
SND_FF_CLOCK_SRC_WORD,
|
||||
SND_FF_CLOCK_SRC_LTC,
|
||||
/* TODO: perhaps ADAT2 and TCO exists. */
|
||||
/* TODO: perhaps TCO exists. */
|
||||
};
|
||||
|
||||
struct snd_ff_protocol {
|
||||
|
|
Loading…
Reference in a new issue