]> 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)
commit2a792fce50e745cd8151da4743bd8829e326fadc
treee4e31ecd7cce17d9716202acdb1da4b3c12b907e
parentdba40f7e666c33023b556c6f48e4e197963f52c7
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