mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user