<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/gpio, branch v5.10.257</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.257</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v5.10.257'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-06-21T13:45:35+00:00</updated>
<entry>
<title>tools: gpio: fix debounce_period_us output of lsgpio</title>
<updated>2023-06-21T13:45:35+00:00</updated>
<author>
<name>Milo Spadacini</name>
<email>milo.spadacini@gmail.com</email>
</author>
<published>2023-05-08T13:18:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6be7a4bef9dc623af2dda541cf69dfed35fc18db'/>
<id>urn:sha1:6be7a4bef9dc623af2dda541cf69dfed35fc18db</id>
<content type='text'>
[ Upstream commit eb4b8eca1bad98f4b8574558a74f041f9acb5a54 ]

Fix incorrect output that could occur when more attributes are used and
GPIO_V2_LINE_ATTR_ID_DEBOUNCE is not the first one.

Signed-off-by: Milo Spadacini &lt;milo.spadacini@gmail.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: gpio: fix -c option of gpio-event-mon</title>
<updated>2023-02-01T07:23:26+00:00</updated>
<author>
<name>Ivo Borisov Shopov</name>
<email>ivoshopov@gmail.com</email>
</author>
<published>2023-01-26T13:10:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=230be65a18f8288585a8681e668a694b25ac1f67'/>
<id>urn:sha1:230be65a18f8288585a8681e668a694b25ac1f67</id>
<content type='text'>
[ Upstream commit 677d85e1a1ee69fa05ccea83847309484be3781c ]

Following line should listen for a rising edge and exit after the first
one since '-c 1' is provided.

    # gpio-event-mon -n gpiochip1 -o 0 -r -c 1

It works with kernel 4.19 but it doesn't work with 5.10. In 5.10 the
above command doesn't exit after the first rising edge it keep listening
for an event forever. The '-c 1' is not taken into an account.
The problem is in commit 62757c32d5db ("tools: gpio: add multi-line
monitoring to gpio-event-mon").
Before this commit the iterator 'i' in monitor_device() is used for
counting of the events (loops). In the case of the above command (-c 1)
we should start from 0 and increment 'i' only ones and hit the 'break'
statement and exit the process. But after the above commit counting
doesn't start from 0, it start from 1 when we listen on one line.
It is because 'i' is used from one more purpose, counting of lines
(num_lines) and it isn't restore to 0 after following code

    for (i = 0; i &lt; num_lines; i++)
        gpiotools_set_bit(&amp;values.mask, i);

Restore the initial value of the iterator to 0 in order to allow counting
of loops to work for any cases.

Fixes: 62757c32d5db ("tools: gpio: add multi-line monitoring to gpio-event-mon")
Signed-off-by: Ivo Borisov Shopov &lt;ivoshopov@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
[Bartosz: tweak the commit message]
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tools: gpio: fix %llu warning in gpio-watch.c</title>
<updated>2021-01-27T10:55:20+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2021-01-07T04:00:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5897a78fd13f16954bba64d18e48709919f81b85'/>
<id>urn:sha1:5897a78fd13f16954bba64d18e48709919f81b85</id>
<content type='text'>
commit 1fc7c1ef37f86f207b4db40aba57084bb2f6a69a upstream.

Some platforms, such as mips64, don't map __u64 to long long unsigned
int so using %llu produces a warning:

gpio-watch.c: In function ‘main’:
gpio-watch.c:89:30: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]
   89 |    printf("line %u: %s at %llu\n",
      |                           ~~~^
      |                              |
      |                              long long unsigned int
      |                           %lu
   90 |           chg.info.offset, event, chg.timestamp_ns);
      |                                   ~~~~~~~~~~~~~~~~
      |                                      |
      |                                      __u64 {aka long unsigned int}

Replace the %llu with PRIu64 and cast the argument to uint64_t.

