[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201016085014.31667-1-al.kochet@gmail.com>
Date: Fri, 16 Oct 2020 11:50:14 +0300
From: Alexander Kochetkov <al.kochet@...il.com>
To: Mark Brown <broonie@...nel.org>, Heiko Stuebner <heiko@...ech.de>
Cc: linux-spi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
Alexander Kochetkov <al.kochet@...il.com>
Subject: [PATCH] spi: rockchip: enable autosuspend feature
If SPI is used for periodic polling any sensor, significant delays
sometimes appear. Switching on module clocks during resume lead to delays.
Enabling autosuspend mode causes the controller to not suspend between
SPI transfers and the delays disappear.
Signed-off-by: Alexander Kochetkov <al.kochet@...il.com>
---
drivers/spi/spi-rockchip.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 2cc6d9951b52..3e77b1a79bc8 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -157,6 +157,8 @@
#define ROCKCHIP_SPI_MAX_CS_NUM 2
+#define ROCKCHIP_AUTOSUSPEND_TIMEOUT 2000
+
struct rockchip_spi {
struct device *dev;
@@ -670,6 +672,8 @@ static int rockchip_spi_probe(struct platform_device *pdev)
goto err_disable_spiclk;
}
+ pm_runtime_set_autosuspend_delay(&pdev->dev, ROCKCHIP_AUTOSUSPEND_TIMEOUT);
+ pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
--
2.17.1
Powered by blists - more mailing lists