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:
Nico Huber 2022-08-01 19:32:37 +02:00 committed by Felix Held
parent 245fe4bd29
commit 51a35764b3
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@
bool i2c_dev_detect(struct device *dev, unsigned int addr)
{
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)