A311D Custom Kernel: Poweroff on shutdown?

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:

# MNT Reform: Send poweroff command to the system controller via the keyboard


if [ "$1" = "halt" ] || [ "$1" = "poweroff" ]; then
       for f in /dev/hidraw*; do
               [ -c "$f" ] || continue
               echo 'xPWR0' > "$f"

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:


Thanks a lot!

I was looking at the completely wrong place then. I thought it’s some regulator/pinctrl somewhere deep in the DTS that needs a driver I missed.

(Or, well, it wasn’t that far off, given that it’s a kernel module now.)

I’ll try to come up with an ebuild for it and report back once it builds/installs.

Thanks again!

I just had a look at the module you linked. It seems there are two versions of this module on the MNT gitlab, one in lpc · main · Reform / MNT Reform Tools · GitLab and one in reform2-lpc-driver · master · Reform / reform · GitLab. I had installed the version from reform2-lpc-driver, which seems to be a few commits behind the version in MNT Reform Tools.

Now that I installed the newer version of it, from Reform Tools, shutdown is working.