> For the complete documentation index, see [llms.txt](https://open-rt.gitbook.io/open-surfacert/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://open-rt.gitbook.io/open-surfacert/surface-rt/hardware/gpios/gpios-in-linux.md).

# GPIOs in Linux

## Getting the state of GPIO in linux

You need to add  `CONFIG_DEBUG_FS=y`into your kernel .config file.\
After that you can run `mount -t debugfs debugfs /sys/kernel/debug`\
To view the state of all the available GPIO pins type `cat /sys/kernel/debug/tegra_gpio`
