From f2f3c1576a5d4b15788843ab3353e6307fe380ba Mon Sep 17 00:00:00 2001 From: Wenyou Yang Date: Thu, 23 Mar 2017 12:46:21 +0800 Subject: [PATCH] gpio: at91_gpio: add the clock support MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Add the clock support. Signed-off-by: Wenyou Yang Reviewed-by: Simon Glass Reviewed-by: Andreas Bießmann --- drivers/gpio/at91_gpio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpio/at91_gpio.c b/drivers/gpio/at91_gpio.c index 37955cc99a..98dbd8210e 100644 --- a/drivers/gpio/at91_gpio.c +++ b/drivers/gpio/at91_gpio.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -569,6 +570,18 @@ static int at91_gpio_probe(struct udevice *dev) struct at91_port_priv *port = dev_get_priv(dev); struct at91_port_platdata *plat = dev_get_platdata(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); + struct clk clk; + int ret; + + ret = clk_get_by_index(dev, 0, &clk); + if (ret) + return ret; + + ret = clk_enable(&clk); + if (ret) + return ret; + + clk_free(&clk); uc_priv->bank_name = plat->bank_name; uc_priv->gpio_count = GPIO_PER_BANK; -- 2.30.2