]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[media] mxl5007t: fix reg read
authorAntti Palosaari <crope@iki.fi>
Sun, 9 Oct 2011 11:59:16 +0000 (08:59 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 24 Nov 2011 19:55:39 +0000 (17:55 -0200)
Register to read should be written to register 0xfb and then
perform I2C read to get reg value.

Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/tuners/mxl5007t.c

index 7eb1bf75cd072ae634b816a8a496ccfd8a559127..5d02221e99dd973ad674e56567bab4b369fae7ac 100644 (file)
@@ -488,9 +488,10 @@ static int mxl5007t_write_regs(struct mxl5007t_state *state,
 
 static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val)
 {
+       u8 buf[2] = { 0xfb, reg };
        struct i2c_msg msg[] = {
                { .addr = state->i2c_props.addr, .flags = 0,
-                 .buf = &reg, .len = 1 },
+                 .buf = buf, .len = 2 },
                { .addr = state->i2c_props.addr, .flags = I2C_M_RD,
                  .buf = val, .len = 1 },
        };