X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=target%2Flinux%2Framips%2Fpatches-3.10%2F0006-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch;h=fd7f7f4f030d8e50204d15e28b2bbe416b4e6a6e;hb=2b2d274bfa2fc7138423acbf2dbb53d665b1bf18;hp=cd4f38f925531752321bfc50719b086e279101cd;hpb=043edd80744308e9d1b8c0bf2213bd7a71770cb1;p=oweals%2Fopenwrt.git diff --git a/target/linux/ramips/patches-3.10/0006-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch b/target/linux/ramips/patches-3.10/0006-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch index cd4f38f925..fd7f7f4f03 100644 --- a/target/linux/ramips/patches-3.10/0006-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch +++ b/target/linux/ramips/patches-3.10/0006-GPIO-MIPS-ralink-add-gpio-driver-for-ralink-SoC.patch @@ -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,18 +271,18 @@ 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) + rg->rising |= mask; + else -+ rg->rising &= mask; ++ rg->rising &= ~mask; + -+ if (type & IRQ_TYPE_EDGE_RISING) ++ if (type & IRQ_TYPE_EDGE_FALLING) + rg->falling |= mask; + else -+ rg->falling &= mask; ++ rg->falling &= ~mask; + + return 0; +} @@ -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 */