Search by Tags

GPIO (Linux)


Article updated at 24 Oct 2019
Compare with Revision

Subscribe for this article updates

Please note that Pin configuration/muxing is a non-trivial part of the overall system design. It is easily possible to do illegal configurations when it comes to multiplexed pins (e.g. one pin driving low and the other one driving high). Even more though on SoCs where certain settings in this respect cannot be done per pin but rather only per pin group.

GPIO Char Device API - libgpiod

Since the long famous sysfs GPIO interface (/sys/class/gpio) has been deprecated, the GPIO Char Device API, also known as libgpiod has been adopted by the Linux kernel community as the replacement.


Torizon is preferred for using libgpiod, due to ease-of-use and a smoother application development experience. Visit the article below for instructions how to use it:

Embedded Linux BSP 3.0 Onwards

Though libgpiod is supported and can be used on Embedded Linux BSP 3.0, the user space tools and libraries are not provided in our evaluation image, therefore you need to do a custom Yocto build to add them.


The Toradex GPIO tool can be used to read the current pin configuration or to temporally change the pin configuration and GPIO state. It can either be started from the launcher on the desktop or through the command line as follows:

root@colibri_t20:~$ GPIOConfig

  • Toradex GPIOConfig utility

    Toradex GPIOConfig utility

GPIO Sysfs

Warning: The GPIO sysfs is deprecated and has been discontinued. Its use for BSP 3.0 is discouraged and will be removed. For Torizon use the new char device API and LIBGPIOD libraries and tools. See the GPIO Char Device API - libgpiod article for reference.

To use pins other than the already exported ones directly from user space through sysfs they first have to be exported as GPIOs.

Warning: For i.MX 6 based modules you need to make sure that the pin is actually muxed as a GPIO in the device-tree or platform data. Failing to do so will not give any error. The pin will simply report 0 if configured as an input and not react to any state change if configured as an output.

Note: Use the module datasheet to find what SoC pin(s) are routed to what module edge connector pin and the carrier board datasheet or schematic to find where those signals go to.

Note: E.g. the Tegra SoC defines GPIOs with an alphanumeric term, e.g. X5 but the Linux kernel uses a numeric-only representation in its GPIO subsystem and in the sysfs interface to the GPIO functionality.

Note: The relationship between SOC GPIO names and the 'magic' numbers used here can be found on this page.

In the following example, we are going to use SODIMM pin 100 of a Colibri T20. This makes for the following relationship:

SoC Pin
Function Name
Kernel GPIO
Evaluation Board
100 nPXCVREN SPI1_SCK X5 189 X9. 7

To export a particular pin as GPIO for user control proceed as follows:

$ echo 189 > /sys/class/gpio/export

To change that GPIO pins direction to in/out:

$ echo "in" > /sys/class/gpio/gpio189/direction


$ echo "out" > /sys/class/gpio/gpio189/direction

To check the value (in case its direction is input):

Warning: On i.MX based modules one cannot read back the value which has been set to an output unless one did set the SION bit in the pin muxing.

$ cat /sys/class/gpio/gpio189/value

To change its value (in case its direction is output):

$ echo 1 > /sys/class/gpio/gpio189/value


$ echo 0 > /sys/class/gpio/gpio189/value

To directly force a GPIO to output and set its initial value (e.g. glitch free operation):

$ echo high > /sys/class/gpio/gpio189/direction


$ echo low > /sys/class/gpio/gpio189/direction

To configure a GPIO as an interrupt source:

Note: If a GPIO is configured as an input, one can configure the GPIO as an interrupt source. Configure GPIO if the interrupt occurs when the GPIO signal has a rising edge, a falling edge, or interrupts on both rising and falling edges.

$ echo "rising" > /sys/class/gpio/gpio189/edge

Possible values

  • rising: Trigger on rising edge
  • falling: Trigger on falling edge
  • both: Trigger on both edges
  • none: Disable interrupts on both edges

To un-export aka revert the exporting of a GPIO pin:

$ echo 189 > /sys/class/gpio/unexport

Warning: GPIOs which are already used in the drivers can not be controlled from sysfs, unless a driver explicitly exported that particular pins GPIO.

More information concerning the Linux' GPIO subsystem can be found in the following kernel documentation file:

