forked from Minki/linux
[media] mxl5007t: fix reg read
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>
This commit is contained in:
parent
d7d89dc85b
commit
576b849ea7
@ -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)
|
static int mxl5007t_read_reg(struct mxl5007t_state *state, u8 reg, u8 *val)
|
||||||
{
|
{
|
||||||
|
u8 buf[2] = { 0xfb, reg };
|
||||||
struct i2c_msg msg[] = {
|
struct i2c_msg msg[] = {
|
||||||
{ .addr = state->i2c_props.addr, .flags = 0,
|
{ .addr = state->i2c_props.addr, .flags = 0,
|
||||||
.buf = ®, .len = 1 },
|
.buf = buf, .len = 2 },
|
||||||
{ .addr = state->i2c_props.addr, .flags = I2C_M_RD,
|
{ .addr = state->i2c_props.addr, .flags = I2C_M_RD,
|
||||||
.buf = val, .len = 1 },
|
.buf = val, .len = 1 },
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user