aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/i2c-core.c
diff options
context:
space:
mode:
authorDustin Byford <dustin@cumulusnetworks.com>2015-10-23 15:27:07 -0400
committerWolfram Sang <wsa@the-dreams.de>2015-10-25 10:49:46 -0400
commit8eb5c87a92c065aaca39ac3e841b07906a4959a2 (patch)
tree326cf581c599660996c4ddb59a5ffc6898ad0ebd /drivers/i2c/i2c-core.c
parentc0e5c4450494d74c8deb4f47ddcbb74c94937e20 (diff)
i2c: add ACPI support for I2C mux ports
Although I2C mux devices are easily enumerated using ACPI (_HID/_CID or device property compatible string match), enumerating I2C client devices connected through an I2C mux needs a little extra work. This change implements a method for describing an I2C device hierarchy that includes mux devices by using an ACPI Device() for each mux channel along with an _ADR to set the channel number for the device. See Documentation/acpi/i2c-muxes.txt for a simple example. To make this work the ismt, i801, and designware pci/platform devs now share an ACPI companion with their I2C adapter dev similar to how it's done in OF. This is done on the assumption that power management functions will not be called directly on the I2C dev that is sharing the ACPI node. Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r--drivers/i2c/i2c-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 3a4c54ef290d..5897fdb2480d 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -156,7 +156,7 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level,
156 info.fwnode = acpi_fwnode_handle(adev); 156 info.fwnode = acpi_fwnode_handle(adev);
157 157
158 memset(&lookup, 0, sizeof(lookup)); 158 memset(&lookup, 0, sizeof(lookup));
159 lookup.adapter_handle = ACPI_HANDLE(adapter->dev.parent); 159 lookup.adapter_handle = ACPI_HANDLE(&adapter->dev);
160 lookup.device_handle = handle; 160 lookup.device_handle = handle;
161 lookup.info = &info; 161 lookup.info = &info;
162 162
@@ -212,7 +212,7 @@ static void acpi_i2c_register_devices(struct i2c_adapter *adap)
212{ 212{
213 acpi_status status; 213 acpi_status status;
214 214
215 if (!adap->dev.parent || !has_acpi_companion(adap->dev.parent)) 215 if (!has_acpi_companion(&adap->dev))
216 return; 216 return;
217 217
218 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 218 status = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,