Title: [6538] trunk/drivers/gpio/gpiolib.c: add a "toggle" option for writing the value
- Revision
- 6538
- Author
- vapier
- Date
- 2009-06-02 17:01:32 -0500 (Tue, 02 Jun 2009)
Log Message
add a "toggle" option for writing the value
Modified Paths
Diff
Modified: trunk/drivers/gpio/gpiolib.c (6537 => 6538)
--- trunk/drivers/gpio/gpiolib.c 2009-06-02 21:57:51 UTC (rev 6537)
+++ trunk/drivers/gpio/gpiolib.c 2009-06-02 22:01:32 UTC (rev 6538)
@@ -270,7 +270,12 @@
else {
long value;
- status = strict_strtol(buf, 0, &value);
+ if (sysfs_streq(buf, "toggle")) {
+ value = !gpio_get_value_cansleep(gpio);
+ status = 0;
+ } else
+ status = strict_strtol(buf, 0, &value);
+
if (status == 0) {
gpio_set_value_cansleep(gpio, value != 0);
status = size;
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits