Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sun8i-H3 NanoPi Neo Unable to wake from suspend with Power Button #308

Open
DansDesigns opened this issue Feb 3, 2024 · 0 comments
Open

Comments

@DansDesigns
Copy link

Hello,

NanoPi Neo v1.4 running Armbian 23 with Kernel 6.1.63

I am having trouble getting my Power Button to wake-up the system while asleep, the Power Button will Shutdown the system while it is awake so I'm not sure what is causing the issue..

here is my dt overlay for the Power Button on PG6:

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

	/*
	 * This fragment is needed only for the internal pull-up activation,
	 * external pull-up resistor is highly recommended if using long wires
	 */
	fragment@0 {
		target = <&pio>;
		__overlay__ {
			gpio_button_0: gpio_button_0 {
				pins = "PG6";
				function = "gpio_in";
				bias-pull-up;
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			gpio-keys {
				/*
				 * Use "gpio-keys" for EINT capable pins, "gpio-keys-polled" for other pins
				 * add "poll-interval" property if using "gpio-keys-polled"
				 */
				compatible = "gpio-keys";
				pinctrl-names = "default";
				pinctrl-0 = <&gpio_button_0>;

				power_button {
					label = "GPIO Key Power";
					linux,code = <116>; /* KEY_POWER, see include/uapi/linux/input-event-codes.h */
					gpios = <&pio 6 6 1>; /* PG6 GPIO_ACTIVE_LOW */
				};
			};
		};
	};
};

and here is the udev rule:

ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \
                        SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \
                        ATTRS{keys}=="116", TAG+="power-switch"

Although in (this link for the RaspberryPi) it is mentioned that an entry into /boot/config.txt is needed
(I guess the same on the Armbian NanoPi is /boot/armbianEnv.txt?)

I added the following to my armbianEnv.txt's dtoverlay section gpio-shutdown,gpio_pin=3,active_low=1,gpio_pull=up after the existing dtoverlays but this did nothing to help Resume from Suspend..

any help would be greatly appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant