mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 21:21:09 +00:00
gpiolib: allow exported GPIO nodes to be named using sysfs links
Commit 926b663ce8
(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>
This commit is contained in:
parent
d8c1acb166
commit
a4177ee7f1
4 changed files with 74 additions and 0 deletions
|
@ -12,6 +12,8 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/errno.h>
|
||||
|
||||
struct device;
|
||||
|
||||
/*
|
||||
* Some platforms don't support the GPIO programming interface.
|
||||
*
|
||||
|
@ -89,6 +91,15 @@ static inline int gpio_export(unsigned gpio, bool direction_may_change)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
static inline int gpio_export_link(struct device *dev, const char *name,
|
||||
unsigned gpio)
|
||||
{
|
||||
/* GPIO can never have been exported */
|
||||
WARN_ON(1);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
static inline void gpio_unexport(unsigned gpio)
|
||||
{
|
||||
/* GPIO can never have been exported */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue