nuttx/include/nuttx
Justin Hammond 1528b470b9 drivers/ioexpander: List the registered pins in /proc/gpio.
The pins a board publishes are visible in /dev and each can be read
through its own node, but surveying a whole board that way means an open
and two ioctls per pin, and the signal and interrupt counters the upper
half keeps are not reachable through any of them.

Adds a list of registered pins and publishes it as /proc/gpio, behind
GPIO_PROCFS: a quality of life view of the same kind as /proc/pinctrl
and /proc/reset.  Every common field comes from state the upper half
already holds: the pin type, the value through go_read(), how many times
the pin has been registered for signals, and how many interrupts it has
taken.  Lines carry the same key:value tokens in the same order, so the
file is machine parseable.

Lower halves may supply an optional go_describe() adding what only they
can say, such as which pad carries the line or how its trigger is
configured.  It writes text into a caller supplied buffer and the upper
half owns the line, so a lower half needs no procfs knowledge.  A lower
half without it is listed with the common tokens alone.

The pin type index is bounded before use: it comes from the lower half
and the name table cannot cover a type the enumeration does not define.
A pin that cannot be read reports val:- rather than a zero that would
read as a real level.

procfs_register() appends without checking for duplicates, so the entry
is claimed once for the lifetime of the system rather than whenever the
list is empty; pins come and go at run time.

The name is held in a buffer as long as the one gpio_pin_register()
accepts, so a listing always names the same string as /dev.

The pin type name table is declared without an explicit size so that the
assertion beside it compares against the enumeration and can fail; sized
as [GPIO_NPINTYPES] it would have been tautological.

Documents the entry, its tokens, and how a lower half describes a pin.

