dev/i2c_bus: Fix `count` argument in i2c_dev_detect()
We actually want the bus driver to process the 1 zero-length write we are passing. So set the count to 1. Change-Id: I5a41abb68c27a83715b6baec91ece9fa90b66a8c Signed-off-by: Nico Huber <nico.h@gmx.de> Tested-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/66337 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
parent
245fe4bd29
commit
51a35764b3
|
@ -9,7 +9,7 @@
|
||||||
bool i2c_dev_detect(struct device *dev, unsigned int addr)
|
bool i2c_dev_detect(struct device *dev, unsigned int addr)
|
||||||
{
|
{
|
||||||
struct i2c_msg seg = { .flags = 0, .slave = addr, .buf = NULL, .len = 0 };
|
struct i2c_msg seg = { .flags = 0, .slave = addr, .buf = NULL, .len = 0 };
|
||||||
return dev->ops->ops_i2c_bus->transfer(dev, &seg, 0) == 0;
|
return dev->ops->ops_i2c_bus->transfer(dev, &seg, 1) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct bus *i2c_link(const struct device *const dev)
|
struct bus *i2c_link(const struct device *const dev)
|
||||||
|
|
Loading…
Reference in New Issue