Commit 07acf62a authored by Michał Kępień's avatar Michał Kępień Committed by Darren Hart (VMware)

platform/x86: fujitsu-laptop: only handle backlight when appropriate

The backlight part of fujitsu-laptop is only used by laptops which are
incapable of using the standard ACPI video interface for handling
brightness changes.  Conversely, on laptops which are capable of using
the latter, no vendor-specific ACPI calls should be made unless
explicitly requested by the user.  Bail out immediately from
acpi_fujitsu_bl_add() unless using the vendor-specific interface was
either explicitly requested by the user or automatically selected by the
kernel.
Signed-off-by: default avatarMichał Kępień <kernel@kempniu.pl>
Reviewed-by: default avatarJonathan Woithe <jwoithe@just42.net>
Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
parent 09b29e1e
......@@ -574,6 +574,9 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
int state = 0;
int error;
if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
return -ENODEV;
if (!device)
return -EINVAL;
......@@ -626,11 +629,9 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
fujitsu_bl->max_brightness = FUJITSU_LCD_N_LEVELS;
get_lcd_level();
if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
error = fujitsu_backlight_register();
if (error)
return error;
}
error = fujitsu_backlight_register();
if (error)
return error;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment