aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/rme9652
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2013-07-05 05:28:05 -0400
committerTakashi Iwai <tiwai@suse.de>2013-07-05 08:51:27 -0400
commitb0bf550476a5a6238baf1309ba913ca9f7a379ba (patch)
treefa449e65fab7ef6361887e95074d7999377104ad /sound/pci/rme9652
parent5760107c8263cf518968ece65453b7d9b8ca3d0a (diff)
ALSA: hdspm - AES32: Fix TCO sync check reporting
HDSPM_tco_lock and HDSPM_tcoLock were too close, so the previous code didn't honour the difference between the two. Let's be more verbose and use HDSPM_tcoLockMadi for MADI cards, HDSPM_tcoLockAes for AES(32) and fix the code that makes use of both. 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.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 58b21048c2e8..bdd8c7742a1f 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -360,11 +360,11 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
360#define HDSPM_madiLock (1<<3) /* MADI Locked =1, no=0 */ 360#define HDSPM_madiLock (1<<3) /* MADI Locked =1, no=0 */
361#define HDSPM_madiSync (1<<18) /* MADI is in sync */ 361#define HDSPM_madiSync (1<<18) /* MADI is in sync */
362 362
363#define HDSPM_tcoLock 0x00000020 /* Optional TCO locked status FOR HDSPe MADI! */ 363#define HDSPM_tcoLockMadi 0x00000020 /* Optional TCO locked status for HDSPe MADI*/
364#define HDSPM_tcoSync 0x10000000 /* Optional TCO sync status */ 364#define HDSPM_tcoSync 0x10000000 /* Optional TCO sync status for HDSPe MADI and AES32!*/
365 365
366#define HDSPM_syncInLock 0x00010000 /* Sync In lock status FOR HDSPe MADI! */ 366#define HDSPM_syncInLock 0x00010000 /* Sync In lock status for HDSPe MADI! */
367#define HDSPM_syncInSync 0x00020000 /* Sync In sync status FOR HDSPe MADI! */ 367#define HDSPM_syncInSync 0x00020000 /* Sync In sync status for HDSPe MADI! */
368 368
369#define HDSPM_BufferPositionMask 0x000FFC0 /* Bit 6..15 : h/w buffer pointer */ 369#define HDSPM_BufferPositionMask 0x000FFC0 /* Bit 6..15 : h/w buffer pointer */
370 /* since 64byte accurate, last 6 bits are not used */ 370 /* since 64byte accurate, last 6 bits are not used */
@@ -382,7 +382,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
382 * Interrupt 382 * Interrupt
383 */ 383 */
384#define HDSPM_tco_detect 0x08000000 384#define HDSPM_tco_detect 0x08000000
385#define HDSPM_tco_lock 0x20000000 385#define HDSPM_tcoLockAes 0x20000000 /* Optional TCO locked status for HDSPe AES */
386 386
387#define HDSPM_s2_tco_detect 0x00000040 387#define HDSPM_s2_tco_detect 0x00000040
388#define HDSPM_s2_AEBO_D 0x00000080 388#define HDSPM_s2_AEBO_D 0x00000080
@@ -480,7 +480,9 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
480#define HDSPM_AES32_AUTOSYNC_FROM_AES6 6 480#define HDSPM_AES32_AUTOSYNC_FROM_AES6 6
481#define HDSPM_AES32_AUTOSYNC_FROM_AES7 7 481#define HDSPM_AES32_AUTOSYNC_FROM_AES7 7
482#define HDSPM_AES32_AUTOSYNC_FROM_AES8 8 482#define HDSPM_AES32_AUTOSYNC_FROM_AES8 8
483#define HDSPM_AES32_AUTOSYNC_FROM_NONE 9 483#define HDSPM_AES32_AUTOSYNC_FROM_TCO 9
484#define HDSPM_AES32_AUTOSYNC_FROM_SYNC_IN 10
485#define HDSPM_AES32_AUTOSYNC_FROM_NONE 11
484 486
485/* status2 */ 487/* status2 */
486/* HDSPM_LockAES_bit is given by HDSPM_LockAES >> (AES# - 1) */ 488/* HDSPM_LockAES_bit is given by HDSPM_LockAES >> (AES# - 1) */
@@ -3868,9 +3870,18 @@ static int hdspm_tco_sync_check(struct hdspm *hdspm)
3868 if (hdspm->tco) { 3870 if (hdspm->tco) {
3869 switch (hdspm->io_type) { 3871 switch (hdspm->io_type) {
3870 case MADI: 3872 case MADI:
3873 status = hdspm_read(hdspm, HDSPM_statusRegister);
3874 if (status & HDSPM_tcoLockMadi) {
3875 if (status & HDSPM_tcoSync)
3876 return 2;
3877 else
3878 return 1;
3879 }
3880 return 0;
3881 break;
3871 case AES32: 3882 case AES32:
3872 status = hdspm_read(hdspm, HDSPM_statusRegister); 3883 status = hdspm_read(hdspm, HDSPM_statusRegister);
3873 if (status & HDSPM_tcoLock) { 3884 if (status & HDSPM_tcoLockAes) {
3874 if (status & HDSPM_tcoSync) 3885 if (status & HDSPM_tcoSync)
3875 return 2; 3886 return 2;
3876 else 3887 else