summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index d33f827500..ccffc19552 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -536,6 +536,27 @@ int i2c_chip_ofdata_to_platdata(struct udevice *dev, struct dm_i2c_chip *chip);
*/
void i2c_dump_msgs(struct i2c_msg *msg, int nmsgs);
+/**
+ * i2c_emul_find() - Find an emulator for an i2c sandbox device
+ *
+ * This looks at the device's 'emul' phandle
+ *
+ * @dev: Device to find an emulator for
+ * @emulp: Returns the associated emulator, if found *
+ * @return 0 if OK, -ENOENT or -ENODEV if not found
+ */
+int i2c_emul_find(struct udevice *dev, struct udevice **emulp);
+
+/**
+ * i2c_emul_get_device() - Find the device being emulated
+ *
+ * Given an emulator this returns the associated device
+ *
+ * @emul: Emulator for the device
+ * @return device that @emul is emulating
+ */
+struct udevice *i2c_emul_get_device(struct udevice *emul);
+
#ifndef CONFIG_DM_I2C
/*