Jump to content

Looking for addtional informations about Shutdown-Fragment example


kampi

Recommended Posts

Hi,

 

I use a device tree fragment example for a shutdown button on my Orange Pi One.

 

/dts-v1/;
/plugin/;

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

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			gpio_button_0: gpio_button_0 {
				pins = "PA20";
				function = "gpio_in";
				bias-pull-up;
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			gpio-keys-user {
				compatible = "gpio-keys";
				pinctrl-names = "default";
				pinctrl-0 = <&gpio_button_0>;

				power_button {
					label = "Shutdown button";
					linux,code = <116>; /* KEY_POWER, see include/uapi/linux/input-event-codes.h */
					gpios = <&pio 0 20 1>;
				};
			};
		};
	};
};

 

And I try to understand how this fragment works. AS I understand it right now the fragment uses the existing infrastructure of the SW4. Which parts of the system (driver, etc.) handle the input of the push putton and where can I find some additional informations about it?

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines