aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorHaojian Zhuang <haojian.zhuang@marvell.com>2011-10-17 09:26:55 -0400
committerHaojian Zhuang <hzhuang1@hexinfolabs.org>2011-11-15 06:09:36 -0500
commit389eda15e0f41112d7c44213b3c4f8bd1c9398bc (patch)
treed35d07f3d5f1104d6f0ed3dc95a6ded7de72a270 /drivers/gpio
parentbe24168f144122b3730beab257fa058745d14cb4 (diff)
ARM: pxa: add clk support in gpio driver
Support clk in gpio driver. There's no gpio clock in PXA25x and PXA27x. So use dummy clk instead. And move the gpio edge initialization into gpio driver for arch-mmp. Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-pxa.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index bfd755531f7a..b2d3ee1d183a 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -11,6 +11,8 @@
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation. 12 * published by the Free Software Foundation.
13 */ 13 */
14#include <linux/clk.h>
15#include <linux/err.h>
14#include <linux/gpio.h> 16#include <linux/gpio.h>
15#include <linux/gpio-pxa.h> 17#include <linux/gpio-pxa.h>
16#include <linux/init.h> 18#include <linux/init.h>
@@ -466,7 +468,8 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev)
466{ 468{
467 struct pxa_gpio_chip *c; 469 struct pxa_gpio_chip *c;
468 struct resource *res; 470 struct resource *res;
469 int gpio, irq; 471 struct clk *clk;
472 int gpio, irq, ret;
470 int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0; 473 int irq0 = 0, irq1 = 0, irq_mux, gpio_offset = 0;
471 474
472 pxa_last_gpio = pxa_gpio_nums(); 475 pxa_last_gpio = pxa_gpio_nums();
@@ -489,6 +492,27 @@ static int __devinit pxa_gpio_probe(struct platform_device *pdev)
489 if (irq0 > 0) 492 if (irq0 > 0)
490 gpio_offset = 2; 493 gpio_offset = 2;
491 494
495 clk = clk_get(&pdev->dev, NULL);
496 if (IS_ERR(clk)) {
497 dev_err(&pdev->dev, "Error %ld to get gpio clock\n",
498 PTR_ERR(clk));
499 iounmap(gpio_reg_base);
500 return PTR_ERR(clk);
501 }
502 ret = clk_prepare(clk);
503 if (ret) {
504 clk_put(clk);
505 iounmap(gpio_reg_base);
506 return ret;
507 }
508 ret = clk_enable(clk);
509 if (ret) {
510 clk_unprepare(clk);
511 clk_put(clk);
512 iounmap(gpio_reg_base);
513 return ret;
514 }
515
492 /* Initialize GPIO chips */ 516 /* Initialize GPIO chips */
493 pxa_init_gpio_chip(pxa_last_gpio); 517 pxa_init_gpio_chip(pxa_last_gpio);
494 518