diff options
Diffstat (limited to 'drivers/media/dvb/frontends/stb6100.c')
-rw-r--r-- | drivers/media/dvb/frontends/stb6100.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/dvb/frontends/stb6100.c b/drivers/media/dvb/frontends/stb6100.c index 1ed5a7db4c5e..60ee18a94f43 100644 --- a/drivers/media/dvb/frontends/stb6100.c +++ b/drivers/media/dvb/frontends/stb6100.c | |||
@@ -367,7 +367,9 @@ static int stb6100_set_frequency(struct dvb_frontend *fe, u32 frequency) | |||
367 | /* N(I) = floor(f(VCO) / (f(XTAL) * (PSD2 ? 2 : 1))) */ | 367 | /* N(I) = floor(f(VCO) / (f(XTAL) * (PSD2 ? 2 : 1))) */ |
368 | nint = fvco / (state->reference << psd2); | 368 | nint = fvco / (state->reference << psd2); |
369 | /* N(F) = round(f(VCO) / f(XTAL) * (PSD2 ? 2 : 1) - N(I)) * 2 ^ 9 */ | 369 | /* N(F) = round(f(VCO) / f(XTAL) * (PSD2 ? 2 : 1) - N(I)) * 2 ^ 9 */ |
370 | nfrac = (((fvco - (nint * state->reference << psd2)) << (9 - psd2)) + state->reference / 2) / state->reference; | 370 | nfrac = DIV_ROUND_CLOSEST((fvco - (nint * state->reference << psd2)) |
371 | << (9 - psd2), | ||
372 | state->reference); | ||
371 | dprintk(verbose, FE_DEBUG, 1, | 373 | dprintk(verbose, FE_DEBUG, 1, |
372 | "frequency = %u, srate = %u, g = %u, odiv = %u, psd2 = %u, fxtal = %u, osm = %u, fvco = %u, N(I) = %u, N(F) = %u", | 374 | "frequency = %u, srate = %u, g = %u, odiv = %u, psd2 = %u, fxtal = %u, osm = %u, fvco = %u, N(I) = %u, N(F) = %u", |
373 | frequency, srate, (unsigned int)g, (unsigned int)odiv, | 375 | frequency, srate, (unsigned int)g, (unsigned int)odiv, |