aboutsummaryrefslogtreecommitdiff
path: root/tools/gpio/gpio-hammer.c
AgeCommit message (Collapse)AuthorFilesLines
2020-09-30tools: gpio: port gpio-hammer to v2 uAPIKent Gibson1-12/+20
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-13/+13
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]>
2020-03-25tools: gpio-hammer: Apply scripts/Lindent and retain good changesGabriel Ravier1-1/+1
"retain good changes" means that I left the help string split up instead of having this weird thing where it tries to merge together the last three lines and it looks **really** bad Signed-off-by: Gabriel Ravier <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2020-03-25tools: gpio-hammer: fix spelling mistake: "occurences" -> "occurrences"Colin Ian King1-1/+1
There is a spelling mistake in an error message. Fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2020-03-25tools: gpio-hammer: Avoid potential overflow in mainGabriel Ravier1-1/+16
If '-o' was used more than 64 times in a single invocation of gpio-hammer, this could lead to an overflow of the 'lines' array. This commit fixes this by avoiding the overflow and giving a proper diagnostic back to the user Signed-off-by: Gabriel Ravier <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-4/+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]>
2017-01-26gpio-hammer: fix make consumer_label suitable to work on gpio-nailsUwe Kleine-König1-1/+1
There are no gpio-nalils, so fix label accordingly. Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-10-24tools/gpio: re-work gpio hammer with gpio operationsBamvor Jian Zhang1-50/+17
Signed-off-by: Bamvor Jian Zhang <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2016-06-15tools/gpio: add the gpio-hammer toolLinus Walleij1-0/+189
The gpio-hammer is used from userspace as an example of how to retrieve a GPIO handle for one or several GPIO lines and hammer the outputs from low to high and back again. It will pulse the selected lines once per second for a specified number of times or indefinitely if no loop count is supplied. Example output: $ gpio-hammer -n gpiochip0 -o5 -o6 -o7 Hammer lines [5, 6, 7] on gpiochip0, initial states: [1, 1, 1] [-] [5: 0, 6: 0, 7: 0] Tested-by: Michael Welling <[email protected]> Signed-off-by: Linus Walleij <[email protected]>