@@ -257,6 +257,9 @@ static int i2c_device_probe(struct device *dev)
/* Make sure the adapter is active */
pm_runtime_get_sync(&client->adapter->dev);
+ if (ACPI_HANDLE(&client->dev))
+ acpi_dev_pm_attach(&client->dev, true);
+
/*
* Enable runtime PM for the client device. If the client wants to
* participate on runtime PM it should call pm_runtime_put() in its
@@ -278,6 +281,9 @@ static int i2c_device_probe(struct device *dev)
pm_runtime_disable(&client->dev);
pm_runtime_set_suspended(&client->dev);
pm_runtime_put_noidle(&client->dev);
+
+ if (ACPI_HANDLE(&client->dev))
+ acpi_dev_pm_detach(&client->dev, true);
}
pm_runtime_put(&client->adapter->dev);
@@ -314,6 +320,9 @@ static int i2c_device_remove(struct device *dev)
pm_runtime_set_suspended(&client->dev);
pm_runtime_put_noidle(&client->dev);
+ if (ACPI_HANDLE(&client->dev))
+ acpi_dev_pm_detach(&client->dev, true);
+
pm_runtime_put(&client->adapter->dev);
return status;
}