Skip to content

Commit

Permalink
asus-wmi: don't update power and brightness when using scalar
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Corentin Chary authored and Matthew Garrett committed Mar 26, 2012
1 parent 7a61d02 commit ade28ab
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions drivers/platform/x86/asus-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit ade28ab

Please sign in to comment.