summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHelmut Grohne <h.grohne@intenta.de>2016-06-03 14:15:32 +0200
committerLinus Walleij <linus.walleij@linaro.org>2016-06-08 10:36:29 +0200
commit0f84f29ff30bdb1bca23017b118b4ea3999cac32 (patch)
tree6186d77109d9dbd5ac7b42d88f0a818c3553fef3 /drivers
parentd15d6cf91695674fbabac3b1d2c8a269d9bab5c6 (diff)
downloadlinux-0f84f29ff30bdb1bca23017b118b4ea3999cac32.tar.gz
linux-0f84f29ff30bdb1bca23017b118b4ea3999cac32.tar.bz2
linux-0f84f29ff30bdb1bca23017b118b4ea3999cac32.zip
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: Helmut Grohne <h.grohne@intenta.de> Fixes: 3773c195d387 ("gpio: zynq: Do PM initialization earlier to support gpio hogs") Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpio/gpio-zynq.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 75c6355b018d..e72794e463aa 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -709,7 +709,13 @@ static int zynq_gpio_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "input clock not found.\n");
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);
ret = pm_runtime_get_sync(&pdev->dev);
if (ret < 0)
@@ -747,6 +753,7 @@ err_pm_put:
pm_runtime_put(&pdev->dev);
err_pm_dis:
pm_runtime_disable(&pdev->dev);
+ clk_disable_unprepare(gpio->clk);
return ret;
}