summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends/stb6100.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-09-16 08:49:04 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-16 08:49:04 -0300
commit85d13c8ef6cb0f70323a77515b59f5a4d2444d3f (patch)
tree19666bcda7adefb3b1186f2db269d98fac2aa740 /linux/drivers/media/dvb/frontends/stb6100.c
parenteb80450edef873c9b5d0a839659da0a642e7716a (diff)
parent7178a759bcb68c7e95477ff7fbfcdfb1631168c5 (diff)
downloadmediapointer-dvb-s2-85d13c8ef6cb0f70323a77515b59f5a4d2444d3f.tar.gz
mediapointer-dvb-s2-85d13c8ef6cb0f70323a77515b59f5a4d2444d3f.tar.bz2
merge: http://linuxtv.org/hg/~pb/v4l-dvb/
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers/media/dvb/frontends/stb6100.c')
-rw-r--r--linux/drivers/media/dvb/frontends/stb6100.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/frontends/stb6100.c b/linux/drivers/media/dvb/frontends/stb6100.c
index 2b1af36b8..2de9e0c01 100644
--- a/linux/drivers/media/dvb/frontends/stb6100.c
+++ b/linux/drivers/media/dvb/frontends/stb6100.c
@@ -24,6 +24,7 @@
#include <linux/module.h>
#include <linux/string.h>
+#include "compat.h"
#include "dvb_frontend.h"
#include "stb6100.h"
@@ -374,7 +375,9 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency)
/* N(I) = floor(f(VCO) / (f(XTAL) * (PSD2 ? 2 : 1))) */
nint = fvco / (state->reference << psd2);
/* N(F) = round(f(VCO) / f(XTAL) * (PSD2 ? 2 : 1) - N(I)) * 2 ^ 9 */
- nfrac = (((fvco - (nint * state->reference << psd2)) << (9 - psd2)) + state->reference / 2) / state->reference;
+ nfrac = DIV_ROUND_CLOSEST((fvco - (nint * state->reference << psd2))
+ << (9 - psd2),
+ state->reference);
dprintk(verbose, FE_DEBUG, 1,
"frequency = %u, srate = %u, g = %u, odiv = %u, psd2 = %u, fxtal = %u, osm = %u, fvco = %u, N(I) = %u, N(F) = %u",
frequency, srate, (unsigned int)g, (unsigned int)odiv,