On 09/06/2016 02:12 PM, Andy Fleming wrote: > Boards can implement power and reset functionality over gpio using > these drivers: > drivers/power/reset/gpio-poweroff.c > drivers/power/reset/gpio-restart.c > > While not all corenet boards use gpio for power/reset, this > support can be added without interfering with boards that do not > use this functionality. > > If a board's device tree has the related nodes, they are now probed. > Also, gpio-poweroff uses the global pm_power_off callback to implement > the shutdown. However, pm_power_off was not invoked when the kernel > halted, although that is usually the desired behavior. If the board > provides gpio power and reset support, it is reasonable to assume that > halting should also power down the system, unless it has chosen to > pass those calls on to hypervisor.
Halt and poweroff are not the same thing. If userspace requests a poweroff, then kernel_power_off() will call machine_power_off() which will call pm_power_off(). Why do we need anything corenet-specific here? > @@ -127,6 +137,12 @@ static const struct of_device_id of_device_ids[] = { > { > .name = "handles", > }, > + { > + .name = "gpio-poweroff", > + }, > + { > + .name = "gpio-restart", > + }, > {} > }; > I don't see any other platforms doing this. How do the nodes get probed for them? -Scott