[OpenWrt-Devel] [PATCH] Unexport GPIO fix for ramips

Sebastian Schildt schildt at ibr.cs.tu-bs.de
Wed Sep 24 09:20:43 EDT 2014


Hello there,

not sure how it works with patches in OpenWRT, so I try all channels… I noticed that unexporting GPIOs is broken on ramips (gpio-ralink.c). There is a trac issue with some more details, and I already added the patch there:

https://dev.openwrt.org/ticket/14309


Here it is again for your convenvience:

--- a/drivers/gpio/gpio-ralink.c	2014-09-23 11:06:10.044595879 +0200
+++ b/drivers/gpio/gpio-ralink.c	2014-09-23 11:11:14.063674520 +0200
@@ -258,6 +258,14 @@
 	return pinctrl_request_gpio(gpio);
 }
 
+static void ralink_gpio_free(struct gpio_chip *chip, unsigned offset)
+{
+        int gpio = chip->base + offset;
+
+        pinctrl_free_gpio(gpio);
+}
+
+
 static int ralink_gpio_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
@@ -310,6 +318,7 @@
 	rg->chip.get = ralink_gpio_get;
 	rg->chip.set = ralink_gpio_set;
 	rg->chip.request = ralink_gpio_request;
+        rg->chip.free = ralink_gpio_free;
 	rg->chip.to_irq = ralink_gpio_to_irq;
 
 	/* set polarity to low for all lines */



Obviously, it needs to be applied after te patch that creates gpio-ralink.c in the first place. 



MfG

Sebastian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4151 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20140924/26b977b7/attachment.p7s>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list