Commit 7575321e authored by Corentin Chary's avatar Corentin Chary Committed by Ben Hutchings

samsung-laptop: don't handle backlight if handled by acpi/video

commit f34cd9ca upstream.

samsung-laptop is not at all related to ACPI, but since this interface
is not documented at all, and the driver has to use it at load to
understand how it works on the laptop, I think it's a good idea to
disable it if a better solution is available.
Signed-off-by: default avatarCorentin Chary <corentincj@iksaif.net>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
[bwh: Backported to 3.2:
 - Adjust context, and change return to goto, since we do not have commit
   5dea7a20 ('samsung-laptop: move code into init/exit functions')
 - Use static variable since we do not have commit a6df4894
   ('samsung-laptop: put all local variables in a single structure')]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 582e0a81
......@@ -21,6 +21,7 @@
#include <linux/dmi.h>
#include <linux/platform_device.h>
#include <linux/rfkill.h>
#include <linux/acpi.h>
/*
* This driver is needed because a number of Samsung laptops do not hook
......@@ -226,6 +227,7 @@ static struct backlight_device *backlight_device;
static struct mutex sabi_mutex;
static struct platform_device *sdev;
static struct rfkill *rfk;
static bool handle_backlight;
static bool has_stepping_quirk;
static int force;
......@@ -602,6 +604,15 @@ static int __init samsung_init(void)
int retval;
mutex_init(&sabi_mutex);
handle_backlight = true;
#ifdef CONFIG_ACPI
/* Don't handle backlight here if the acpi video already handle it */
if (acpi_video_backlight_support()) {
pr_info("Backlight controlled by ACPI video driver\n");
handle_backlight = false;
}
#endif
if (!force && !dmi_check_system(samsung_dmi_table))
return -ENODEV;
......@@ -661,6 +672,7 @@ static int __init samsung_init(void)
printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP);
printk(KERN_DEBUG "sabi_iface = %p\n", sabi_iface);
if (handle_backlight)
test_backlight();
test_wireless();
......@@ -680,6 +692,7 @@ static int __init samsung_init(void)
}
/* Check for stepping quirk */
if (handle_backlight)
check_for_stepping_quirk();
/* knock up a platform device to hang stuff off of */
......@@ -687,6 +700,9 @@ static int __init samsung_init(void)
if (IS_ERR(sdev))
goto error_no_platform;
if (!handle_backlight)
goto skip_backlight;
/* create a backlight device to talk to this one */
memset(&props, 0, sizeof(struct backlight_properties));
props.type = BACKLIGHT_PLATFORM;
......@@ -702,6 +718,7 @@ static int __init samsung_init(void)
backlight_device->props.power = FB_BLANK_UNBLANK;
backlight_update_status(backlight_device);
skip_backlight:
retval = init_wireless(sdev);
if (retval)
goto error_no_rfk;
......
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