Page MenuHomeFreeBSD

libgpio: Add and document gpio interrupt utility functions
ClosedPublic

Authored by devivanov_proton.me on Aug 21 2025, 7:45 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Oct 12, 1:39 AM
Unknown Object (File)
Sun, Oct 12, 1:39 AM
Unknown Object (File)
Sat, Oct 11, 4:06 PM
Unknown Object (File)
Sat, Oct 11, 7:39 AM
Unknown Object (File)
Sat, Oct 11, 7:39 AM
Unknown Object (File)
Sat, Oct 11, 7:39 AM
Unknown Object (File)
Sat, Oct 11, 7:39 AM
Unknown Object (File)
Sat, Oct 11, 7:38 AM
Subscribers

Details

Summary

Add utility functions for configuring gpio interrupts and document file operations.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

The code looks okay, just a few notes on the man page & comments. I think that the man page should document both GPIO_EVENT_REPORT_DETAIL and GPIO_EVENT_REPORT_SUMMARY.
Also adding @ziaee for review.

lib/libgpio/gpio.3
167

I think referring to the enum in sys/gpio.h here would make more sense.

171

Ditto

174–177

This should clarify that the call will fail only if the pin is configured for interrupts.
Also, gpio_configure_events can't return EINVAL.

198

These should be wrapped at 72 characters.

lib/libgpio/libgpio.h
108–110

Document GPIO_EVENT_REPORT_DETAIL and GPIO_EVENT_REPORT_SUMMARY.
Limit lines to 72 characters.
Clarify gpio_configure_events failures.
Change wording from delivery type to report type.

Looks good, although I think the header should use .In

lib/libgpio/gpio.3
187

I see that the man page uses this further up too. IMO both should be changed to use .In

This revision is now accepted and ready to land.Aug 23 2025, 6:48 PM

Change syntax for header documentation, and document return code for gpio_configure_events

This revision now requires review to proceed.Aug 24 2025, 4:25 PM

Lots of whitespace at the end of lines, check mandoc -T lint gpio.3.

lib/libgpio/gpio.3
193

One sentence per line, but not sure we should remove EINVAL.

202
217

One sentence per line, and markup O_NONBLOCK

This revision is now accepted and ready to land.Aug 29 2025, 8:33 PM