diff options
author | Helmut Grohne <h.grohne@intenta.de> | 2016-06-03 08:15:32 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-06-08 04:36:29 -0400 |
commit | 0f84f29ff30bdb1bca23017b118b4ea3999cac32 (patch) | |
tree | 6186d77109d9dbd5ac7b42d88f0a818c3553fef3 /drivers/gpio/gpio-zynq.c | |
parent | d15d6cf91695674fbabac3b1d2c8a269d9bab5c6 (diff) |
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/gpio/gpio-zynq.c')
-rw-r--r-- | drivers/gpio/gpio-zynq.c | 7 |
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) | |||
709 | dev_err(&pdev->dev, "input clock not found.\n"); | 709 | dev_err(&pdev->dev, "input clock not found.\n"); |
710 | return PTR_ERR(gpio->clk); | 710 | return PTR_ERR(gpio->clk); |
711 | } | 711 | } |
712 | ret = clk_prepare_enable(gpio->clk); | ||
713 | if (ret) { | ||
714 | dev_err(&pdev->dev, "Unable to enable clock.\n"); | ||
715 | return ret; | ||
716 | } | ||
712 | 717 | ||
718 | pm_runtime_set_active(&pdev->dev); | ||
713 | pm_runtime_enable(&pdev->dev); | 719 | pm_runtime_enable(&pdev->dev); |
714 | ret = pm_runtime_get_sync(&pdev->dev); | 720 | ret = pm_runtime_get_sync(&pdev->dev); |
715 | if (ret < 0) | 721 | if (ret < 0) |
@@ -747,6 +753,7 @@ err_pm_put: | |||
747 | pm_runtime_put(&pdev->dev); | 753 | pm_runtime_put(&pdev->dev); |
748 | err_pm_dis: | 754 | err_pm_dis: |
749 | pm_runtime_disable(&pdev->dev); | 755 | pm_runtime_disable(&pdev->dev); |
756 | clk_disable_unprepare(gpio->clk); | ||
750 | 757 | ||
751 | return ret; | 758 | return ret; |
752 | } | 759 | } |