hwmon: applesmc: restore accelerometer and keyboard backlight on resume
authorHenrik Rydberg <rydberg@euromail.se>
Tue, 22 Sep 2009 00:04:50 +0000 (17:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 22 Sep 2009 14:17:49 +0000 (07:17 -0700)
commita976f150a6953da5ccbd40fa6dba3bd7d56f9f67
tree36c0c1b9d424649421dde1f1d553bd17179a5264
parent560a64a2b501add585b494b2b9cd9f68c0636b50
hwmon: applesmc: restore accelerometer and keyboard backlight on resume

On resume from suspend, the driver currently resets the logical state as
if it was brought up from halt.  This patch uses the
dev_pm_ops.resume/restore methods to synchronize the hardware with the
memorized logical state, in effect bringing back the accelerometer and
backlight to the state prior to suspend.  Works for both suspend to ram
and hibernation.  The patch has zero effect on the running state.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Cc: Nicolas Boichat <nicolas@boichat.ch>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/hwmon/applesmc.c