diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:17:49 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-27 20:17:49 -0400 |
commit | dd6c26be3bb3e98d4811780f831bbc246dae54c8 (patch) | |
tree | 5b0cce644ee725386b2c4539afc91459e1913cd9 /drivers/i2c/i2c-core.c | |
parent | c0ced86d38f418448dce1ca8a825dfd16ee9a23a (diff) | |
parent | 33cf00e5708290f7e57d949219ef443a2aef34e0 (diff) |
Merge branch 'acpi-pm'
* acpi-pm:
spi: attach/detach SPI device to the ACPI power domain
i2c: attach/detach I2C client device to the ACPI power domain
ACPI / PM: allow child devices to ignore parent power state
Diffstat (limited to 'drivers/i2c/i2c-core.c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 3be58f89ac77..75ba8608383e 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -254,10 +254,12 @@ static int i2c_device_probe(struct device *dev) | |||
254 | client->flags & I2C_CLIENT_WAKE); | 254 | client->flags & I2C_CLIENT_WAKE); |
255 | dev_dbg(dev, "probe\n"); | 255 | dev_dbg(dev, "probe\n"); |
256 | 256 | ||
257 | acpi_dev_pm_attach(&client->dev, true); | ||
257 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); | 258 | status = driver->probe(client, i2c_match_id(driver->id_table, client)); |
258 | if (status) { | 259 | if (status) { |
259 | client->driver = NULL; | 260 | client->driver = NULL; |
260 | i2c_set_clientdata(client, NULL); | 261 | i2c_set_clientdata(client, NULL); |
262 | acpi_dev_pm_detach(&client->dev, true); | ||
261 | } | 263 | } |
262 | return status; | 264 | return status; |
263 | } | 265 | } |
@@ -283,6 +285,7 @@ static int i2c_device_remove(struct device *dev) | |||
283 | client->driver = NULL; | 285 | client->driver = NULL; |
284 | i2c_set_clientdata(client, NULL); | 286 | i2c_set_clientdata(client, NULL); |
285 | } | 287 | } |
288 | acpi_dev_pm_detach(&client->dev, true); | ||
286 | return status; | 289 | return status; |
287 | } | 290 | } |
288 | 291 | ||
@@ -1111,8 +1114,10 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level, | |||
1111 | if (ret < 0 || !info.addr) | 1114 | if (ret < 0 || !info.addr) |
1112 | return AE_OK; | 1115 | return AE_OK; |
1113 | 1116 | ||
1117 | adev->power.flags.ignore_parent = true; | ||
1114 | strlcpy(info.type, dev_name(&adev->dev), sizeof(info.type)); | 1118 | strlcpy(info.type, dev_name(&adev->dev), sizeof(info.type)); |
1115 | if (!i2c_new_device(adapter, &info)) { | 1119 | if (!i2c_new_device(adapter, &info)) { |
1120 | adev->power.flags.ignore_parent = false; | ||
1116 | dev_err(&adapter->dev, | 1121 | dev_err(&adapter->dev, |
1117 | "failed to add I2C device %s from ACPI\n", | 1122 | "failed to add I2C device %s from ACPI\n", |
1118 | dev_name(&adev->dev)); | 1123 | dev_name(&adev->dev)); |