From 175cfc6c883811ec5ad7862a3a5a270a2597e465 Mon Sep 17 00:00:00 2001 From: Adrian Knoth Date: Mon, 15 Aug 2011 00:22:54 +0200 Subject: [PATCH] --- yaml --- r: 270405 b: refs/heads/master c: 2e61027079ed70f54fec41ddb8fa8af37d79d8d8 h: refs/heads/master i: 270403: 5996e1fca6a444892fc9173700ecea5b9d3185bd v: v3 --- [refs] | 2 +- trunk/sound/pci/rme9652/hdspm.c | 25 ++++++++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index 29853bafeafe..9ca8ccbc6c0a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7cb155ff3e4645188c42d707300e36cfce44e28a +refs/heads/master: 2e61027079ed70f54fec41ddb8fa8af37d79d8d8 diff --git a/trunk/sound/pci/rme9652/hdspm.c b/trunk/sound/pci/rme9652/hdspm.c index 1a52a1ae1f4c..92ac64ced29a 100644 --- a/trunk/sound/pci/rme9652/hdspm.c +++ b/trunk/sound/pci/rme9652/hdspm.c @@ -1323,12 +1323,27 @@ static int hdspm_set_interrupt_interval(struct hdspm *s, unsigned int frames) spin_lock_irq(&s->lock); - frames >>= 7; - n = 0; - while (frames) { - n++; - frames >>= 1; + if (32 == frames) { + /* Special case for new RME cards like RayDAT/AIO which + * support period sizes of 32 samples. Since latency is + * encoded in the three bits of HDSP_LatencyMask, we can only + * have values from 0 .. 7. While 0 still means 64 samples and + * 6 represents 4096 samples on all cards, 7 represents 8192 + * on older cards and 32 samples on new cards. + * + * In other words, period size in samples is calculated by + * 2^(n+6) with n ranging from 0 .. 7. + */ + n = 7; + } else { + frames >>= 7; + n = 0; + while (frames) { + n++; + frames >>= 1; + } } + s->control_register &= ~HDSPM_LatencyMask; s->control_register |= hdspm_encode_latency(n);