Skip to content

Commit 0f84f29

Browse files
Helmut Grohnelinusw
authored andcommitted
gpio: zynq: initialize clock even without CONFIG_PM
When the PM initialization was moved in the commit referenced below, the code enabling the clock was removed from the probe function. On CONFIG_PM=y kernels, this is not a problem as the pm resume hook enables the clock, but when power management is disabled, all those pm_* functions are noops and the clock is never enabled resulting in a dysfunctional gpio controller. Put the clock initialization back to support CONFIG_PM=n. Cc: [email protected] Signed-off-by: Helmut Grohne <[email protected]> Fixes: 3773c19 ("gpio: zynq: Do PM initialization earlier to support gpio hogs") Signed-off-by: Linus Walleij <[email protected]>
1 parent d15d6cf commit 0f84f29

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpio/gpio-zynq.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,13 @@ static int zynq_gpio_probe(struct platform_device *pdev)
709709
dev_err(&pdev->dev, "input clock not found.\n");
710710
return PTR_ERR(gpio->clk);
711711
}
712+
ret = clk_prepare_enable(gpio->clk);
713+
if (ret) {
714+
dev_err(&pdev->dev, "Unable to enable clock.\n");
715+
return ret;
716+
}
712717

718+
pm_runtime_set_active(&pdev->dev);
713719
pm_runtime_enable(&pdev->dev);
714720
ret = pm_runtime_get_sync(&pdev->dev);
715721
if (ret < 0)
@@ -747,6 +753,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
747753
pm_runtime_put(&pdev->dev);
748754
err_pm_dis:
749755
pm_runtime_disable(&pdev->dev);
756+
clk_disable_unprepare(gpio->clk);
750757

751758
return ret;
752759
}

0 commit comments

Comments
 (0)