Using gpiolib to power off my system

Juergen Beisert jbe at pengutronix.de
Wed Nov 12 21:51:44 EST 2008


Hi list,

I want to use the gpiolib API in a routine that should poweroff the system 
(MPC5200B). I register my poweroff routine in the define_machine() macro as:

[...]
.power_off	= my_power_off,
[...]

In this routine I'm using gpio_request(...), gpio_direction_output(...) and 
gpio_set_value(...) ---- but nothing happens.

When I set the GPIOs in the hard way (ioremap() + playing with the registers) 
the system switches off as expected.

How to get some useful debug output at this late system state (printk does not 
work anymore)?

Regards,
Juergen
-- 
Dipl.-Ing. Juergen Beisert | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
    Handelsregister: Amtsgericht Hildesheim, HRA 2686
         Vertretung Sued/Muenchen, Germany
   Phone: +49-8766-939 228 |  Fax: +49-5121-206917-9



More information about the Linuxppc-dev mailing list