aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic
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/asm-generic
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/asm-generic')
-rw-r--r--include/asm-generic/gpio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index d6c379dc64fa..9cca3785cab8 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -141,6 +141,8 @@ extern int __gpio_to_irq(unsigned gpio);
141 * but more typically is configured entirely from userspace. 141 * but more typically is configured entirely from userspace.
142 */ 142 */
143extern int gpio_export(unsigned gpio, bool direction_may_change); 143extern int gpio_export(unsigned gpio, bool direction_may_change);
144extern int gpio_export_link(struct device *dev, const char *name,
145 unsigned gpio);
144extern void gpio_unexport(unsigned gpio); 146extern void gpio_unexport(unsigned gpio);
145 147
146#endif /* CONFIG_GPIO_SYSFS */ 148#endif /* CONFIG_GPIO_SYSFS */
@@ -185,6 +187,12 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change)
185 return -ENOSYS; 187 return -ENOSYS;
186} 188}
187 189
190static inline int gpio_export_link(struct device *dev, const char *name,
191 unsigned gpio)
192{
193 return -ENOSYS;
194}
195
188static inline void gpio_unexport(unsigned gpio) 196static inline void gpio_unexport(unsigned gpio)
189{ 197{
190} 198}