aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrian Knoth <adi@drcomp.erfurt.thur.de>2011-08-14 18:22:54 -0400
committerTakashi Iwai <tiwai@suse.de>2011-08-15 04:25:39 -0400
commit2e61027079ed70f54fec41ddb8fa8af37d79d8d8 (patch)
tree5995e5800a182bb739fe2d5e2d9f556c6f7e73ef
parent7cb155ff3e4645188c42d707300e36cfce44e28a (diff)
ALSA: hdspm - Enable 32 samples/period on RME RayDAT/AIO
Newer RME cards like RayDAT and AIO support 32 samples per period. This value is encoded as {1,1,1} in the HDSP_LatencyMask bits in the control register. Since {1,1,1} is also the representation for 8192 samples/period on older RME cards, we have to special case 32 samples and 32768 bytes according to the actual card. Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/rme9652/hdspm.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 1a52a1ae1f4c..92ac64ced29a 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -1323,12 +1323,27 @@ static int hdspm_set_interrupt_interval(struct hdspm *s, unsigned int frames)
1323 1323
1324 spin_lock_irq(&s->lock); 1324 spin_lock_irq(&s->lock);
1325 1325
1326 frames >>= 7; 1326 if (32 == frames) {
1327 n = 0; 1327 /* Special case for new RME cards like RayDAT/AIO which
1328 while (frames) { 1328 * support period sizes of 32 samples. Since latency is
1329 n++; 1329 * encoded in the three bits of HDSP_LatencyMask, we can only
1330 frames >>= 1; 1330 * have values from 0 .. 7. While 0 still means 64 samples and
1331 * 6 represents 4096 samples on all cards, 7 represents 8192
1332 * on older cards and 32 samples on new cards.
1333 *
1334 * In other words, period size in samples is calculated by
1335 * 2^(n+6) with n ranging from 0 .. 7.
1336 */
1337 n = 7;
1338 } else {
1339 frames >>= 7;
1340 n = 0;
1341 while (frames) {
1342 n++;
1343 frames >>= 1;
1344 }
1331 } 1345 }
1346
1332 s->control_register &= ~HDSPM_LatencyMask; 1347 s->control_register &= ~HDSPM_LatencyMask;
1333 s->control_register |= hdspm_encode_latency(n); 1348 s->control_register |= hdspm_encode_latency(n);
1334 1349