Unverified Commit 940f3bbf authored by Alexander Kochetkov's avatar Alexander Kochetkov Committed by Mark Brown
Browse files

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: default avatarAlexander Kochetkov <al.kochet@gmail.com>
Link: https://lore.kernel.org/r/20201016085014.31667-1-al.kochet@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 345980a3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -160,6 +160,8 @@
#define ROCKCHIP_SPI_VER2_TYPE1			0x05EC0002
#define ROCKCHIP_SPI_VER2_TYPE2			0x00110002

#define ROCKCHIP_AUTOSUSPEND_TIMEOUT		2000

struct rockchip_spi {
	struct device *dev;

@@ -715,6 +717,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);