I am currently in the process of setting up a Gentoo installation with a custom kernel configuration on my Reform with a BananaPi CM4 SoM.
I think I have gotten most of the hardware working, but the power does not get switched off after I shut down the system. I already had a look at the device tree, but I must have overlooked which device/driver is responsible for cutting the power…
Does anyone know by heart which device (and, ideally, which driver in the kernel) is responsible for switching the power off during shutdown?
Any help would be appreciated - thanks in advance.
There used to be a script that the reform-tools package installed into /usr/lib/systemd/system-shutdown/reform-poweroff with the following content:
#!/bin/sh
#
# MNT Reform: Send poweroff command to the system controller via the keyboard
#
sync
if [ "$1" = "halt" ] || [ "$1" = "poweroff" ]; then
for f in /dev/hidraw*; do
[ -c "$f" ] || continue
echo 'xPWR0' > "$f"
done
fi
Since reform-tools version 1.34, this script is replaced by the reform2 lpc dkms module which sends p to the lpc on poweroff. See this commit which adds that functionality to the lpc kernel module: