Reconfigure Power Button to GPIO input

Is it possible to reconfigure the PowerButton (sleep/wake Pin 240 / Jetson Nano) to be a general purpose IO? If so, how best to accomplish this?

Thank you

hello djrichter,

this pin is by default configured as GPIO already.
as you can see, it’s defined in the device tree as following,

        gpio-keys {
                power {
                        label = "Power";
                        gpios = <&gpio TEGRA_GPIO(X, 5) GPIO_ACTIVE_LOW>;
                        linux,code = <KEY_POWER>;

Sorry for being not more specific. How can I access the gpio value similar to the other gpio’s?
export 189 > /sys/class/gpio/export
“write error: Device or resource buys”
cat /sys/class/gpio/gpio189/value

hello djrichter,

this GPIO pin is already occupied as power key.
you may need to revise the device tree to reconfigure this pin.

Looking at the Nvidia PinMux spreadsheet, the Sleep/Wake/pin 240/Button Power pin has 2 possible options: “GPIO3_PX.05” or “unused”. Other pins have multiple options. With GPIO3_PX.05 selected, the pin behavior is power button.

From the stand point, “I don’t know what I don’t know”, can you be more specific?

hello djrichter,

do you have an alternative way to power-on the target?
if yes, you’ll need to remove those gpio-keys device tree definitions, then you should able to toggle PX.05 as GPIO.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.