aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorMika Westerberg <mika.westerberg@linux.intel.com>2013-04-09 20:36:42 -0400
committerWolfram Sang <wsa@the-dreams.de>2013-04-15 12:18:45 -0400
commit43452335224bc0cbd605c6aee82b5c9c33e94cc6 (patch)
treeb63a20048c0ae7527103035f6656b7f5ff8d533f /drivers/i2c
parent1451b91ffef5a2ac7df28a6d8fc270ccbee5d8ac (diff)
i2c-designware: switch to use runtime PM autosuspend
Using autosuspend helps to reduce the resume latency in situations where another I2C message is going to be started soon. For example with HID over I2C touch panels we get several messages in a short period of time while the touch panel is in use. 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-core.c3
-rw-r--r--drivers/i2c/busses/i2c-designware-pcidrv.c3
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c3
3 files changed, 6 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index 7c10c5bd36dc..21fbb340ad66 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -600,7 +600,8 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
600 ret = -EIO; 600 ret = -EIO;
601 601
602done: 602done:
603 pm_runtime_put(dev->dev); 603 pm_runtime_mark_last_busy(dev->dev);
604 pm_runtime_put_autosuspend(dev->dev);
604 mutex_unlock(&dev->lock); 605 mutex_unlock(&dev->lock);
605 606
606 return ret; 607 return ret;
diff --git a/drivers/i2c/busses/i2c-designware-pcidrv.c b/drivers/i2c/busses/i2c-designware-pcidrv.c
index aacb64e916a5..c8797e22459c 100644
--- a/drivers/i2c/busses/i2c-designware-pcidrv.c
+++ b/drivers/i2c/busses/i2c-designware-pcidrv.c
@@ -291,7 +291,8 @@ static int i2c_dw_pci_probe(struct pci_dev *pdev,
291 /* Increase reference counter */ 291 /* Increase reference counter */
292 get_device(&pdev->dev); 292 get_device(&pdev->dev);
293 293
294 pm_runtime_put_noidle(&pdev->dev); 294 pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
295 pm_runtime_use_autosuspend(&pdev->dev);
295 pm_runtime_allow(&pdev->dev); 296 pm_runtime_allow(&pdev->dev);
296 297
297 return 0; 298 return 0;
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 2a596dd1ec66..dec939aca588 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -173,9 +173,10 @@ static int dw_i2c_probe(struct platform_device *pdev)
173 /* Increase reference counter */ 173 /* Increase reference counter */
174 get_device(&pdev->dev); 174 get_device(&pdev->dev);
175 175
176 pm_runtime_set_autosuspend_delay(&pdev->dev, 1000);
177 pm_runtime_use_autosuspend(&pdev->dev);
176 pm_runtime_set_active(&pdev->dev); 178 pm_runtime_set_active(&pdev->dev);
177 pm_runtime_enable(&pdev->dev); 179 pm_runtime_enable(&pdev->dev);
178 pm_runtime_put(&pdev->dev);
179 180
180 return 0; 181 return 0;
181} 182}