diff options
author | Nico Huber <nico.h@gmx.de> | 2022-08-01 19:32:37 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-08-03 20:55:14 +0000 |
commit | 51a35764b31d987b624c60dab7a86b355998a184 (patch) | |
tree | 5efa09160ad5066c1d8751c0ae0221ac0bdf62a2 | |
parent | 245fe4bd2933f43b9203f0c602bf59d3bf98ce21 (diff) |
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>
-rw-r--r-- | src/device/i2c_bus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/device/i2c_bus.c b/src/device/i2c_bus.c index bccd9a8c97..8368c247b8 100644 --- a/src/device/i2c_bus.c +++ b/src/device/i2c_bus.c @@ -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) |