Commit 6f6c268b authored by Reinhard Nissl's avatar Reinhard Nissl Committed by Mauro Carvalho Chehab

V4L/DVB (9447): stb6100: improve rounding

Optimization: Round the requested value to achieve a
+/-1MHz error instead of +0/-2MHz
Signed-off-by: default avatarReinhard Nissl <rnissl@gmx.de>
Signed-off-by: default avatarManu Abraham <manu@linuxtv.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 02ec9d8f
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment