Skip to content

Commit

Permalink
V4L/DVB (9447): stb6100: improve rounding
Browse files Browse the repository at this point in the history
Optimization: Round the requested value to achieve a
+/-1MHz error instead of +0/-2MHz

Signed-off-by: Reinhard Nissl <rnissl@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Reinhard Nissl authored and Mauro Carvalho Chehab committed Dec 29, 2008
1 parent 02ec9d8 commit 6f6c268
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/dvb/frontends/stb6100.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int stb6100_set_bandwidth(struct dvb_frontend *fe, u32 bandwidth)
else if (bandwidth <= 5000000) /* bw/2 min = 5Mhz for F=0 */
tmp = 0;
else /* if 5 < bw/2 < 36 */
tmp = bandwidth / 1000000 - 5;
tmp = (bandwidth + 500000) / 1000000 - 5;

/* Turn on LPF bandwidth setting clock control,
* set bandwidth, wait 10ms, turn off.
Expand Down

0 comments on commit 6f6c268

Please sign in to comment.