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>
This commit is contained in:
committed by
Ben Skeggs
parent
e04d8e829d
commit
f1feda70b5
@@ -281,12 +281,23 @@ nouveau_i2c_find(struct drm_device *dev, int index)
|
|||||||
bool
|
bool
|
||||||
nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr)
|
nouveau_probe_i2c_addr(struct nouveau_i2c_chan *i2c, int addr)
|
||||||
{
|
{
|
||||||
struct i2c_msg msg = {
|
uint8_t buf[] = { 0 };
|
||||||
.addr = addr,
|
struct i2c_msg msgs[] = {
|
||||||
.len = 0,
|
{
|
||||||
|
.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
|
int
|
||||||
|
|||||||
Reference in New Issue
Block a user