summaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652
diff options
context:
space:
mode:
authorAdrian Knoth2013-07-05 11:28:09 +0200
committerTakashi Iwai2013-07-05 14:52:04 +0200
commitd3c36ed8e578185b752dac4277819965fa5f6879 (patch)
tree3f10c575acdb85c5ad6e43d4c4247fdbb3c34bad /sound/pci/rme9652
parentALSA: hdspm - AES32: Add TCO and Sync-In text entries (diff)
downloadkernel-qcow2-linux-d3c36ed8e578185b752dac4277819965fa5f6879.tar.gz
kernel-qcow2-linux-d3c36ed8e578185b752dac4277819965fa5f6879.tar.xz
kernel-qcow2-linux-d3c36ed8e578185b752dac4277819965fa5f6879.zip
ALSA: hdspm - Introduce hdspm_get_aes_sample_rate()
Helper function to return the AES sample rate class. This class needs to be translated via HDSPM_bit2freq() to get the more common representation. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/rme9652')
-rw-r--r--sound/pci/rme9652/hdspm.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 8e6ce1473333..b7702b225c3e 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -2224,6 +2224,23 @@ static int hdspm_get_sync_in_sample_rate(struct hdspm *hdspm)
return 0;
}
+/**
+ * Returns the AES sample rate class for the given card.
+ **/
+static int hdspm_get_aes_sample_rate(struct hdspm *hdspm, int index)
+{
+ int timecode;
+
+ switch (hdspm->io_type) {
+ case AES32:
+ timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
+ return (timecode >> (4*index)) & 0xF;
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
/**
* Returns the sample rate class for input source <idx> for