Jump to content

Recommended Posts

Posted

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]

 

Posted

@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:

 

Posted

OK, I'll need to remember how to decompile and compile the dtb. I've done it before when I wanted to use OTG port on Duo and had to use the FriendlyElec dtb.

 

Posted

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
Posted
3 hours ago, sgjava said:

I'll need to remember how to decompile and compile the dtb

It is better to use "-@" option on "dtc", this is to keep symbols. But it is only available on device-tree-compiler_1.4.7-3_arm64.deb or newer.

Posted

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.

Posted
3 hours ago, karabek said:

An overlay to remove the r_gpio_keys node would be a better alternative for usere wanting to use that button for other purposes.

That should be pretty easy using "/delete-node/" DTS syntax ...

Posted

@martinayotte Can you give me and example of this? I saved off the old dtb and can try the delete node on that. Would be better if you do not have to decompile/remove/compile.

Posted
10 minutes ago, sgjava said:

Can you give me and example of this?

Although not tested, it should be something like this :

/dts-v1/;
/plugin/;

/ {
        compatible = "allwinner,sun8i-h3";

        fragment@0 {
                target-path = "/r_gpio_keys";
                __overlay__ {
                        /delete-node/ k1;
                };
        };

};

 

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines