diff options
author | Chris Pascoe <c.pascoe@itee.uq.edu.au> | 2007-11-19 19:20:17 +1000 |
---|---|---|
committer | Chris Pascoe <c.pascoe@itee.uq.edu.au> | 2007-11-19 19:20:17 +1000 |
commit | 42b654fd1199ed902532ddffccf9999f59b7946f (patch) | |
tree | a0fd47ec3fb14c5af9af043d668d19178d74e549 /linux | |
parent | ca20d4780a623eb22ad23a4c127fd18f35dcf2ca (diff) | |
download | mediapointer-dvb-s2-42b654fd1199ed902532ddffccf9999f59b7946f.tar.gz mediapointer-dvb-s2-42b654fd1199ed902532ddffccf9999f59b7946f.tar.bz2 |
xc2028: correct divisor length
From: Chris Pascoe <c.pascoe@itee.uq.edu.au>
The frequency divisor should only be four bytes long. Also, display the
frequency and divisor correctly in the debug output.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drivers/media/video/tuner-xc2028.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/linux/drivers/media/video/tuner-xc2028.c b/linux/drivers/media/video/tuner-xc2028.c index fd8714faf..1a397dc1d 100644 --- a/linux/drivers/media/video/tuner-xc2028.c +++ b/linux/drivers/media/video/tuner-xc2028.c @@ -755,7 +755,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , { struct xc2028_data *priv = fe->tuner_priv; int rc = -EINVAL; - unsigned char buf[5]; + unsigned char buf[4]; u32 div, offset = 0; tuner_dbg("%s called\n", __FUNCTION__); @@ -775,7 +775,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , msleep(10); #endif - tuner_dbg("should set frequency %d kHz)\n", freq / 1000); + tuner_dbg("should set frequency %d kHz\n", freq / 1000); if (check_firmware(fe, new_mode, std, bandwidth) < 0) goto ret; @@ -786,7 +786,6 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , div = (freq - offset + DIV / 2) / DIV; /* CMD= Set frequency */ - if (priv->firm_version < 0x0202) rc = send_seq(priv, {0x00, 0x02, 0x00, 0x00}); else @@ -804,7 +803,6 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , buf[1] = 0xff & (div >> 16); buf[2] = 0xff & (div >> 8); buf[3] = 0xff & (div); - buf[4] = 0; rc = i2c_send(priv, buf, sizeof(buf)); if (rc < 0) @@ -813,9 +811,9 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , priv->frequency = freq; - tuner_dbg("divider= %02x %02x %02x %02x (freq=%d.%02d)\n", - buf[1], buf[2], buf[3], buf[4], - freq / 1000000, (freq % 1000000) / 10000); + tuner_dbg("divisor= %02x %02x %02x %02x (freq=%d.%03d)\n", + buf[0], buf[1], buf[2], buf[3], + freq / 1000000, (freq % 1000000) / 1000); rc = 0; |