[alsa-devel] [PATCHv2 17/31] ALSA: hdspm - Introduce hdspm_get_aes_sample_rate()
Adrian Knoth
adi at drcomp.erfurt.thur.de
Fri Jul 5 11:28:09 CEST 2013
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 at drcomp.erfurt.thur.de>
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 8e6ce14..b7702b2 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
--
1.8.3.1
More information about the Alsa-devel
mailing list