summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_i2c.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index 97ba89ef42a0..5588e66dd9fc 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -281,12 +281,23 @@ nouveau_i2c_find(struct drm_device *dev, int index)
bool
nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr)
{
- struct i2c_msg msg = {
- .addr = addr,
- .len = 0,
+ uint8_t buf[] = { 0 };
+ struct i2c_msg msgs[] = {
+ {
+ .addr = addr,
+ .flags = 0,
+ .len = 1,
+ .buf = buf,
+ },
+ {
+ .addr = addr,
+ .flags = I2C_M_RD,
+ .len = 1,
+ .buf = buf,
+ }
};
- return i2c_transfer(&i2c->adapter, &msg, 1) == 1;
+ return i2c_transfer(&i2c->adapter, msgs, 2) == 2;
}
int
OpenPOWER on IntegriCloud