[PATCH 0/5] Power supply and resume ordering meddling

Sean McNeil sean at mcneil.com
Wed Jun 11 01:48:55 CEST 2008

Andy Green wrote:
> Somebody in the thread at some point said:
> |
> |
> | Andy Green wrote:
> |> Somebody in the thread at some point said:
> |>
> |> | I've noticed something else that looks like it could be an hardware
> |> | issue. LEDs are not able to be lit when you are in suspend mode. This
> |> | means you can't indicate a charge if you are plugged in and 
> suspended.
> |> | I can set this capability in my application, but it isn't default
> |> behavior.
> |>
> |> There shouldn't be a hardware issue with LED state surviving suspend if
> |> we wanted it in the LED suspend function.  CPU defines the GPIO will
> |> hold its state during suspend.
> |>
> | Do I have to modify the led class to support this? Is there some
> | standard way to export an interface for this? It would be really nice to
> | be able to setup the LEDs (at least some of them) so that they stay on
> | while in suspend.
> Yes it's in the class stuff I think ---->
> ...
> | Yes, but if, for example, I setup an LED to indicate a message is
> | waiting or the phone is charging and then I initiate a RAM suspend, then
> | the light goes out until I wake from an event.
> It comes from this in ./drivers/leds/led-class.c I guess
> /**
> ~ * led_classdev_suspend - suspend an led_classdev.
> ~ * @led_cdev: the led_classdev to suspend.
> ~ */
> void led_classdev_suspend(struct led_classdev *led_cdev)
> {
>     led_cdev->flags |= LED_SUSPENDED;
>     led_cdev->brightness_set(led_cdev, 0);  <======
> }
> EXPORT_SYMBOL_GPL(led_classdev_suspend);
> If you go around that, the CPU will keep whatever GPIO states you had on
> entry to suspend no problem.
> But there is an argument that sticking LEDs on in suspend is not good,
> it can violate user expectation about battery life while in suspend (ie,
> halve it).  And currently entry to suspend is a user action, he can
> notice LED lit at that time; again currently by definition the
> notificaton cannot be started to be displayed during the time the CPU is
> suspended either... but it can be shown quickly on wake when the user is
> definitely attending to it.
> -Andy
In my application, suspend is not a user action. It occurs when there is 
no event within a specified period of time. Just like any modern screen 
saver. I didn't realize that LEDs were so power hungry. But I would like 
to essentially prevent them from suspending when I am plugged into 
power. How about the timers that they are connected to for a timed 
trigger? I'd assume it is an on or off deal when in suspend and no blinking.


More information about the openmoko-kernel mailing list