GPIO Libsoc

Warning: Libsoc is deprecated on Toradex BSPs - this section is kept only for reference. Its use for BSP 3.0 is discouraged and will be removed. For Torizon use the new char device API and LIBGPIOD libraries and tools. See the GPIO Char Device API - libgpiod article for reference.

Libsoc is a C library to interface with common peripherals found in System on Chips (SoC) through generic Linux Kernel interfaces. Libsoc is integrated with Embedded Linux BSP starting from release 2.8b3. The Sysfs GPIO access is file-based and Libsoc userspace library uses the sysfs gpio interface. Please refer to for more information.

Note: When using Libsoc instead of Sysfs GPIO directly the mapping from SoC GPIO representation to Linux GPIO number is abstracted, therefore inside a Toradex Computer on Module family (e.g Colibri or Apalis) the GPIO number corresponds to the CoM edge connector (i.e. SODIMM or MXM3) pin number, making the application more easily portable between modules (e.g. Apalis iMX6 and Apalis T30).

Cross-compiling Libsoc examples

Build and install the OE-core aka Yocto SDK in your host machine. For instructions related to building and installing the SDK, have a look at the Linux SDKs knowledge-base article.

Examples are provided below. To cross-compile:

cd ~/
git clone
cd libsoc-examples
cd io-ctrl
MACHINE=colibri-vf make

For available machines, have a look in Makefile, e.g.:

cat Makefile | grep MACHINE

Copy the binary to the target via ssh and run the example. E.g.:

scp ~/libsoc-examples/io-ctrl/io root@<target-board-ip-address>:/home/root/

Cross-compiling Libsoc

If you are using an Embedded Linux BSP aka Linux image prior to 2.8b3 then you have to build Libsoc and deploy to the device.

Please refer to /libsoc/contrib/board-files/ path to get conf file name. E.g.:

cd ~/
git clone
ls libsoc/contrib/board_files/ | grep -i -e apalis -e colibri

For instance, for Apalis iMX6 the board in Libsoc is apalis-imx6. For Colibri iMX7 512MB it is colibri-imx7-512mb and so on.

The example below is provided for Colibri VF61:

$ cd libsoc
$ . /usr/local/oecore-x86_64/environment-setup-armv7at2hf-neon-angstrom-linux-gnueabi
$ echo $CC
arm-angstrom-linux-gnueabi-gcc -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard --sysroot=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi
$ autoreconf -i
$ ./configure --host=arm-angstrom-linux-gnueabi --prefix=/usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/ --enable-board=colibri-vf61 --with-board-configs
$ MACHINE=colibri-vf make -j3
$ sudo make install

Note: If you are building for Colibri iMX7 then modify MACHINE=colibri-imx7 make -j3.

Deploy the library and conf file to the target via ssh and run the example:

scp /usr/local/oecore-x86_64/sysroots/armv7at2hf-neon-angstrom-linux-gnueabi/usr/lib/ root@<target-board-ip-address>:/home/root/usr/libs
scp ./contrib/board_files/colibri-vf.conf root@<target-board-ip-address>:/home/root/etc/libsoc.conf

GPIO Power Management Keys

Linux systems use key events to initiate a clean shutdown or suspend-to-memory sequence. On a typical PC, pressing the power button generates a key event which will lead to a shutdown of the system. For an embedded system, a GPIO with a key code assigned can be used to trigger key events. When the key is pressed (GPIO triggered), the system will initiate the sequence.

The systemd service systemd-logind is the user-space program listening to key events (if they are tagged with the string "power-switch", see below). Four key codes are supported:

  • KEY_POWER = initiate shutdown
  • KEY_POWER2 = initiate shutdown
  • KEY_SLEEP = suspend-to-ram, commonly known as "suspend"
  • KEY_SUSPEND = suspend-to-disk, commonly known as "hibernate"

There are two steps required:

  1. Declare a GPIO as an input device and assign a key code using the GPIO keyboard driver
  2. Use a udev rule to tag the GPIO input device

GPIO Keyboard Driver

For device tree enabled kernels, a node as follows can be used in the carrier board device tree file:

