# gpioshutdown availability



## QuesoGrande (Jul 10, 2022)

Some time ago, like several years, there was talk about a kernel module called gpioshutdown at which time it was said to be soon included in the kernel as a matter of course.  I have not seen any more about it lately.  Does anyone know definitively if it was ever included or not, and if not, where it might be available anymore?  It was intended to provide a signal on a gpio pin that shutdown was now complete and power off would be safe.

Thanks!
Queso Grande


----------



## Phishfry (Jul 10, 2022)

misc/raspberrypi-gpioshutdown/
The problem is every ARM architecture is different. BBB had its own PMIC (power management controller).
I don't see a universal module that does what you want because every class board is different.
We are now using GENERICSD images so we are getting away from board specific images which had these helpers.


----------



## Phishfry (Jul 11, 2022)

I really don't think you would need a program or kernel module to do this task.
Make a script called /etc/rc.shutdown.local and use it to drive all gpio LEDs to off.
Wouldn't that work? Give it (x) amount of time (syncing disks on exit) before yanking cord.


----------



## Phishfry (Jul 11, 2022)

Most Arm boards have one or two LED setups.

gpioled(4) are usually assigned to LED's on the board not attached to pins.

Some boards will allow you to control the board LED with regular GPIO schemes and `gpioctl`.
So you can learn how to blink LED for learning without worrying about led voltages and resistors.

There seems to be different approaches depending on the platforms. All are controllable.


----------



## Andriy (Jul 11, 2022)

QuesoGrande, are you thinking about (undocumented) device gpiopower ?


----------



## Phishfry (Jul 11, 2022)

211979 – On Raspberry Pi, GPIO output pins retain state on halt
					






					bugs.freebsd.org


----------



## QuesoGrande (Jul 11, 2022)

Phishfry  Hey thanks for the link!!  looks pretty close to what I am after.  Will look further in a little while , we had a thunderstorm last night and I have some lightning damage to deal with today - only a few machines still running, so network repair is now the priority for a while.  Also, your observation about the R-Pi pins retaining state was exactly what the shutdown module was meant to address ... toggling a pin to inform a power controller that it is now safe to drop power.

Andriy  The reference to gpiopower is interesting.  Any more information about just what it is, where to get it, how to use it, &C.?  

Thanks!!!
QuesoGrande


----------



## Andriy (Jul 11, 2022)

QuesoGrande said:


> Andriy  The reference to gpiopower is interesting.  Any more information about just what it is, where to get it, how to use it, &C.?


If the device tree for a device contains a gpio-poweroff node and there is `device gpiopower` in the kernel configuration, then it should just work.


----------



## QuesoGrande (Jul 12, 2022)

Andriy  OK, I shall see what I can find as soon as I get past the firefight I am in at the moment.  

Thanks much!!


----------

