aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-07-23 17:17:57 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-07-25 21:43:31 -0400
commitf1feda70b5dfdbe6a1069efffec099b430467331 (patch)
tree95d7dd0abe2f808ca8812bd2f19967564c2b39d7 /drivers/gpu
parente04d8e829d7807e132d8c82c3554b164a803c617 (diff)
drm/nouveau: Put back the old 2-messages I2C slave test.
I was hoping we could detect I2C devices at a given address without actually writing data into them, but apparently some DDC slaves get confused with 0-bytes transactions. Put the good old test back. Reported-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-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 97ba89ef42a..5588e66dd9f 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)
281bool 281bool
282nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr) 282nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr)
283{ 283{
284 struct i2c_msg msg = { 284 uint8_t buf[] = { 0 };
285 .addr = addr, 285 struct i2c_msg msgs[] = {
286 .len = 0, 286 {
287 .addr = addr,
288 .flags = 0,
289 .len = 1,
290 .buf = buf,
291 },
292 {
293 .addr = addr,
294 .flags = I2C_M_RD,
295 .len = 1,
296 .buf = buf,
297 }
287 }; 298 };
288 299
289 return i2c_transfer(&i2c->adapter, &msg, 1) == 1; 300 return i2c_transfer(&i2c->adapter, msgs, 2) == 2;
290} 301}
291 302
292int 303int