summaryrefslogtreecommitdiff
path: root/doc/device-tree-bindings/gpio/gpio.txt
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2019-07-29 11:51:17 -0400
committerTom Rini <trini@konsulko.com>2019-07-29 11:51:17 -0400
commit2d64a0f7e952f54375702fb2b854461e402ded9d (patch)
tree591a1592b29de743bb52895ebb098ebc8b00f57a /doc/device-tree-bindings/gpio/gpio.txt
parent92430b8fc8aac3b4ab92e9ca8a09d83c4788c609 (diff)
parentf043dc28e3cce115089fb9ab86bc6f4bc4a8a882 (diff)
Merge branch '2019-07-29-master-imports'
- Assorted bug fixes
Diffstat (limited to 'doc/device-tree-bindings/gpio/gpio.txt')
-rw-r--r--doc/device-tree-bindings/gpio/gpio.txt17
1 files changed, 11 insertions, 6 deletions
diff --git a/doc/device-tree-bindings/gpio/gpio.txt b/doc/device-tree-bindings/gpio/gpio.txt
index e774439369..e146917ff3 100644
--- a/doc/device-tree-bindings/gpio/gpio.txt
+++ b/doc/device-tree-bindings/gpio/gpio.txt
@@ -252,6 +252,7 @@ Example:
boot_rescue {
gpio-hog;
input;
+ line-name = "foo-bar-gpio";
gpios = <7 GPIO_ACTIVE_LOW>;
};
};
@@ -259,9 +260,13 @@ Example:
For the above Example you can than access the gpio in your boardcode
with:
- desc = gpio_hog_lookup_name("boot_rescue.gpio-hog");
- if (desc) {
- if (dm_gpio_get_value(desc))
- printf("\nBooting into Rescue System\n");
- else
- printf("\nBoot normal\n");
+ struct gpio_desc *desc;
+ int ret;
+
+ ret = gpio_hog_lookup_name("boot_rescue", &desc);
+ if (ret)
+ return;
+ if (dm_gpio_get_value(desc) == 1)
+ printf("\nBooting into Rescue System\n");
+ else if (dm_gpio_get_value(desc) == 0)
+ printf("\nBoot normal\n");