aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/gpio.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/gpio.txt')
-rw-r--r--Documentation/gpio.txt19
1 files changed, 17 insertions, 2 deletions
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt
index fa4dc077ae0e..1866c27eec69 100644
--- a/Documentation/gpio.txt
+++ b/Documentation/gpio.txt
@@ -380,7 +380,7 @@ rare; use gpiochip_remove() when it is unavoidable.
380 380
381Most often a gpio_chip is part of an instance-specific structure with state 381Most often a gpio_chip is part of an instance-specific structure with state
382not exposed by the GPIO interfaces, such as addressing, power management, 382not exposed by the GPIO interfaces, such as addressing, power management,
383and more. Chips such as codecs will have complex non-GPIO state, 383and more. Chips such as codecs will have complex non-GPIO state.
384 384
385Any debugfs dump method should normally ignore signals which haven't been 385Any debugfs dump method should normally ignore signals which haven't been
386requested as GPIOs. They can use gpiochip_is_requested(), which returns 386requested as GPIOs. They can use gpiochip_is_requested(), which returns
@@ -531,7 +531,14 @@ and have the following read/write attributes:
531 This file exists only if the pin can be configured as an 531 This file exists only if the pin can be configured as an
532 interrupt generating input pin. 532 interrupt generating input pin.
533 533
534GPIO controllers have paths like /sys/class/gpio/chipchip42/ (for the 534 "active_low" ... reads as either 0 (false) or 1 (true). Write
535 any nonzero value to invert the value attribute both
536 for reading and writing. Existing and subsequent
537 poll(2) support configuration via the edge attribute
538 for "rising" and "falling" edges will follow this
539 setting.
540
541GPIO controllers have paths like /sys/class/gpio/gpiochip42/ (for the
535controller implementing GPIOs starting at #42) and have the following 542controller implementing GPIOs starting at #42) and have the following
536read-only attributes: 543read-only attributes:
537 544
@@ -566,6 +573,8 @@ requested using gpio_request():
566 int gpio_export_link(struct device *dev, const char *name, 573 int gpio_export_link(struct device *dev, const char *name,
567 unsigned gpio) 574 unsigned gpio)
568 575
576 /* change the polarity of a GPIO node in sysfs */
577 int gpio_sysfs_set_active_low(unsigned gpio, int value);
569 578
570After a kernel driver requests a GPIO, it may only be made available in 579After a kernel driver requests a GPIO, it may only be made available in
571the sysfs interface by gpio_export(). The driver can control whether the 580the sysfs interface by gpio_export(). The driver can control whether the
@@ -580,3 +589,9 @@ After the GPIO has been exported, gpio_export_link() allows creating
580symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can 589symlinks from elsewhere in sysfs to the GPIO sysfs node. Drivers can
581use this to provide the interface under their own device in sysfs with 590use this to provide the interface under their own device in sysfs with
582a descriptive name. 591a descriptive name.
592
593Drivers can use gpio_sysfs_set_active_low() to hide GPIO line polarity
594differences between boards from user space. This only affects the
595sysfs interface. Polarity change can be done both before and after
596gpio_export(), and previously enabled poll(2) support for either
597rising or falling edge will be reconfigured to follow this setting.