diff options
author | Jani Nikula <ext-jani.1.nikula@nokia.com> | 2009-09-22 19:46:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 10:39:46 -0400 |
commit | a4177ee7f1a83eecb1d75e85d32664b023ef65e9 (patch) | |
tree | 614b12b1f28a1a9090d96bea33639265e3e79839 /Documentation/gpio.txt | |
parent | d8c1acb1664d17dd995e34507533321e986d9215 (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 'Documentation/gpio.txt')
-rw-r--r-- | Documentation/gpio.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index e4b6985044a2..566edaa56a53 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -555,6 +555,11 @@ requested using gpio_request(): | |||
555 | /* reverse gpio_export() */ | 555 | /* reverse gpio_export() */ |
556 | void gpio_unexport(); | 556 | void gpio_unexport(); |
557 | 557 | ||
558 | /* create a sysfs link to an exported GPIO node */ | ||
559 | int gpio_export_link(struct device *dev, const char *name, | ||
560 | unsigned gpio) | ||
561 | |||
562 | |||
558 | After a kernel driver requests a GPIO, it may only be made available in | 563 | After a kernel driver requests a GPIO, it may only be made available in |
559 | the sysfs interface by gpio_export(). The driver can control whether the | 564 | the sysfs interface by gpio_export(). The driver can control whether the |
560 | signal direction may change. This helps drivers prevent userspace code | 565 | signal direction may change. This helps drivers prevent userspace code |
@@ -563,3 +568,8 @@ from accidentally clobbering important system state. | |||
563 | This explicit exporting can help with debugging (by making some kinds | 568 | This explicit exporting can help with debugging (by making some kinds |
564 | of experiments easier), or can provide an always-there interface that's | 569 | of experiments easier), or can provide an always-there interface that's |
565 | suitable for documenting as part of a board support package. | 570 | suitable for documenting as part of a board support package. |
571 | |||
572 | After the GPIO has been exported, gpio_export_link() allows creating | ||
573 | symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can | ||
574 | use this to provide the interface under their own device in sysfs with | ||
575 | a descriptive name. | ||