summaryrefslogtreecommitdiff
path: root/include/hw/i2c/i2c.h
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2021-04-12 12:45:21 -0700
committerCorey Minyard <cminyard@mvista.com>2021-04-15 07:10:30 -0500
commit3f9b32595e785c79720ed174198472c3d4d32c03 (patch)
treee37aadf2f77131ec20a77655d62a7de73af594d9 /include/hw/i2c/i2c.h
parent513ca82d8982463aca98aa01dcf584e0b4fc0982 (diff)
downloadqemu-3f9b32595e785c79720ed174198472c3d4d32c03.zip
hw/i2c: move search to i2c_scan_bus method
Moves the search for matching devices on an i2c bus into a separate method. This allows for an object that owns an I2CBus can avoid duplicating this method. Tested: A BMC firmware was booted to userspace and i2c devices were detected. Signed-off-by: Patrick Venture <venture@google.com> Reviewed-by: Hao Wu <wuhaotsh@google.com> Message-Id: <20210412194522.664594-4-venture@google.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'include/hw/i2c/i2c.h')
-rw-r--r--include/hw/i2c/i2c.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/hw/i2c/i2c.h b/include/hw/i2c/i2c.h
index 9b8b95ff4a..ff4129ea70 100644
--- a/include/hw/i2c/i2c.h
+++ b/include/hw/i2c/i2c.h
@@ -87,6 +87,8 @@ void i2c_nack(I2CBus *bus);
int i2c_send_recv(I2CBus *bus, uint8_t *data, bool send);
int i2c_send(I2CBus *bus, uint8_t data);
uint8_t i2c_recv(I2CBus *bus);
+bool i2c_scan_bus(I2CBus *bus, uint8_t address, bool broadcast,
+ I2CNodeList *current_devs);
/**
* Create an I2C slave device on the heap.