spi: rockchip: Support pm_runtime_use_autosuspend

Change-Id: I12103f0d1fbe3c168c5fa304d4bfb181d2a4ab5f
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
This commit is contained in:
Jon Lin
2023-07-20 15:30:04 +08:00
committed by Tao Huang
parent 75476ee430
commit 8a5c76ee45

View File

@@ -979,6 +979,7 @@ static int rockchip_spi_probe(struct platform_device *pdev)
bool slave_mode;
struct pinctrl *pinctrl = NULL;
const struct rockchip_spi_quirks *quirks_cfg;
u32 val;
slave_mode = of_property_read_bool(np, "spi-slave");
@@ -1106,6 +1107,13 @@ static int rockchip_spi_probe(struct platform_device *pdev)
if (quirks_cfg)
rs->max_baud_div_in_cpha = quirks_cfg->max_baud_div_in_cpha;
if (!device_property_read_u32(&pdev->dev, "rockchip,autosuspend-delay-ms", &val)) {
if (val > 0) {
pm_runtime_set_autosuspend_delay(&pdev->dev, val);
pm_runtime_use_autosuspend(&pdev->dev);
}
}
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);