ralink: fix c&p error in gpio driver
[openwrt.git] / target / linux / ramips / patches-3.10 / 0006-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch
index dd1aca1..ffd360a 100644 (file)
@@ -21,7 +21,7 @@ Cc: linux-gpio@vger.kernel.org
 
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -443,6 +443,7 @@ config RALINK
+@@ -444,6 +444,7 @@ config RALINK
        select SYS_HAS_EARLY_PRINTK
        select HAVE_MACH_CLKDEV
        select CLKDEV_LOOKUP
@@ -83,7 +83,7 @@ Cc: linux-gpio@vger.kernel.org
  obj-$(CONFIG_GPIO_RCAR)               += gpio-rcar.o
 --- /dev/null
 +++ b/drivers/gpio/gpio-ralink.c
-@@ -0,0 +1,337 @@
+@@ -0,0 +1,345 @@
 +/*
 + * This program is free software; you can redistribute it and/or modify it
 + * under the terms of the GNU General Public License version 2 as published
@@ -271,7 +271,7 @@ Cc: linux-gpio@vger.kernel.org
 +              if ((rg->rising | rg->falling) & mask)
 +                      return 0;
 +
-+              type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_RISING;
++              type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
 +      }
 +
 +      if (type & IRQ_TYPE_EDGE_RISING)
@@ -279,7 +279,7 @@ Cc: linux-gpio@vger.kernel.org
 +      else
 +              rg->rising &= mask;
 +
-+      if (type & IRQ_TYPE_EDGE_RISING)
++      if (type & IRQ_TYPE_EDGE_FALLING)
 +              rg->falling |= mask;
 +      else
 +              rg->falling &= mask;
@@ -337,6 +337,13 @@ Cc: linux-gpio@vger.kernel.org
 +      dev_info(rg->chip.dev, "registering %d irq handlers\n", rg->chip.ngpio);
 +}
 +
++static int ralink_gpio_request(struct gpio_chip *chip, unsigned offset)
++{
++      int gpio = chip->base + offset;
++
++      return pinctrl_request_gpio(gpio);
++}
++
 +static int ralink_gpio_probe(struct platform_device *pdev)
 +{
 +      struct device_node *np = pdev->dev.of_node;
@@ -388,6 +395,7 @@ Cc: linux-gpio@vger.kernel.org
 +      rg->chip.direction_output = ralink_gpio_direction_output;
 +      rg->chip.get = ralink_gpio_get;
 +      rg->chip.set = ralink_gpio_set;
++      rg->chip.request = ralink_gpio_request;
 +      rg->chip.to_irq = ralink_gpio_to_irq;
 +
 +      /* set polarity to low for all lines */