eejeel Posted February 17, 2018 Posted February 17, 2018 I'am running a PiOne with 4.14.14 Stretch. I have installed acpid and give the command acpi_listen When pussing the button in Stretch and I didn't see any logging. With the old kernel in 5.38 Jessie on the same PiOne I saw button/power PBTN 00000080 00000000 button/power PBTN 00000080 00000000 button/power PBTN 00000080 00000000 In the output of dtc /boot/dtb/sun8i-h3-orangepi-one.dtb I saw key_pins@0 { pins = "PL3"; function = "gpio_in"; linux,phandle = <0x39>; phandle = <0x39>; }; Means gpio_in defined as an input? Is the button function not yet implemented in 4.14.14? Or is something going wrong?
zador.blood.stained Posted February 17, 2018 Posted February 17, 2018 In mainline kernel DT the onboard button sends the code BTN_0 so it doesn't work as a power button by default. sw4 { label = "sw4"; linux,code = <BTN_0>; gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; }; It can be changed to one of the codes defined here like KEY_POWER, but it will work only for shutdown, there is no suspend/resume or powering on after shutdown support.
eejeel Posted February 17, 2018 Author Posted February 17, 2018 I use this button for shutdown the PiOne. Therefore in the 5.38 Jessie version I have put a file in /etc/acpi/events/button_power File contents: event=button/power action=/sbin/shutdown -h now As written in another forum topic, PiHole is my first and only Linux project. I don't know to implement this. Is it possible that this can be included in one of the next package releases?
zador.blood.stained Posted February 17, 2018 Posted February 17, 2018 1 hour ago, eejeel said: Is it possible that this can be included in one of the next package releases? This button is not labeled "Power" on the PCB or on the schematics so IMO its default function should not be changed. Experienced users can always override this by using DT overlays or button remapping software.
Recommended Posts