summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2023-06-12 21:13:25 +0200
committerTakashi Iwai <tiwai@suse.de>2023-06-13 07:47:34 +0200
commit58cc6133cc27496c1f041f302e13c33f0867be8a (patch)
tree574f98efc6ee6301ff5ec6e4a4da2d677d5bdf3c
parent3ac251420be2bbc9f5e83281661dbfaf05983f69 (diff)
downloadlinux-58cc6133cc27496c1f041f302e13c33f0867be8a.tar.gz
linux-58cc6133cc27496c1f041f302e13c33f0867be8a.tar.bz2
linux-58cc6133cc27496c1f041f302e13c33f0867be8a.zip
ALSA: emu10k1: actually show some S/PDIF status in /proc for E-MU cards
The file is called spdif-in, but we abused it to show only sample rates from various sources. Rectify it as far as possible (the FPGA doesn't give us a lot of information). Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Link: https://lore.kernel.org/r/20230612191325.1315854-10-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/emu10k1/emuproc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 993b35362499..7e2cc532471f 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -194,6 +194,14 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
emu->card_capabilities->emu_model == EMU_MODEL_EMU1010)
snd_iprintf(buffer, "BNC rate: %dHz\n",
snd_emu1010_get_raw_rate(emu, EMU_HANA_WCLOCK_SYNC_BNC));
+
+ snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &value);
+ if (value & EMU_HANA_SPDIF_MODE_RX_INVALID)
+ snd_iprintf(buffer, "\nS/PDIF input invalid\n");
+ else
+ snd_iprintf(buffer, "\nS/PDIF mode: %s%s\n",
+ value & EMU_HANA_SPDIF_MODE_RX_PRO ? "professional" : "consumer",
+ value & EMU_HANA_SPDIF_MODE_RX_NOCOPY ? ", no copy" : "");
} else {
snd_emu10k1_proc_spdif_status(emu, buffer, "CD-ROM S/PDIF In", CDCS, CDSRCS);
snd_emu10k1_proc_spdif_status(emu, buffer, "Optical or Coax S/PDIF In", GPSCS, GPSRCS);