diff options
author | Andre Schramm <andre.schramm@iosono-sound.com> | 2013-01-09 08:40:18 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-01-09 10:59:24 -0500 |
commit | 56bde0f328428f2fc6e416510d8b42de6a0cfad5 (patch) | |
tree | 6579000dca2f8210330cd71cb86900903dcf7461 /sound | |
parent | 7ed4165e2d01bdbbb4c1086eb73eadf0f64cbbf0 (diff) |
ALSA: hdspm - Fix wordclock status on AES32
Use correct bitmask for AES32 cards to determine wordclock lock state,
add missing bitmask for sync check and make output of the corresponding
control and /proc coherent.
Signed-off-by: Andre Schramm <andre.schramm@iosono-sound.com>
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/rme9652/hdspm.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index 6e02e064d7b4..223c3d9cc69e 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c | |||
@@ -441,6 +441,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}"); | |||
441 | */ | 441 | */ |
442 | /* status */ | 442 | /* status */ |
443 | #define HDSPM_AES32_wcLock 0x0200000 | 443 | #define HDSPM_AES32_wcLock 0x0200000 |
444 | #define HDSPM_AES32_wcSync 0x0100000 | ||
444 | #define HDSPM_AES32_wcFreq_bit 22 | 445 | #define HDSPM_AES32_wcFreq_bit 22 |
445 | /* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function | 446 | /* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function |
446 | HDSPM_bit2freq */ | 447 | HDSPM_bit2freq */ |
@@ -3467,10 +3468,12 @@ static int hdspm_wc_sync_check(struct hdspm *hdspm) | |||
3467 | switch (hdspm->io_type) { | 3468 | switch (hdspm->io_type) { |
3468 | case AES32: | 3469 | case AES32: |
3469 | status = hdspm_read(hdspm, HDSPM_statusRegister); | 3470 | status = hdspm_read(hdspm, HDSPM_statusRegister); |
3470 | if (status & HDSPM_wcSync) | 3471 | if (status & HDSPM_AES32_wcLock) { |
3471 | return 2; | 3472 | if (status & HDSPM_AES32_wcSync) |
3472 | else if (status & HDSPM_wcLock) | 3473 | return 2; |
3473 | return 1; | 3474 | else |
3475 | return 1; | ||
3476 | } | ||
3474 | return 0; | 3477 | return 0; |
3475 | break; | 3478 | break; |
3476 | 3479 | ||
@@ -4658,6 +4661,7 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry, | |||
4658 | unsigned int status; | 4661 | unsigned int status; |
4659 | unsigned int status2; | 4662 | unsigned int status2; |
4660 | unsigned int timecode; | 4663 | unsigned int timecode; |
4664 | unsigned int wcLock, wcSync; | ||
4661 | int pref_syncref; | 4665 | int pref_syncref; |
4662 | char *autosync_ref; | 4666 | char *autosync_ref; |
4663 | int x; | 4667 | int x; |
@@ -4751,8 +4755,11 @@ snd_hdspm_proc_read_aes32(struct snd_info_entry * entry, | |||
4751 | 4755 | ||
4752 | snd_iprintf(buffer, "--- Status:\n"); | 4756 | snd_iprintf(buffer, "--- Status:\n"); |
4753 | 4757 | ||
4758 | wcLock = status & HDSPM_AES32_wcLock; | ||
4759 | wcSync = wcLock && (status & HDSPM_AES32_wcSync); | ||
4760 | |||
4754 | snd_iprintf(buffer, "Word: %s Frequency: %d\n", | 4761 | snd_iprintf(buffer, "Word: %s Frequency: %d\n", |
4755 | (status & HDSPM_AES32_wcLock) ? "Sync " : "No Lock", | 4762 | (wcLock) ? (wcSync ? "Sync " : "Lock ") : "No Lock", |
4756 | HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF)); | 4763 | HDSPM_bit2freq((status >> HDSPM_AES32_wcFreq_bit) & 0xF)); |
4757 | 4764 | ||
4758 | for (x = 0; x < 8; x++) { | 4765 | for (x = 0; x < 8; x++) { |