diff options
author | Chris Pascoe <c.pascoe@itee.uq.edu.au> | 2007-11-19 04:20:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:02:26 -0500 |
commit | 2ce4b3aa7c3c199466ae9f5ed32ea177912c8c3a (patch) | |
tree | f5b95601a7d6f5d50cc15d8654c640b827f8f725 | |
parent | 06fd82dc7bdc6045bf8d6c1438d2a33ffb1cf337 (diff) |
V4L/DVB (6639): xc2028: correct divisor length
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>
-rw-r--r-- | drivers/media/video/tuner-xc2028.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c index 7c86971a8d64..e85992f970f7 100644 --- a/drivers/media/video/tuner-xc2028.c +++ b/drivers/media/video/tuner-xc2028.c | |||
@@ -740,7 +740,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
740 | { | 740 | { |
741 | struct xc2028_data *priv = fe->tuner_priv; | 741 | struct xc2028_data *priv = fe->tuner_priv; |
742 | int rc = -EINVAL; | 742 | int rc = -EINVAL; |
743 | unsigned char buf[5]; | 743 | unsigned char buf[4]; |
744 | u32 div, offset = 0; | 744 | u32 div, offset = 0; |
745 | 745 | ||
746 | tuner_dbg("%s called\n", __FUNCTION__); | 746 | tuner_dbg("%s called\n", __FUNCTION__); |
@@ -758,7 +758,7 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
758 | goto ret; | 758 | goto ret; |
759 | 759 | ||
760 | msleep(10); | 760 | msleep(10); |
761 | tuner_dbg("should set frequency %d kHz)\n", freq / 1000); | 761 | tuner_dbg("should set frequency %d kHz\n", freq / 1000); |
762 | 762 | ||
763 | if (check_firmware(fe, new_mode, std, bandwidth) < 0) | 763 | if (check_firmware(fe, new_mode, std, bandwidth) < 0) |
764 | goto ret; | 764 | goto ret; |
@@ -769,7 +769,6 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
769 | div = (freq - offset + DIV / 2) / DIV; | 769 | div = (freq - offset + DIV / 2) / DIV; |
770 | 770 | ||
771 | /* CMD= Set frequency */ | 771 | /* CMD= Set frequency */ |
772 | |||
773 | if (priv->firm_version < 0x0202) | 772 | if (priv->firm_version < 0x0202) |
774 | rc = send_seq(priv, {0x00, 0x02, 0x00, 0x00}); | 773 | rc = send_seq(priv, {0x00, 0x02, 0x00, 0x00}); |
775 | else | 774 | else |
@@ -787,7 +786,6 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
787 | buf[1] = 0xff & (div >> 16); | 786 | buf[1] = 0xff & (div >> 16); |
788 | buf[2] = 0xff & (div >> 8); | 787 | buf[2] = 0xff & (div >> 8); |
789 | buf[3] = 0xff & (div); | 788 | buf[3] = 0xff & (div); |
790 | buf[4] = 0; | ||
791 | 789 | ||
792 | rc = i2c_send(priv, buf, sizeof(buf)); | 790 | rc = i2c_send(priv, buf, sizeof(buf)); |
793 | if (rc < 0) | 791 | if (rc < 0) |
@@ -796,9 +794,9 @@ static int generic_set_tv_freq(struct dvb_frontend *fe, u32 freq /* in Hz */ , | |||
796 | 794 | ||
797 | priv->frequency = freq; | 795 | priv->frequency = freq; |
798 | 796 | ||
799 | tuner_dbg("divider= %02x %02x %02x %02x (freq=%d.%02d)\n", | 797 | tuner_dbg("divisor= %02x %02x %02x %02x (freq=%d.%03d)\n", |
800 | buf[1], buf[2], buf[3], buf[4], | 798 | buf[0], buf[1], buf[2], buf[3], |
801 | freq / 1000000, (freq % 1000000) / 10000); | 799 | freq / 1000000, (freq % 1000000) / 1000); |
802 | 800 | ||
803 | rc = 0; | 801 | rc = 0; |
804 | 802 | ||