summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/asus-wmi.c
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2012-03-20 09:53:14 +0100
committerMatthew Garrett <mjg@redhat.com>2012-03-26 15:05:51 -0400
commitade28abdcb474531bb7045c032a286812c7f6d2a (patch)
treedfd441bfc42ff2d6b30a8e274491801d908e5951 /drivers/platform/x86/asus-wmi.c
parent7a61d0207465e41b7dbe3a25f628ddef24572c6f (diff)
asus-wmi: don't update power and brightness when using scalar
But we can still do it on other boards, as this might happen if the backlight driver change when update_bl is called. Signed-off-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r--drivers/platform/x86/asus-wmi.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index ff9cfd83b09..7d1684bdbf6 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1152,15 +1152,21 @@ static int update_bl_status(struct backlight_device *bd)
ctrl_param, NULL);
if (asus->driver->quirks->store_backlight_power)
asus->driver->panel_power = bd->props.power;
- } else {
- if (asus->driver->quirks->scalar_panel_brightness)
- ctrl_param = get_scalar_command(bd);
- else
- ctrl_param = bd->props.brightness;
- err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BRIGHTNESS,
- ctrl_param, NULL);
+ /* When using scalar brightness, updating the brightness
+ * will mess with the backlight power */
+ if (asus->driver->quirks->scalar_panel_brightness)
+ return err;
}
+
+ if (asus->driver->quirks->scalar_panel_brightness)
+ ctrl_param = get_scalar_command(bd);
+ else
+ ctrl_param = bd->props.brightness;
+
+ err = asus_wmi_set_devstate(ASUS_WMI_DEVID_BRIGHTNESS,
+ ctrl_param, NULL);
+
return err;
}