diff options
author | Seth Forshee <seth.forshee@canonical.com> | 2012-04-19 17:55:35 +0200 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-05-31 20:23:39 +0200 |
commit | 96960880c31131ab906e7e0627ab89e8319c385e (patch) | |
tree | 191d3caccd82265c9b4f38575ec12453fe164b1f /drivers/platform/x86 | |
parent | xo1-rfkill: only act when blocked state is changed (diff) | |
download | linux-96960880c31131ab906e7e0627ab89e8319c385e.tar.xz linux-96960880c31131ab906e7e0627ab89e8319c385e.zip |
apple-gmux: Add suspend/resume support for the backlight
After S3, the brightness might not be restored to the pre-suspend value.
Request status update calls from the backlight core on suspend/resume to
ensure the brightness value is restored.
Reported-and-tested-by: Austin Lund <austin.lund@gmail.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r-- | drivers/platform/x86/apple-gmux.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 8a582bdfdc76..6dcef4f199bb 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -87,6 +87,9 @@ static int gmux_update_status(struct backlight_device *bd) struct apple_gmux_data *gmux_data = bl_get_data(bd); u32 brightness = bd->props.brightness; + if (bd->props.state & BL_CORE_SUSPENDED) + brightness = 0; + /* * Older gmux versions require writing out lower bytes first then * setting the upper byte to 0 to flush the values. Newer versions @@ -102,6 +105,7 @@ static int gmux_update_status(struct backlight_device *bd) } static const struct backlight_ops gmux_bl_ops = { + .options = BL_CORE_SUSPENDRESUME, .get_brightness = gmux_get_brightness, .update_status = gmux_update_status, }; |