Off by default: with GPIO_PROCFS unset the list, the lock and the procfs
entry are compiled out, and go_describe() is one more member at the end
of a structure existing lower halves do not reach.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-08-19 00:46:56 +08:00
..
1wire 1wire: Move onewire_valid_rom to 1wire_crc.h 2026-06-26 22:50:43 +08:00
aie
analog drivers/analog: add MCP445X potentiometer support 2026-08-08 18:37:08 +08:00
audio drivers/audio/i2s: Fix unsigned integers in function signatures 2026-07-05 15:06:04 +08:00
binfmt binfmt: Add a configuration flag to store the module filename 2025-11-01 22:59:47 +08:00
can sja1000: replace enter_critical_section with spinlock 2026-01-08 09:15:04 -03:00
clk drivers/clk: use uintptr_t for register addresses 2026-06-18 21:52:33 +08:00
contactless
coresight
crypto drivers/crypto: add Microchip RNG90 driver 2026-06-14 18:41:09 +08:00
devfreq driver/devfreq: add procfs for devfreq 2026-08-08 15:23:54 -03:00
dma
drivers serial/uart_rpmsg: add _raw version of driver 2026-02-23 09:19:57 -03:00
eeprom drivers/eeprom: add 24CW160 support 2026-08-06 12:39:36 +02:00
efuse
fs fs: enforce path search and unify inode permission helpers 2026-08-02 18:48:40 -03:00
himem
hwspinlock
i2c drivers/i2c: add ioexpander-based lower-half implementation for I2C bit-bang 2026-01-01 17:08:47 +08:00
i3c
input drivers/input: support ST7123 touchscreen controller 2026-08-06 12:42:15 +02:00
ioexpander drivers/ioexpander: List the registered pins in /proc/gpio. 2026-08-19 00:46:56 +08:00
lcd style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
leds !drivers/pwm: remove PWM_MULTICHAN option 2026-05-18 11:35:25 -04:00
lib libc/dlfcn: Count opens so a library can be shared. 2026-08-04 11:12:49 -03:00
math drivers/math: use small lock to replace enter_critical_section 2026-01-08 11:17:17 +08:00
mbox
mm protect: move us_heap to userspace_data_s 2026-02-02 11:06:53 +08:00
modem style: fix checkpatch issues after debug.h move 2026-04-07 07:50:06 -03:00
motor
mtd drivers/mtd/gd25: add QSPI support 2026-06-21 09:43:29 -03:00
net libs/libc/netdb: Size an answer header by its header, not by its union. 2026-08-08 15:02:15 -03:00
note note/ram: support multiple noterams to dump data when panic occurs 2026-01-24 19:33:17 +08:00
nx nuttx/nx: compilation error occurs 2026-04-14 13:35:26 +08:00
pci drivers/pci:write legacy num to config space when enable legacy irq 2026-01-30 12:50:42 +08:00
pinctrl
power drivers/power: Describe the regulators through procfs. 2026-08-18 17:28:02 +08:00
rc
regmap
reset
rf
rpmsg drivers/rpmsg: use NuttX atomic_t API instead of C11 atomics 2026-05-21 06:28:36 +08:00
rptun rptun: add configuring the stack of rptun as static 2026-01-19 14:18:27 +08:00
segger
sensors sensors/tmp112: Add a uORB interface. 2026-08-18 10:35:28 -03:00
serial drivers/serial: Modify serial/pty to allow NSH/Telnet line edit 2026-07-22 22:07:18 +08:00
spi stm32h5/qspi: add QSPIMEM_QUADDATA flag for 1-1-4 transfers 2026-06-21 09:43:29 -03:00
syslog driver/ramlog: Implement the rate limiting function for ramlog driver. 2026-01-27 03:17:05 +08:00
timers drivers/timers: Add a PCF8563 RTC driver. 2026-08-18 09:29:16 -03:00
usb drivers/usbhost: Separate the xHCI driver from the PCI bus. 2026-08-18 09:35:23 -03:00
usrsock
vhost drivers/vhost: add vhost_get_vq_buffers() to collect scatter-gather buffers 2026-02-04 02:32:02 +08:00
video video/rgbcolors: Fix RGBTO8 to use the high bits of each component. 2026-08-04 21:17:48 -03:00
virtio include/nuttx/virtio: allow common virtio helpers to be used by vhost 2026-02-04 02:32:02 +08:00
wireless wireless/lpwan: add SX1301 LoRa concentrator driver 2026-08-06 13:01:39 -03:00
.gitignore
addrenv.h !sched/arch/libc: Give fork() and vfork() their real, separate semantics. 2026-08-10 08:57:30 -03:00
allsyms.h
arch.h !sched/arch/libc: Give fork() and vfork() their real, separate semantics. 2026-08-10 08:57:30 -03:00
ascii.h
atexit.h
atomic.h include/nuttx/atomic.h: fix C++ definition conflicts 2025-12-22 15:27:39 +08:00
bits.h
board.h drivers/usbhost/usbhost_enumerate.c: Allow selecting USB configuration 2026-05-06 06:20:03 +08:00
cache.h nuttx/cache.h: fix the compile warning in sim when enable OpenAMP 2025-12-31 02:36:29 +08:00
can.h
cancelpt.h sched/cancelpt: Fix MISRA C 2012 Rule 10.4 violations 2026-02-02 21:09:40 +08:00
circbuf.h
clock.h !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
clock_notifier.h fs/timerfd: implement TFD_TIMER_CANCEL_ON_SET to detect clock changes 2026-01-30 17:20:24 +08:00
compiler.h float.h: improve long double related definitions 2026-07-02 09:02:21 -03:00
coredump.h
crc8.h libs/crc: implement AUTOSAR-compatible CRC algorithm 2026-01-30 17:32:15 +08:00
crc16.h libs/crc: implement AUTOSAR-compatible CRC algorithm 2026-01-30 17:32:15 +08:00
crc32.h libc/crc32: add IEEE-compatible crc32_ieee for Linux/zlib interop 2026-07-03 10:18:28 +08:00
crc64.h !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
debug.h drivers/clk: Add debug output levels. 2026-08-16 23:23:04 +08:00
devfreq.h drivers/devfreq: Document the frequency table contract. 2026-08-18 09:46:47 -03:00
elf.h
environ.h
envpath.h
ethtool.h
event.h [!] sched/event: Remove wait object dependency from event implementation 2025-10-31 19:56:32 -03:00
fdcheck.h
fdt.h
gdbstub.h
hashtable.h
hrtimer.h sched/hrtimer: Update the comments. 2026-02-02 13:26:22 +08:00
idr.h
init.h sched: add trace points during system startup and board initialization 2026-01-27 03:18:11 +08:00
instrument.h
ipcc.h
irq.h sched/irq: Consolidate IRQ bounds checking into IRQ_TO_NDX macro 2026-01-28 13:35:30 +08:00
kmalloc.h
kthread.h
lin.h LIN:adjust the LIN flag 2026-01-08 23:15:31 +08:00
lirc.h
list.h list: Fix the list conflicts. 2026-01-19 14:12:09 +08:00
list_type.h list: Fix the list conflicts. 2026-01-19 14:12:09 +08:00
macro.h macro: use portable variadic macros 2026-01-22 22:14:00 +08:00
memoryregion.h
mmcsd.h
module.h
mqueue.h !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
mutex.h sched/pthread: move pthread mutex from syscall to user-space 2026-01-22 12:40:49 -03:00
notifier.h include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
nuttx.h
page.h style: Fix "is is" typo across the codebase. 2026-03-24 09:39:26 +08:00
panic_notifier.h
pgalloc.h
plist.h driver/devfreq: DVFS framework for devices 2026-08-08 15:23:54 -03:00
progmem.h
pthread.h pthread: move pthread_cond to userspace 2026-01-26 16:26:39 +08:00
queue.h
random.h
reboot_notifier.h
rwsem.h sched/sem_rw.c: Add downgrade_write API for sem_rw 2026-01-07 22:47:09 +08:00
sched.h sched: add supplementary group IDs (setgroups/getgroups/initgroups) 2026-08-12 16:06:03 -03:00
sched_note.h note: add NOTE_DUMP_BINARY support for binary log dumping 2026-01-27 21:56:03 +08:00
scsi.h
sdio.h drivers/mmcsd: Switch SD cards into high speed. 2026-08-18 09:38:45 +08:00
sdio_slave.h
semaphore.h sched/semaphore: Keep a negative task id out of the mutex holder. 2026-08-09 10:05:30 +08:00
seqlock.h seqlock: Fix struct name and constants. 2025-12-22 10:22:06 -03:00
signal.h
spawn.h
spinlock.h spinlock: fix ticket lock corruption in trylock and unlock 2026-08-18 10:21:51 +08:00
spinlock_type.h seqlock: Fix struct name and constants. 2025-12-22 10:22:06 -03:00
streams.h
symtab.h
tee.h
thermal.h
tls.h pthread: remove tl_lock 2026-01-26 20:56:12 +08:00
trace.h trace: fix macro line continuation formatting 2026-01-25 10:45:26 -03:00
uorb.h drivers/sensors: add initial support for fixed-point data for sensors 2026-05-02 00:56:42 +08:00
userspace.h protect: move us_heap to userspace_data_s 2026-02-02 11:06:53 +08:00
vt100.h Documentation: nsh: document the top command 2026-07-11 09:15:15 -03:00
wdog.h drivers: Fix comment typos — 'Pubic' → 'Public' across drivers and headers. 2026-07-02 13:29:48 +08:00
wqueue.h !sys/types.h: change time_t and clock_t to int64_t to align with other OSes 2026-05-19 16:21:28 +08:00
zoneinfo.h