summaryrefslogtreecommitdiff
path: root/include/i2c.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-22 21:45:01 +0300
committerBin Meng <bmeng.cn@gmail.com>2020-09-25 06:27:15 +0300
commitfd42f263cef9fd6bba9ded76a82d4ac66450e156 (patch)
tree64bc139fe69c2d50a6200ccda1f1c521e45643b4 /include/i2c.h
parentbddbaf5edf0e01817f2577295c3d682e4d5fed09 (diff)
downloadu-boot-fd42f263cef9fd6bba9ded76a82d4ac66450e156.tar.xz
i2c: Add a generic driver to generate ACPI info
Many I2C devices produce roughly the same ACPI data with just things like the GPIO/interrupt information being different. This can be handled by a generic driver along with some information in the device tree. Add a generic i2c driver for this purpose. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'include/i2c.h')
-rw-r--r--include/i2c.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/i2c.h b/include/i2c.h
index 1d792db454..880aa8032b 100644
--- a/include/i2c.h
+++ b/include/i2c.h
@@ -58,6 +58,12 @@ enum i2c_address_mode {
I2C_MODE_10_BIT
};
+/** enum i2c_device_t - Types of I2C devices, used for compatible strings */
+enum i2c_device_t {
+ I2C_DEVICE_GENERIC,
+ I2C_DEVICE_HID_OVER_I2C,
+};
+
struct udevice;
/**
* struct dm_i2c_chip - information about an i2c chip
@@ -558,6 +564,23 @@ int i2c_emul_find(struct udevice *dev, struct udevice **emulp);
*/
struct udevice *i2c_emul_get_device(struct udevice *emul);
+/* ACPI operations for generic I2C devices */
+extern struct acpi_ops i2c_acpi_ops;
+
+/**
+ * acpi_i2c_ofdata_to_platdata() - Read properties intended for ACPI
+ *
+ * This reads the generic I2C properties from the device tree, so that these
+ * can be used to create ACPI information for the device.
+ *
+ * See the i2c/generic-acpi.txt binding file for information about the
+ * properties.
+ *
+ * @dev: I2C device to process
+ * @return 0 if OK, -EINVAL if acpi,hid is not present
+ */
+int acpi_i2c_ofdata_to_platdata(struct udevice *dev);
+
#ifndef CONFIG_DM_I2C
/*