Commit 0f84f29f authored by Helmut Grohne's avatar Helmut Grohne Committed by Linus Walleij

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: stable@vger.kernel.org
Signed-off-by: default avatarHelmut Grohne <h.grohne@intenta.de>
Fixes: 3773c195 ("gpio: zynq: Do PM initialization earlier to support gpio hogs")
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent d15d6cf9
...@@ -709,7 +709,13 @@ static int zynq_gpio_probe(struct platform_device *pdev) ...@@ -709,7 +709,13 @@ static int zynq_gpio_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "input clock not found.\n"); dev_err(&pdev->dev, "input clock not found.\n");
return PTR_ERR(gpio->clk); return PTR_ERR(gpio->clk);
} }
ret = clk_prepare_enable(gpio->clk);
if (ret) {
dev_err(&pdev->dev, "Unable to enable clock.\n");
return ret;
}
pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
ret = pm_runtime_get_sync(&pdev->dev); ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0) if (ret < 0)
...@@ -747,6 +753,7 @@ static int zynq_gpio_probe(struct platform_device *pdev) ...@@ -747,6 +753,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
pm_runtime_put(&pdev->dev); pm_runtime_put(&pdev->dev);
err_pm_dis: err_pm_dis:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(gpio->clk);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment