diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-05-30 14:23:04 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-05-30 14:24:21 -0400 |
commit | efb48c6cf7bbb57e7b2ea6ce7671905e84384963 (patch) | |
tree | ee2eeef96b5cc5f7efe1c180d134314608e1a2fd /linux-core/dvo_ivch.c | |
parent | 98c5cf7f6fc51f1a8f5f90b3895009cd38dd8f22 (diff) |
Fix ivch i2c read function to use the "special" i2c format.
Diffstat (limited to 'linux-core/dvo_ivch.c')
-rw-r--r-- | linux-core/dvo_ivch.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/linux-core/dvo_ivch.c b/linux-core/dvo_ivch.c index 5fce2462..9209dd02 100644 --- a/linux-core/dvo_ivch.c +++ b/linux-core/dvo_ivch.c @@ -186,28 +186,32 @@ static bool ivch_read(struct intel_dvo_device *dvo, int addr, uint16_t *data) { struct ivch_priv *priv = dvo->dev_priv; struct intel_i2c_chan *i2cbus = dvo->i2c_bus; - u8 out_buf[2]; + u8 out_buf[1]; u8 in_buf[2]; struct i2c_msg msgs[] = { { .addr = i2cbus->slave_addr, - .flags = 0, + .flags = I2C_M_RD, + .len = 0, + }, + { + .addr = 0, + .flags = I2C_M_NOSTART, .len = 1, .buf = out_buf, }, { .addr = i2cbus->slave_addr, - .flags = I2C_M_RD, + .flags = I2C_M_RD | I2C_M_NOSTART, .len = 2, .buf = in_buf, } }; out_buf[0] = addr; - out_buf[1] = 0; - if (i2c_transfer(&i2cbus->adapter, msgs, 2) == 2) { + if (i2c_transfer(&i2cbus->adapter, msgs, 3) == 3) { *data = (in_buf[1] << 8) | in_buf[0]; return true; }; |