Skip to content

Commit

Permalink
[media] tda18212: round IF frequency to close hardware value
Browse files Browse the repository at this point in the history
Chip configures IF frequency resolution of 50 kHz. Round it nearest.
Off-by 50 kHz is almost nothing in real life...

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Nov 24, 2011
1 parent 835bf82 commit 8cffcc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/common/tuners/tda18212.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int tda18212_set_params(struct dvb_frontend *fe,
buf[0] = 0x02;
buf[1] = bw_params[i][1];
buf[2] = 0x03; /* default value */
buf[3] = if_khz / 50;
buf[3] = DIV_ROUND_CLOSEST(if_khz, 50);
buf[4] = ((c->frequency / 1000) >> 16) & 0xff;
buf[5] = ((c->frequency / 1000) >> 8) & 0xff;
buf[6] = ((c->frequency / 1000) >> 0) & 0xff;
Expand Down

0 comments on commit 8cffcc7

Please sign in to comment.