aboutsummaryrefslogtreecommitdiff
path: root/tools/gpio/gpio-utils.h
AgeCommit message (Collapse)AuthorFilesLines
2020-09-30tools: gpio: port gpio-hammer to v2 uAPIKent Gibson1-4/+42
Port the gpio-hammer tool to the latest GPIO uAPI. Signed-off-by: Kent Gibson <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2020-09-30tools: gpio: rename nlines to num_linesKent Gibson1-3/+3
Rename nlines to num_lines to be consistent with other usage for fields describing the number of entries in an array. Signed-off-by: Kent Gibson <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-3/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Enrico Weigelt <[email protected]> Reviewed-by: Kate Stewart <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-10-24tools/gpio: add gpio basic opereationsBamvor Jian Zhang1-0/+16
Add basic gpio operations. User could get/set gpio value for specific line of gpiochip. Reference "tools/gpio/gpio-hammer.c" or "tools/testing/selftest/gpio/gpio-mockup-chardev.c" for how to use it. Signed-off-by: Bamvor Jian Zhang <[email protected]> Reviewed-by: Michael Welling <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-02-19gpio: add userspace ABI for GPIO line informationLinus Walleij1-0/+2
This adds a GPIO line ABI for getting name, label and a few select flags from the kernel. This hides the kernel internals and only tells userspace what it may need to know: the different in-kernel consumers are masked behind the flag "kernel" and that is all userspace needs to know. However electric characteristics like active low, open drain etc are reflected to userspace, as this is important information. We provide information on all lines on all chips, later on we will likely add a flag for the chardev consumer so we can filter and display only the lines userspace actually uses in e.g. lsgpio, but then we first need an ABI for userspace to grab and use (get/set/select direction) a GPIO line. Sample output from "lsgpio" on ux500: GPIO chip: gpiochip7, "8011e000.gpio", 32 GPIO lines line 0: unnamed unlabeled line 1: unnamed unlabeled (...) line 25: unnamed "SFH7741 Proximity Sensor" [kernel output open-drain] line 26: unnamed unlabeled (...) Tested-by: Michael Welling <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-02-09tools/gpio: create GPIO toolsLinus Walleij1-0/+25
This creates GPIO tools under tools/gpio/* and adds a single example program to list the GPIOs on a system. When proper devices are created it provides this minimal output: Cc: Johan Hovold <[email protected]> Cc: Michael Welling <[email protected]> Cc: Markus Pargmann <[email protected]> Signed-off-by: Linus Walleij <[email protected]>