summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2015-06-17 12:08:38 +0300
committerWolfram Sang <wsa@the-dreams.de>2015-06-21 21:30:35 +0200
commitedfc39012364a6ea8e4c7067c2655c92c2d02df4 (patch)
treefd9faec730c3f6ebfd060e39a03f65079038dbaf /drivers/i2c
parent3aaa34b9923b994c13267e05ce8246faa1e8c8eb (diff)
i2c: designware: Make sure the device is suspended before disabling runtime PM
The driver calls pm_runtime_put() right before pm_runtime_disable() in its ->remove() hook to make sure clock is gated etc. However, it turns out that pm_runtime_put() only calls ->idle() hook without actually suspending anything. The following pm_runtime_disable() will prevent the driver from suspending thus leaving it "active". It is better to suspend the device synchronously to make sure it is actually suspended before disabling runtime PM from it. While there, undo call to pm_runtime_use_autosuspend(). Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 4794911a6165..3dd2de31a2f8 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -281,7 +281,8 @@ static int dw_i2c_remove(struct platform_device *pdev)
i2c_dw_disable(dev);
- pm_runtime_put(&pdev->dev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
+ pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
if (has_acpi_companion(&pdev->dev))