aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pinctrl/pinctrl-sunxi.c
diff options
context:
space:
mode:
authorEmilio López <emilio@elopez.com.ar>2013-03-22 10:20:40 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-04-03 07:58:38 -0400
commit950707c0eb5c7aeaa2c446a04c824f4be686d2f6 (patch)
treeaac6e165bda3c15647e3e215e5adb67d5d863e10 /drivers/pinctrl/pinctrl-sunxi.c
parent2afe8229687ec24cbc07e78449a588bb8b68f858 (diff)
pinctrl: sunxi: add clock support
For the port controller to work, we need to enable the apb0_pio gate. This commit adds the ability to enable one clock specified on the device tree to the pinctrl driver. Signed-off-by: Emilio López <emilio@elopez.com.ar> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-sunxi.c')
-rw-r--r--drivers/pinctrl/pinctrl-sunxi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c
index cb491d6ba601..617d351a0a44 100644
--- a/drivers/pinctrl/pinctrl-sunxi.c
+++ b/drivers/pinctrl/pinctrl-sunxi.c
@@ -11,6 +11,7 @@
11 */ 11 */
12 12
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/clk.h>
14#include <linux/gpio.h> 15#include <linux/gpio.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/of.h> 17#include <linux/of.h>
@@ -1917,6 +1918,7 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
1917 struct pinctrl_pin_desc *pins; 1918 struct pinctrl_pin_desc *pins;
1918 struct sunxi_pinctrl *pctl; 1919 struct sunxi_pinctrl *pctl;
1919 int i, ret, last_pin; 1920 int i, ret, last_pin;
1921 struct clk *clk;
1920 1922
1921 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL); 1923 pctl = devm_kzalloc(&pdev->dev, sizeof(*pctl), GFP_KERNEL);
1922 if (!pctl) 1924 if (!pctl)
@@ -1987,6 +1989,12 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev)
1987 goto gpiochip_error; 1989 goto gpiochip_error;
1988 } 1990 }
1989 1991
1992 clk = devm_clk_get(&pdev->dev, NULL);
1993 if (IS_ERR(clk))
1994 goto gpiochip_error;
1995
1996 clk_prepare_enable(clk);
1997
1990 dev_info(&pdev->dev, "initialized sunXi PIO driver\n"); 1998 dev_info(&pdev->dev, "initialized sunXi PIO driver\n");
1991 1999
1992 return 0; 2000 return 0;