aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2013-07-05 05:28:14 -0400
committerTakashi Iwai <tiwai@suse.de>2013-07-05 08:52:37 -0400
commitdbae4a0c8d8794df1a6bd7e644ed94b915f46f7e (patch)
tree7f07f49c9bf9ab8b2a538a1d0f3ed3d9a6f14c98 /sound/pci/rme9652
parent3ac9b0acc34fbe56e2d31b8f2f7e59d45c53cb3b (diff)
ALSA: hdspm - AES32: Enable TCO input in hdspm_external_sample_rate()
This patch adds support to read the TCO sample rate in hdspm_external_sample_rate() on RME AES(32) cards. 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.c37
1 files changed, 28 insertions, 9 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index a9f4c7c4b6f4..80b2247dc8f9 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -1176,17 +1176,36 @@ static int hdspm_external_sample_rate(struct hdspm *hdspm)
1176 timecode = hdspm_read(hdspm, HDSPM_timecodeRegister); 1176 timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
1177 1177
1178 syncref = hdspm_autosync_ref(hdspm); 1178 syncref = hdspm_autosync_ref(hdspm);
1179 switch (syncref) {
1180 case HDSPM_AES32_AUTOSYNC_FROM_WORD:
1181 /* Check WC sync and get sample rate */
1182 if (hdspm_wc_sync_check(hdspm))
1183 return HDSPM_bit2freq(hdspm_get_wc_sample_rate(hdspm));
1184 break;
1185
1186 case HDSPM_AES32_AUTOSYNC_FROM_AES1:
1187 case HDSPM_AES32_AUTOSYNC_FROM_AES2:
1188 case HDSPM_AES32_AUTOSYNC_FROM_AES3:
1189 case HDSPM_AES32_AUTOSYNC_FROM_AES4:
1190 case HDSPM_AES32_AUTOSYNC_FROM_AES5:
1191 case HDSPM_AES32_AUTOSYNC_FROM_AES6:
1192 case HDSPM_AES32_AUTOSYNC_FROM_AES7:
1193 case HDSPM_AES32_AUTOSYNC_FROM_AES8:
1194 /* Check AES sync and get sample rate */
1195 if (hdspm_aes_sync_check(hdspm, syncref - HDSPM_AES32_AUTOSYNC_FROM_AES1))
1196 return HDSPM_bit2freq(hdspm_get_aes_sample_rate(hdspm,
1197 syncref - HDSPM_AES32_AUTOSYNC_FROM_AES1));
1198 break;
1179 1199
1180 if (syncref == HDSPM_AES32_AUTOSYNC_FROM_WORD &&
1181 status & HDSPM_AES32_wcLock)
1182 return HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF);
1183 1200
1184 if (syncref >= HDSPM_AES32_AUTOSYNC_FROM_AES1 && 1201 case HDSPM_AES32_AUTOSYNC_FROM_TCO:
1185 syncref <= HDSPM_AES32_AUTOSYNC_FROM_AES8 && 1202 /* Check TCO sync and get sample rate */
1186 status2 & (HDSPM_LockAES >> 1203 if (hdspm_tco_sync_check(hdspm))
1187 (syncref - HDSPM_AES32_AUTOSYNC_FROM_AES1))) 1204 return HDSPM_bit2freq(hdspm_get_tco_sample_rate(hdspm));
1188 return HDSPM_bit2freq((timecode >> (4*(syncref-HDSPM_AES32_AUTOSYNC_FROM_AES1))) & 0xF); 1205 break;
1189 return 0; 1206 default:
1207 return 0;
1208 } /* end switch(syncref) */
1190 break; 1209 break;
1191 1210
1192 case MADIface: 1211 case MADIface: