diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-28 01:17:49 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-10-28 01:17:49 +0100 |
commit | dd6c26be3bb3e98d4811780f831bbc246dae54c8 (patch) | |
tree | 5b0cce644ee725386b2c4539afc91459e1913cd9 /drivers/i2c | |
parent | c0ced86d38f418448dce1ca8a825dfd16ee9a23a (diff) | |
parent | 33cf00e5708290f7e57d949219ef443a2aef34e0 (diff) | |
download | linux-dd6c26be3bb3e98d4811780f831bbc246dae54c8.tar.gz linux-dd6c26be3bb3e98d4811780f831bbc246dae54c8.tar.bz2 linux-dd6c26be3bb3e98d4811780f831bbc246dae54c8.zip |
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')
-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) client->flags & I2C_CLIENT_WAKE); dev_dbg(dev, "probe\n"); + acpi_dev_pm_attach(&client->dev, true); status = driver->probe(client, i2c_match_id(driver->id_table, client)); if (status) { client->driver = NULL; i2c_set_clientdata(client, NULL); + acpi_dev_pm_detach(&client->dev, true); } return status; } @@ -283,6 +285,7 @@ static int i2c_device_remove(struct device *dev) client->driver = NULL; i2c_set_clientdata(client, NULL); } + acpi_dev_pm_detach(&client->dev, true); return status; } @@ -1111,8 +1114,10 @@ static acpi_status acpi_i2c_add_device(acpi_handle handle, u32 level, if (ret < 0 || !info.addr) return AE_OK; + adev->power.flags.ignore_parent = true; strlcpy(info.type, dev_name(&adev->dev), sizeof(info.type)); if (!i2c_new_device(adapter, &info)) { + adev->power.flags.ignore_parent = false; dev_err(&adapter->dev, "failed to add I2C device %s from ACPI\n", dev_name(&adev->dev)); |