aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJani Nikula <ext-jani.1.nikula@nokia.com>2009-09-22 19:46:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 10:39:46 -0400
commita4177ee7f1a83eecb1d75e85d32664b023ef65e9 (patch)
tree614b12b1f28a1a9090d96bea33639265e3e79839 /include/linux
parentd8c1acb1664d17dd995e34507533321e986d9215 (diff)
gpiolib: allow exported GPIO nodes to be named using sysfs links
Commit 926b663ce8215ba448960e1ff6e58b67a2c3b99b (gpiolib: allow GPIOs to be named) already provides naming on the chip level. This patch provides more flexibility by allowing multiple names where ever in sysfs on a per GPIO basis. Adapted from David Brownell's comments on a similar concept: http://lkml.org/lkml/2009/4/20/203. [randy.dunlap@oracle.com: fix build for CONFIG_GENERIC_GPIO=n] Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Acked-by: David Brownell <david-b@pacbell.net> Cc: Daniel Silverstone <dsilvers@simtec.co.uk> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gpio.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index e10c49a5b96e..059bd189d35d 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -12,6 +12,8 @@
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/errno.h> 13#include <linux/errno.h>
14 14
15struct device;
16
15/* 17/*
16 * Some platforms don't support the GPIO programming interface. 18 * Some platforms don't support the GPIO programming interface.
17 * 19 *
@@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change)
89 return -EINVAL; 91 return -EINVAL;
90} 92}
91 93
94static inline int gpio_export_link(struct device *dev, const char *name,
95 unsigned gpio)
96{
97 /* GPIO can never have been exported */
98 WARN_ON(1);
99 return -EINVAL;
100}
101
102
92static inline void gpio_unexport(unsigned gpio) 103static inline void gpio_unexport(unsigned gpio)
93{ 104{
94 /* GPIO can never have been exported */ 105 /* GPIO can never have been exported */