gpio-keys {
    compatible = "gpio-keys";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_gpiokeys>;
    power {
            label = "Power-Key";
            gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
            linux,code = <KEY_POWER>;
            debounce-interval = <10>;

For details on how to customise the device tree refer to the Device Tree Customization article.

For Apalis T30, the predefined macro POWER_GPIO in the board file can be enabled to enable the power key code (see this commit). For the Colibri T20/T30 boards a similar approach can be adopted.

For Colibri T30, the example below enables SODIMM Pin 162 as a suspend pin

diff --git a/arch/arm/mach-tegra/board-colibri_t30.c b/arch/arm/mach-tegra/board-colibri_t30.c
index 7265d8d..2c4079e 100644
--- a/arch/arm/mach-tegra/board-colibri_t30.c
+++ b/arch/arm/mach-tegra/board-colibri_t30.c
@@ -394,7 +394,7 @@ static struct gpio colibri_t30_gpios[] = {
 // {TEGRA_GPIO_PN3,    GPIOF_IN,   "SODIMM pin 180"},
 // {TEGRA_GPIO_PN4,    GPIOF_IN,   "SODIMM pin 160"},
 // {TEGRA_GPIO_PN5,    GPIOF_IN,   "SODIMM pin 158"},
-   {TEGRA_GPIO_PN6,    GPIOF_IN,   "SODIMM pin 162"},
+// {TEGRA_GPIO_PN6,    GPIOF_IN,   "SODIMM pin 162"},
 //conflicts with ADDRESS13
 // {TEGRA_GPIO_PP4,    GPIOF_IN,   "SODIMM pin 120"},
 //conflicts with ADDRESS14
@@ -668,6 +668,7 @@ static struct gpio_keys_button colibri_t30_keys[] = {
    GPIO_KEY(KEY_POWER, PV1, 0, 1),     /* SODIMM pin 45,
                           Iris X16-20 */
    GPIO_KEY(KEY_MENU, PK6, 1, 0),      /* SODIMM pin 135 */
+   GPIO_KEY(KEY_SLEEP, PN6, 0, 0),     /* SODIMM pin 162 */
 static struct gpio_keys_platform_data colibri_t30_keys_platform_data = {

Tag the GPIO Input Device

Use a udev rule to add the power-switch tag to the GPIO key event source. Store the file in a udev rules directory, e.g. /etc/udev/rules.d/power-key.rules

ACTION=="remove", GOTO="power_switch_end"

SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_PATH}=="platform-gpio-keys*", ATTRS{keys}=="*", TAG+="power-switch" 

With that, all key codes get tagged as power-switch events, and systemd will interpret the relevant key codes. The exact behaviour can be fine tuned through HandlePowerKey/HandleSuspendKey and HandleHibernateKey in /etc/systemd/logind.conf.

GPIO Power-Off

To power off a system completely after shutdown, often a GPIO is needed to switch off the system. Newer Kernel provides a specific GPIO power-off driver to achieve this.

Our Colibri and Apalis Evaluation Carrier Boards have a push button power on/off controller (LTC2954) which has a GPIO input FORCE_OFF# (X4-5 on Colibri or X61-5 on Apalis). This signal makes sure that the DC-DC converter on the carrier board are switched-off completely as if the user pressed the on/off button. After connecting these signal to a GPIO, the GPIO power-off driver needs to be enabled. On device-tree based kernels (e.g. Colibri/Apalis iMX6 and Colibri VF50/VF61), the driver CONFIG_POWER_RESET_GPIO need to be enabled (up to v2.3Beta5 this is not the case by default). Furthermore, on Colibri VF50/VF61 using V2.7 and newer releases the default power off method needs to be disabled by reverting commit ARM: vf610: PM: register power_off function. Finally, a new node needs to be added which specifies the GPIO to switch power off. This example uses SO-DIMM 135 (EXT_IO_0) as power-off GPIO for Colibri VF50/VF61 modules:

gpio-poweroff {
    compatible = "gpio-poweroff";
    gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;

The poweroff command needs to be used to power-off the system completely ("halt" does not work):

# poweroff

For Apalis T30, the predefined macro FORCE_OFF_GPIO in the board file can be enabled (see this commit). For the Colibri T20/T30 boards a similar approach can be adopted.

For i.MX6 based modules CONFIG_POWER_RESET_GPIO must be set in the kernel configuration. Additionally, for the 3.10.17 kernel version you will have to at least cherry-pick this commit or use the toradex_imx_3.10.17_1.0.0_ga-next branch.


The GPIO LED driver allows using a GPIO to control a LED. Using the Kernels LED driver framework has the advantage that triggers can be specified, which allow using an LED as a visual activity signal for various system activities.

leds {
    compatible = "gpio-leds";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_gpio_leds>;

    led0: user1 {
        label = "user1";
        gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>; /* SODIMM 103 */
        default-state = "off";
        linux,default-trigger = "mmc0";
pinctrl_gpio_leds: gpioleds {
    fsl,pins = <
        VF610_PAD_PTC3__GPIO_48         0x2180

You can also get a list of valid triggers (and configure the active trigger) through the sysfs file at /sys/class/leds/user1/trigger.


One can also access GPIOs from U-Boot. This allows to implement functionality such as “Press button X and turn the device ON to upgrade firmware” using U-Boot scripts.

The GPIO driver can be used from within the U-Boot source code. Additionally, the GPIO driver has a corresponding gpio command line interface that can be used to set and get GPIO values. Note that for the command line interface to work the corresponding pin must be muxed to its GPIO functionality in the U-Boot code.

On a Colibri VF accesses from code allow to set a GPIO around 40ms, access from the command line interface in 'bootcmd' 70ms after power up.

Note: The relationship between SOC GPIO names and the 'magic' numbers used here can be found on this page.

Command Line Interface

# gpio help
gpio - query and control gpio pins

    - input/set/clear/toggle the specified pin
gpio status [-a] [ | ]  - show [all/claimed] GPIOs

To set the GPIO:

# gpio set [gpio-number]

To clear the GPIO

# gpio clear [gpio-number]

To toggle the GPIO

# gpio toggle [gpio-number]

To read the state of GPIO:

# gpio input [gpio-number]

To clear GPIO #22 (Backlight PWM configured as GPIO on a Colibri VF) do:

# gpio out 22

To read GPIO #10 (UART A, DTR on a Colibri VF) do:

Colibri VFxx # gpio input 10
gpio: pin 10 (gpio 10) value is 0

To read GPIO #10 (UART A, DTR on a Colibri VF) and react on the read value do:

Colibri VFxx # if gpio input 10 ; then echo "commands for 0" ; else echo "commands for 1" ; fi
gpio: pin 10 (gpio 10) value is 0
commands for 0

From Source Code

To access a GPIO earlier than what would be possible from the U-Boot command line or to include it in an algorithm written in source code using the GPIO API. In most cases this code would live in the board file (e.g. board/toradex/colibri_vf/colibri_vf.c).

The GPIO's need to be configured only after the GPIO driver is loaded, if a GPIO gets configured before the driver has been loaded, the GPIO functions will have no effect. The 'board_init' function is called just after GPIO initialization and hence is an appropriate place to configure custom GPIO's.

e.g. To set GPIO_10 during boot from board file:

 diff --git i/board/toradex/colibri_vf/colibri_vf.c w/board/toradex/colibri_vf/colibri_vf.c
 index 3272733..ca30af8 100644
 --- i/board/toradex/colibri_vf/colibri_vf.c
 +++ w/board/toradex/colibri_vf/colibri_vf.c
 @@ -478,6 +483,11 @@ int board_init(void)
         setbits_le32(&scsc->sosc_ctr, SCSC_SOSC_CTR_SOSC_EN);
 +       gpio_request(10, "SODIMM_PIN_23");
 +       gpio_direction_output(10, 1);

GPIO Debugging

All "free" Pins are configured as GPIOs by default and are already exported from within the board specific platform configuration to be used from user space through the sysfs interface.

To know what GPIOs are currently exported from the platform configuration resp. requested from drivers proceed as follows:

$ cat /sys/kernel/debug/gpio

Apalis iMX8QM

apalis-imx8-06438744:/# cat /sys/kernel/debug/gpio
gpiochip7: GPIOs 256-287, parent: platform/5d0f0000.gpio, 5d0f0000.gpio:

gpiochip6: GPIOs 288-319, parent: platform/5d0e0000.gpio, 5d0e0000.gpio:

gpiochip5: GPIOs 320-351, parent: platform/5d0d0000.gpio, 5d0d0000.gpio:
 gpio-320 (                    |reset               ) out hi    

gpiochip4: GPIOs 352-383, parent: platform/5d0c0000.gpio, 5d0c0000.gpio:
 gpio-356 (                    |VCC_USBH(2A|2C|2D|3|) out hi    
 gpio-364 (                    |cd                  ) in  hi IRQ
 gpio-379 (                    |ref-clock           ) out hi    

gpiochip3: GPIOs 384-415, parent: platform/5d0b0000.gpio, 5d0b0000.gpio:
 gpio-412 (                    |GPIO fan control    ) out hi    

gpiochip2: GPIOs 416-447, parent: platform/5d0a0000.gpio, 5d0a0000.gpio:
 gpio-425 (                    |cd                  ) in  hi IRQ
 gpio-436 (                    |Wake-Up             ) in  hi IRQ

gpiochip1: GPIOs 448-479, parent: platform/5d090000.gpio, 5d090000.gpio:
 gpio-449 (                    |usb3503 intn        ) out lo    
 gpio-450 (                    |usb3503 reset       ) out hi    
 gpio-452 (                    |enable              ) out hi    
 gpio-459 (                    |phy-reset           ) out hi    
 gpio-478 (                    |HDMI_CTRL           ) out hi    

gpiochip0: GPIOs 480-511, parent: platform/5d080000.gpio, 5d080000.gpio:
 gpio-511 (                    |usb3503 connect     ) out hi    

Apalis T30

root@apalis-t30:~# cat /sys/kernel/debug/gpio 
GPIOs 0-255, tegra-gpio:
 gpio-6   (Just for testing    ) in  lo
 gpio-26  (THERMD_ALERT_N      ) in  hi
 gpio-68  (RESET_MOCI_N        ) out hi
 gpio-111 (HDMI1_HPD           ) in  lo
 gpio-128 (GPIO6 X1-11         ) in  lo
 gpio-129 (GPIO8 X1-15, FAN    ) in  lo
 gpio-146 (GPIO1 X1-1          ) in  lo
 gpio-147 (GPIO2 X1-3          ) in  lo
 gpio-148 (GPIO3 X1-5          ) in  lo
 gpio-149 (GPIO4 X1-7          ) in  lo
 gpio-150 (GPIO5 X1-9          ) in  lo
 gpio-151 (PEX_PERST_N         ) out hi
 gpio-168 (TOUCH_PEN_INT       ) in  hi
 gpio-169 (KEY_POWER           ) in  hi
 gpio-170 (BKL1_ON             ) out hi
 gpio-171 (sdhci_cd            ) in  hi
 gpio-216 (LVDS: Single/Dual Ch) out lo
 gpio-219 (LVDS: 18/24 Bit Mode) out hi
 gpio-220 (LVDS: Output Enable ) out hi
 gpio-221 (LVDS: Power Down    ) out hi
 gpio-222 (LVDS: Clock Polarity) out hi
 gpio-223 (LVDS: Colour Mapping) out hi
 gpio-225 (LVDS: Swing Mode    ) out hi
 gpio-226 (LVDS: DDRclk Disable) out hi
 gpio-229 (sdhci_cd            ) in  hi
 gpio-232 (SATA1_ACT_N         ) out hi
 gpio-233 (usb_host_vbus       ) out hi

GPIOs 256-264, i2c/4-002d, tps6591x, can sleep:
 gpio-262 (fixed_reg_en_hdmi   ) out hi

Apalis TK1

root@apalis-tk1:~# cat /sys/kernel/debug/gpio 
GPIOs 0-255, platform/6000d000.gpio, tegra-gpio:
 gpio-63  (+V1.05_AVDD_HDMI_PLL) out lo
 gpio-70  (temp_alert          ) in  hi
 gpio-108 (VCC_USBO1           ) out lo
 gpio-109 (VCC_USBH(2A|2C|2D|3|) out hi
 gpio-111 (hdmi_hpd            ) in  hi
 gpio-146 (LAN_RESET_N         ) out hi
 gpio-164 (RESET_MOCI_N        ) out hi
 gpio-170 (sdhci_cd            ) in  hi
 gpio-171 (sdhci_cd            ) in  hi
 gpio-221 (BKL1_ON             ) out hi
 gpio-233 (PEX_PERST_N         ) out hi
 gpio-235 (WAKE1_MICO          ) in  hi

GPIOs 1016-1023, platform/as3722-pinctrl, as3722-gpio, can sleep:
 gpio-1018 (+V3.3               ) out hi

Apalis iMX6

root@apalis-imx6:~# cat /sys/kernel/debug/gpio
GPIOs 0-31, platform/209c000.gpio, 209c000.gpio:
 gpio-0   (usb_host_vbus       ) out lo
 gpio-2   (PCIe reset          ) out lo
 gpio-4   (Wake-Up             ) in  hi
 gpio-6   (sysfs               ) in  lo
 gpio-25  (phy-reset           ) out lo
 gpio-28  (PCIe EP reset       ) out lo

GPIOs 32-63, platform/20a0000.gpio, 20a0000.gpio:
 gpio-36  (sysfs               ) in  lo
 gpio-37  (sysfs               ) in  lo
 gpio-38  (sysfs               ) in  lo
 gpio-39  (sysfs               ) in  lo
 gpio-58  (spi_imx             ) out lo
 gpio-62  (scl                 ) in  hi

GPIOs 64-95, platform/20a4000.gpio, 20a4000.gpio:
 gpio-80  (sda                 ) in  hi
 gpio-86  (usb_otg_vbus        ) out lo
 gpio-92  (usb_host_vbus_hub   ) out lo

GPIOs 96-127, platform/20a8000.gpio, 20a8000.gpio:
 gpio-116 (cd                  ) in  hi

GPIOs 128-159, platform/20ac000.gpio, 20ac000.gpio:
 gpio-153 (spi_imx             ) out lo

GPIOs 160-191, platform/20b0000.gpio, 20b0000.gpio:
 gpio-174 (cd                  ) in  hi

GPIOs 192-223, platform/20b4000.gpio, 20b4000.gpio:

Colibri T20

root@colibri_t20:~# cat /sys/kernel/debug/gpio
GPIOs 0-223, tegra-gpio:
 gpio-0   (SODIMM pin 73       ) in  hi
 gpio-2   (SODIMM pin 186      ) in  lo
 gpio-3   (SODIMM pin 184      ) in  lo
 gpio-10  (SODIMM pin 154      ) out hi
 gpio-13  (sysfs               ) out hi
 gpio-14  (SODIMM pin 55       ) in  hi
 gpio-15  (SODIMM pin 63       ) in  hi
 gpio-22  (sysfs               ) out hi
 gpio-23  (sdhci4_cd           ) in  hi irq-215 edge-both
 gpio-29  (SODI-98, Iris X16-13) in  lo
 gpio-67  (SODIMM pin 130      ) in  hi
 gpio-68  (SODIMM pin 87       ) in  hi
 gpio-70  (SODIMM pin 132      ) in  hi
 gpio-80  (SODIMM pin 150      ) in  lo
 gpio-81  (SODIMM pin 152      ) in  lo
 gpio-84  (SODIMM pin 106      ) in  lo
 gpio-88  (SOD-101, Iris X16-16) in  lo
 gpio-89  (SOD-103, Iris X16-15) in  lo
 gpio-90  (SODI-79, Iris X16-19) in  lo
 gpio-91  (SODI-97, Iris X16-17) in  lo
 gpio-94  (SODI-85, Iris X16-18) in  lo
 gpio-104 (SODIMM pin 174      ) in  lo
 gpio-105 (SODIMM pin 176      ) in  lo
 gpio-106 (SODIMM pin 178      ) in  lo
 gpio-107 (SODIMM pin 180      ) in  lo
 gpio-108 (SODIMM pin 160      ) in  lo
 gpio-109 (SODIMM pin 158      ) in  lo
 gpio-110 (SODIMM pin 162      ) in  lo
 gpio-111 (sysfs               ) in  hi irq-303 edge-both
 gpio-124 (SODIMM pin 120      ) in  lo
 gpio-125 (SODIMM pin 122      ) in  lo
 gpio-126 (SODIMM pin 124      ) in  lo
 gpio-127 (SODIMM pin 188      ) in  lo
 gpio-144 (nand_wp             ) out hi
 gpio-154 (SODIMM pin 69       ) in  lo
 gpio-155 (SODIMM pin 77       ) in  lo
 gpio-156 (BL_ON               ) out hi
 gpio-166 (SODIMM pin 118      ) in  lo
 gpio-168 (WOLFSON_RESET       ) out hi
 gpio-169 (ulpi_phy_reset_b    ) out hi
 gpio-171 (SODI-45, Iris X16-20) in  lo
 gpio-172 (ethernet_reset      ) out hi
 gpio-176 (sysfs               ) out hi
 gpio-178 (VBUS_BUS            ) out lo
 gpio-184 (SODIMM pin 142      ) in  lo
 gpio-185 (SODIMM pin 140      ) in  lo
 gpio-186 (SODIMM pin 138      ) in  lo
 gpio-187 (SODIMM pin 136      ) in  lo
 gpio-188 (SODIMM pin 134      ) in  lo
 gpio-190 (102, I X13 ForceOFF#) in  hi
 gpio-191 (104, I X14 ForceOFF#) in  hi
 gpio-202 (SODIMM pin 156      ) in  lo
 gpio-204 (SODIMM pin 164      ) in  lo
 gpio-212 (SODIMM pin 166      ) in  lo
 gpio-213 (SODIMM pin 168      ) in  lo
 gpio-214 (SODIMM pin 170      ) in  lo
 gpio-215 (SODIMM pin 172      ) in  lo
 gpio-217 (ethernet_vbus       ) out hi
 gpio-218 (SOD-133, Iris X16-14) in  lo
 gpio-219 (SODIMM pin 127      ) in  lo
 gpio-220 (SODIMM pin 22       ) in  lo

GPIOs 224-227, i2c/4-0034, tps6586x, can sleep:

Colibri T30

root@colibri-t30:~# cat /sys/kernel/debug/gpio
GPIOs 0-255, tegra-gpio:
 gpio-10  (SODIMM pin 154      ) in  lo
 gpio-17  (SODIMM pin 81       ) in  lo
 gpio-23  (sdhci_cd            ) in  hi
 gpio-26  (THERMD_ALERT        ) in  hi
 gpio-67  (SODIMM pin 130      ) in  lo
 gpio-70  (SODIMM pin 132      ) in  lo
 gpio-85  (USBC_DET            ) in  hi
 gpio-86  (KEY_MENU            ) in  lo
 gpio-110 (SODIMM pin 162      ) in  lo
 gpio-111 (hdmi_hpd            ) in  lo
 gpio-144 (SODIMM pin 73       ) in  hi
 gpio-153 (EN_MIC_GND          ) out hi
 gpio-157 (KEY_BACK            ) in  hi
 gpio-158 (KEY_HOME            ) in  hi
 gpio-168 (TOUCH_PEN_INT       ) in  hi
 gpio-169 (KEY_POWER           ) in  lo
 gpio-170 (BL_ON               ) out hi
 gpio-171 (SODI-85, Iris X16-18) in  hi
 gpio-178 (usb_host_vbus       ) out lo
 gpio-181 (SODIMM pin 75       ) in  lo
 gpio-188 (SODIMM pin 134      ) in  lo
 gpio-190 (102, I X13 ForceOFF#) in  lo
 gpio-191 (104, I X14 ForceOFF#) in  lo
 gpio-220 (SODIMM pin 166      ) in  lo
 gpio-221 (SODIMM pin 168      ) in  lo
 gpio-222 (SODIMM pin 170      ) in  lo
 gpio-223 (SODIMM pin 172      ) in  lo
 gpio-226 (KEY_FIND            ) in  hi
 gpio-230 (KEY_VOLUMEDOWN      ) in  hi
 gpio-231 (SODIMM pin 94       ) in  hi
 gpio-232 (LAN_RESET           ) out hi
 gpio-234 (LAN_V_BUS           ) out hi
 gpio-237 (SODIMM pin 69       ) in  hi
 gpio-238 (SODIMM pin 65       ) in  hi
 gpio-239 (KEY_VOLUMEUP        ) in  hi

GPIOs 256-264, i2c/4-002d, tps6591x, can sleep:
 gpio-262 (fixed_reg_en_hdmi   ) out lo

Colibri iMX7

root@colibri-imx7:~# cat /sys/kernel/debug/gpio 
GPIOs 0-31, platform/30200000.gpio, 30200000.gpio:
 gpio-0   (cd                  ) in  lo    
 gpio-1   (Wake-Up             ) in  lo    

GPIOs 32-63, platform/30210000.gpio, 30210000.gpio:

GPIOs 64-95, platform/30220000.gpio, 30220000.gpio:

GPIOs 96-127, platform/30230000.gpio, 30230000.gpio:
 gpio-103 (VCC_USB[1-4]        ) out lo    
 gpio-107 (spi_imx             ) out lo    

GPIOs 128-159, platform/30240000.gpio, 30240000.gpio:
 gpio-129 (enable              ) out lo    

GPIOs 160-191, platform/30250000.gpio, 30250000.gpio:

GPIOs 192-223, platform/30260000.gpio, 30260000.gpio:
 gpio-206 (id                  ) in  lo    

Colibri VF50

root@colibri-vf:~# cat /sys/kernel/debug/gpio 
GPIOs 0-31, platform/40049000.gpio, vf610-gpio:
 gpio-4   (ym                  ) out hi    
 gpio-8   (pen-detect          ) in  hi IRQ
 gpio-12  (yp                  ) out hi    
 gpio-13  (xp                  ) out hi    

GPIOs 32-63, platform/4004a000.gpio, vf610-gpio:
 gpio-41  (Wake-Up             ) in  hi IRQ
 gpio-42  (cd                  ) in  lo    
 gpio-45  (backlight           ) out hi    

GPIOs 64-95, platform/4004b000.gpio, vf610-gpio:
 gpio-83  (usbh_vbus           ) out lo    
 gpio-93  (xm                  ) out lo    

GPIOs 96-127, platform/4004c000.gpio, vf610-gpio:
 gpio-102 (id                  ) in  hi IRQ

GPIOs 128-159, platform/4004d000.gpio, vf610-gpio:

Colibri VF61

root@colibri-vf:~# cat /sys/kernel/debug/gpio 
GPIOs 0-31, platform/40049000.gpio, vf610-gpio:
 gpio-8   (AC97 link sdata     ) out lo    
 gpio-9   (AC97 link sync      ) out lo    
 gpio-13  (AC97 link reset     ) out hi    

GPIOs 32-63, platform/4004a000.gpio, vf610-gpio:
 gpio-41  (Wake-Up             ) in  hi IRQ
 gpio-42  (cd                  ) in  lo    
 gpio-45  (backlight           ) out hi    

GPIOs 64-95, platform/4004b000.gpio, vf610-gpio:
 gpio-83  (usbh_vbus           ) out lo    

GPIOs 96-127, platform/4004c000.gpio, vf610-gpio:
 gpio-102 (id                  ) in  hi IRQ

GPIOs 128-159, platform/4004d000.gpio, vf610-gpio:

Colibri iMX6ULL

root@colibri-imx6ull:~# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/209c000.gpio, 209c000.gpio:
gpio-2   (                    |VCC_USB[1-4]        ) out lo
gpio-11  (                    |enable              ) out hi
gpiochip1: GPIOs 32-63, parent: platform/20a0000.gpio, 20a0000.gpio:
gpiochip2: GPIOs 64-95, parent: platform/20a4000.gpio, 20a4000.gpio:
gpio-90  (                    |spi_imx             ) out hi
gpiochip3: GPIOs 96-127, parent: platform/20a8000.gpio, 20a8000.gpio:
gpio-118 (                    |sysfs               ) in  lo
gpio-120 (                    |sysfs               ) out lo
gpiochip4: GPIOs 128-159, parent: platform/20ac000.gpio, 20ac000.gpio:
gpio-128 (                    |cd                  ) in  hi
gpio-129 (                    |Wake-Up             ) in  lo
gpio-130 (                    |id                  ) in  lo
gpio-139 (                    |WIFI_PDN            ) out hi