summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/dvo_ivch.c14
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;
};