Fixes: 33f0c47b8fb4 ("tools: gpio: implement gpio-watch")
Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tools: gpio: fix %llu warning in gpio-event-mon.c</title>
<updated>2021-01-27T10:55:20+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2021-01-07T04:00:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3fa4a03fd01e5e885621a5946764d918e32afe2a'/>
<id>urn:sha1:3fa4a03fd01e5e885621a5946764d918e32afe2a</id>
<content type='text'>
commit 2fe7c2f99440d52613e1cf845c96e8e463c28111 upstream.

Some platforms, such as mips64, don't map __u64 to long long unsigned
int so using %llu produces a warning:

gpio-event-mon.c:110:37: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64’ {aka ‘long unsigned int’} [-Wformat=]
  110 |   fprintf(stdout, "GPIO EVENT at %llu on line %d (%d|%d) ",
      |                                  ~~~^
      |                                     |
      |                                     long long unsigned int
      |                                  %lu
  111 |    event.timestamp_ns, event.offset, event.line_seqno,
      |    ~~~~~~~~~~~~~~~~~~
      |         |
      |         __u64 {aka long unsigned int}

Replace the %llu with PRIu64 and cast the argument to uint64_t.

Fixes: 03fd11b03362 ("tools/gpio/gpio-event-mon: fix warning")
Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>tools: gpio: add debounce support to gpio-event-mon</title>
<updated>2020-09-30T08:57:30+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2020-09-28T00:28:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf048e05b68789e9fa35f246f8ecbe95d79f4173'/>
<id>urn:sha1:cf048e05b68789e9fa35f246f8ecbe95d79f4173</id>
<content type='text'>
Add support for debouncing monitored lines to gpio-event-mon.

Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>tools: gpio: add multi-line monitoring to gpio-event-mon</title>
<updated>2020-09-30T08:57:27+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2020-09-28T00:28:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=62757c32d5db33fa3abb7b7b88201f9b4ecbc85b'/>
<id>urn:sha1:62757c32d5db33fa3abb7b7b88201f9b4ecbc85b</id>
<content type='text'>
Extend gpio-event-mon to support monitoring multiple lines.
This would require multiple lineevent requests to implement using uAPI v1,
but can be performed with a single line request using uAPI v2.

Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>tools: gpio: port gpio-event-mon to v2 uAPI</title>
<updated>2020-09-30T08:57:23+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2020-09-28T00:28:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0acda979df8d065f9cb16bbc723723b036697e57'/>
<id>urn:sha1:0acda979df8d065f9cb16bbc723723b036697e57</id>
<content type='text'>
Port the gpio-event-mon tool to the latest GPIO uAPI.

Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>tools: gpio: port gpio-hammer to v2 uAPI</title>
<updated>2020-09-30T08:57:20+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2020-09-28T00:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7ff6d1d25a9ea3a03f795d383889ac34fbc601d5'/>
<id>urn:sha1:7ff6d1d25a9ea3a03f795d383889ac34fbc601d5</id>
<content type='text'>
Port the gpio-hammer tool to the latest GPIO uAPI.

Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>tools: gpio: rename nlines to num_lines</title>
<updated>2020-09-30T08:57:17+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2020-09-28T00:28:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ed60aee0edcda1fabc39ab27c9650fa172f461b4'/>
<id>urn:sha1:ed60aee0edcda1fabc39ab27c9650fa172f461b4</id>
<content type='text'>
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 &lt;warthog618@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
<entry>
<title>tools: gpio: port gpio-watch to v2 uAPI</title>
<updated>2020-09-30T08:57:15+00:00</updated>
<author>
<name>Kent Gibson</name>
<email>warthog618@gmail.com</email>
</author>
<published>2020-09-28T00:28:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e86a863b337c50713b674007f74dc1854701eb93'/>
<id>urn:sha1:e86a863b337c50713b674007f74dc1854701eb93</id>
<content type='text'>
Port the gpio-watch tool to the latest GPIO uAPI.

Signed-off-by: Kent Gibson &lt;warthog618@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
</content>
</entry>
</feed>
