summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2012-11-23 12:23:40 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-23 12:23:40 +0100
commit907ddf89d0bb7f57e1e21485900e6564a1ab512a (patch)
tree5008892e74b8b805a120b659f701604593b5d3f7 /include
parent863f9f30e6c1e30cb19a0cd17c5cf8879257dfd7 (diff)
downloadlinux-stable-907ddf89d0bb7f57e1e21485900e6564a1ab512a.tar.gz
linux-stable-907ddf89d0bb7f57e1e21485900e6564a1ab512a.tar.bz2
linux-stable-907ddf89d0bb7f57e1e21485900e6564a1ab512a.zip
i2c / ACPI: add ACPI enumeration support
ACPI 5 introduced I2cSerialBus resource that makes it possible to enumerate and configure the I2C slave devices behind the I2C controller. This patch adds helper functions to support I2C slave enumeration. An ACPI enabled I2C controller driver only needs to call acpi_i2c_register_devices() in order to get its slave devices enumerated, created and bound to the corresponding ACPI handle. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/i2c.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 800de224336b..d0c4db7b4872 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -259,6 +259,7 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data)
* @platform_data: stored in i2c_client.dev.platform_data
* @archdata: copied into i2c_client.dev.archdata
* @of_node: pointer to OpenFirmware device node
+ * @acpi_node: ACPI device node
* @irq: stored in i2c_client.irq
*
* I2C doesn't actually support hardware probing, although controllers and
@@ -279,6 +280,7 @@ struct i2c_board_info {
void *platform_data;
struct dev_archdata *archdata;
struct device_node *of_node;
+ struct acpi_dev_node acpi_node;
int irq;
};
@@ -501,4 +503,11 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap)
i2c_del_driver)
#endif /* I2C */
+
+#if IS_ENABLED(CONFIG_ACPI_I2C)
+extern void acpi_i2c_register_devices(struct i2c_adapter *adap);
+#else
+static inline void acpi_i2c_register_devices(struct i2c_adapter *adap) {}
+#endif
+
#endif /* _LINUX_I2C_H */