You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
spi/pl022: add support for pm_runtime autosuspend
Adds support for configuring the spi bus to use autosuspend for runtime power management. This can reduce the latency in starting an spi transfer by not suspending the device immediately following completion of a transfer. If another transfer then takes place before the autosuspend timeout, the call to resume the device can return immediately rather than needing to risk sleeping in order to resume the device. Reviewed-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Chris Blair <chris.blair@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
0ad2deeab5
commit
53e4acea0e
+18
-2
@@ -1516,7 +1516,13 @@ static void pump_messages(struct work_struct *work)
|
||||
/* nothing more to do - disable spi/ssp and power off */
|
||||
writew((readw(SSP_CR1(pl022->virtbase)) &
|
||||
(~SSP_CR1_MASK_SSE)), SSP_CR1(pl022->virtbase));
|
||||
pm_runtime_put(&pl022->adev->dev);
|
||||
|
||||
if (pl022->master_info->autosuspend_delay > 0) {
|
||||
pm_runtime_mark_last_busy(&pl022->adev->dev);
|
||||
pm_runtime_put_autosuspend(&pl022->adev->dev);
|
||||
} else {
|
||||
pm_runtime_put(&pl022->adev->dev);
|
||||
}
|
||||
}
|
||||
pl022->busy = false;
|
||||
spin_unlock_irqrestore(&pl022->queue_lock, flags);
|
||||
@@ -2247,7 +2253,17 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
|
||||
dev_dbg(dev, "probe succeeded\n");
|
||||
|
||||
/* let runtime pm put suspend */
|
||||
pm_runtime_put(dev);
|
||||
if (platform_info->autosuspend_delay > 0) {
|
||||
dev_info(&adev->dev,
|
||||
"will use autosuspend for runtime pm, delay %dms\n",
|
||||
platform_info->autosuspend_delay);
|
||||
pm_runtime_set_autosuspend_delay(dev,
|
||||
platform_info->autosuspend_delay);
|
||||
pm_runtime_use_autosuspend(dev);
|
||||
pm_runtime_put_autosuspend(dev);
|
||||
} else {
|
||||
pm_runtime_put(dev);
|
||||
}
|
||||
return 0;
|
||||
|
||||
err_spi_register:
|
||||
|
||||
Reference in New Issue
Block a user