NanoPi Duo disable shutdown button


sgjava
 Share

2 2

Recommended Posts

I noticed with the latest bionic image on the Duo it does a soft shutdown when you use the built in button. The problem is I use this button for my own uses. Can this feature be disabled and relinquish control of the button?

gpioinfo | grep k1
	line   3:      unnamed         "k1"   input   active-low [used]

 

Link to post
Share on other sites

Armbian is a community driven open source project. Do you like to contribute your code?

@sgjava the Duo inherits this feature from this node in sun8i-h3-nanopi.dtsi:

	r_gpio_keys {
		compatible = "gpio-keys";
		input-name = "k1";
		pinctrl-names = "default";
		pinctrl-0 = <&sw_r_npi>;

		k1 {
			label = "k1";
			linux,code = <KEY_POWER>;
			gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>;
		};
	};

You could make an overlay to remove this node using the /delete-node/ or /delete-property/ syntax.

See also:

 

Link to post
Share on other sites

For future reference:

  • cd /boot/dtb
  • sudo cp sun8i-h2-plus-nanopi-duo.dtb sun8i-h2-plus-nanopi-duo.dtb.old
  • sudo dtc -@ -I dtb -O dts -o sun8i-h2-plus-nanopi-duo.dts sun8i-h2-plus-nanopi-duo.dtb
  • sudo nano sun8i-h2-plus-nanopi-duo.dts (remove r_gpio_keys section)
  • sudo dtc -@ -I dts -O dtb -o sun8i-h2-plus-nanopi-duo.dtb sun8i-h2-plus-nanopi-duo.dts
  • reboot
Link to post
Share on other sites

This feature has part of the dtsi upstream since the introduction of sunxi-h3-nanopi.dtsi into mainline in 4.10 - IMHO armbian should not deviate from mainline unnecessarily. An overlay to remove the r_gpio_keys node would be a better alternative for usere wanting to use that button for other purposes.

Link to post
Share on other sites

Guest
This topic is now closed to further replies.
 Share

2 2