Jump to content

[Fixed] Clearfog[Pro] Use back-button for powerdown


Heisath

Recommended Posts

Hi,

 

I am currently using the back side push button on my clearfog pro for bringing the device to poweroff / halt.

 

The easiest way to configure it like that seemed to change the button_0 entry in the device tree

From:

button_0 {
	label = "Rear Button";
	gpios = <0x23 0x2 0x1>;
  	linux,can-disable;
  	linux,code = <0x100>;
};

To:

button_0 {
	label = "Rear Button";
	gpios = <0x23 0x2 0x1>;
  	linux,can-disable;
  	linux,code = <0x74>;
};

 

The linux code 0x74 signals the device to perform a graceful shutdown.

 

 

Unfortunately I have to readjust the device tree after every update. I wouldn't suggest to change it to 0x74 for everyone,

but would a config switch or a device tree overlay be possible for that?

I prepared this, but am unsure how to compile / integrate it.

// Switch back button event id
/dts-v1/;
/plugin/;

/ {
	compatible = "solidrun,clearfog-a1", "marvell,armada388", "marvell,armada385", "marvell,armada380";
	
	fragment@0 {
		target = <&button_0>;
		__overlay__ {
			linux,code = <0x74>;	
		};
	};
};

 

 

Greetings,

count-doku

Link to comment
Share on other sites

U-boot overlays are supported only in the mainline u-boot (Armbian "dev" branch, dev u-boot can be used with all kernel branches with some limitations)

Kernel overlays cannot be used since configfs overlays patch was not added to Clearfogs sources.

 

I guess you could use the default button code and just map a shutdown command to it using daemons like "triggerhappy"

 

Link to comment
Share on other sites

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

Important Information

Terms of Use - Privacy Policy - Guidelines