Skip to content

Commit

Permalink
ALSA: hdspm - Fix sync check reporting on RME RayDAT
Browse files Browse the repository at this point in the history
The RayDAT reports the sync status of its inputs in consecutive bit
positions, so all we do in hdspm_s1_sync_check is to iterate over idx:

    status = hdspm_read(hdspm, HDSPM_RD_STATUS_1);

    lock = (status & (0x1<<idx)) ? 1 : 0;
    sync = (status & (0x100<<idx)) ? 1 : 0;

The index is given in kcontrol->private_value:

    HDSPM_SYNC_CHECK("WC SyncCheck", 0),
    HDSPM_SYNC_CHECK("AES SyncCheck", 1),
    HDSPM_SYNC_CHECK("SPDIF SyncCheck", 2),
    HDSPM_SYNC_CHECK("ADAT1 SyncCheck", 3),
    HDSPM_SYNC_CHECK("ADAT2 SyncCheck", 4),
    HDSPM_SYNC_CHECK("ADAT3 SyncCheck", 5),
    HDSPM_SYNC_CHECK("ADAT4 SyncCheck", 6),
    HDSPM_SYNC_CHECK("TCO SyncCheck", 7),
    HDSPM_SYNC_CHECK("SYNC IN SyncCheck", 8),

The patch corrects the indicated sync flags by passing the proper index
value to hdspm_s1_sync_check().

Signed-off-by: Adrian Knoth <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
adiknoth authored and tiwai committed Nov 7, 2012
1 parent d526612 commit d1a3c98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sound/pci/rme9652/hdspm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3979,7 +3979,8 @@ static int snd_hdspm_get_sync_check(struct snd_kcontrol *kcontrol,
case 8: /* SYNC IN */
val = hdspm_sync_in_sync_check(hdspm); break;
default:
val = hdspm_s1_sync_check(hdspm, ucontrol->id.index-1);
val = hdspm_s1_sync_check(hdspm,
kcontrol->private_value-1);
}
break;

Expand Down

0 comments on commit d1a3c98

Please sign in to comment.