]> git.baikalelectronics.ru Git - kernel.git/commit
leds: handle suspend/resume in heartbeat trigger
authorLinus Walleij <linus.walleij@linaro.org>
Wed, 8 Jun 2016 08:29:48 +0000 (10:29 +0200)
committerJacek Anaszewski <j.anaszewski@samsung.com>
Wed, 8 Jun 2016 09:47:06 +0000 (11:47 +0200)
commit040813a47d0e3d8ba9b3c7a87ae3f5ee30184a1b
treee4e31ecd7cce17d9716202acdb1da4b3c12b907e
parent6cc0cac138d15b283cfb48bbcf828ee4dec570ff
leds: handle suspend/resume in heartbeat trigger

The following phenomena was observed: when suspending the
system, sometimes the heartbeat LED was left on, glowing and
wasting power while the rest of the system is asleep, also
disturbing power dissapation measures on the odd suspend
cycle when it's left on.

Clearly this is not how we want the heartbeat trigger to
work: it should turn off and leave the LED off during
system suspend.

This removes the heartbeat trigger when preparing suspend and
restores it during resume. The trigger code will make sure all
LEDs are left in OFF state after removing the trigger, and
will re-enable the trigger on all LEDs after resuming.

Cc: linux-pm@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
drivers/leds/trigger/ledtrig-heartbeat.c