Jump to content

Orange Pi One power switch in next kernel Ubuntu


IgorS

Recommended Posts

Please help, what I am missing?

With legacy kernel installed acpid and pressing power button on OpiOne gives me events (monitoring with acpi_listen).

Same thing not working with next kernel 4.14.18.

Do anybody have solution? 

Link to comment
Share on other sites

Since nothing on the PCB suggests that this button is a power button (and since suspend/resume and wakeup after shutdown is not currently possible) by default it has a different button code: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts#n96

 

It can be changed to KEY_POWER with a custom Device Tree overlay.

Link to comment
Share on other sites

22 minutes ago, zador.blood.stained said:

Since nothing on the PCB suggests that this button is a power button (and since suspend/resume and wakeup after shutdown is not currently possible) by default it has a different button code: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/arch/arm/boot/dts/sun8i-h3-orangepi-one.dts#n96

 

It can be changed to KEY_POWER with a custom Device Tree overlay.

Thank you very much for answer... But I really  don't know how to write such Device Tree overlay. Can you help me with this?

Link to comment
Share on other sites

1 minute ago, IgorS said:

Could I only change pin number in this example?

No since it will conflict with the existing button definition unless you remove it.

 

The DT overlay should probably look like this:

/dts-v1/;
/plugin/;

/ {
  fragment@0 {
    target-path = "/r_gpio_keys/sw4";
    __overlay__ {
      linux,code = <116>;
    };
  };
};

 

Link to comment
Share on other sites

2 minutes ago, zador.blood.stained said:

No since it will conflict with the existing button definition unless you remove it.

 

The DT overlay should probably look like this:


/dts-v1/;
/plugin/;

/ {
  fragment@0 {
    target-path = "/r_gpio_keys/sw4";
    __overlay__ {
      linux,code = <116>;
    };
  };
};

Thanks a lot, I'll try.

 

Link to comment
Share on other sites

Can anybody help, please, I can't figure out how to fix this to work. Despite loaded overlay which change emited code to KEY_POWER on button press, there is no event created in /sys, I think that still something missing. This is beyond of my knowledge so please help.

Link to comment
Share on other sites

I have the same problem. I can not activate the Power button.
I used the following commands:
apt-get install acpid
nano /etc/acpi/events/button_power
write code
event=button/power
action=/sbin/shutdown -h now
and
/etc/init.d/acpid restart
Help me. I'm new to linux

 

I am used Orange PI pc plus

Link to comment
Share on other sites

On 11/10/2018 at 9:48 PM, polop said:

I have the same problem. I can not activate the Power button.
I used the following commands:
apt-get install acpid
nano /etc/acpi/events/button_power
write code
event=button/power
action=/sbin/shutdown -h now
and
/etc/init.d/acpid restart
Help me. I'm new to linux

 

I am used Orange PI pc plus

Solved the problem. Installed the old version of Armbian Xenial :)   https://www.armbian.com/orange-pi-pc-plus/#kernels-archive

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