aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorCorentin Chary <corentincj@iksaif.net>2011-11-26 05:00:00 -0500
committerMatthew Garrett <mjg@redhat.com>2012-03-20 12:02:06 -0400
commitf34cd9ca9320876e9c12764f052004628a03ba2d (patch)
tree2661a5241c3b2255602b46bc12a4b2b80915b29e /drivers/platform/x86
parent5dea7a2094d5e60fe8f8ec4277d22d7ad6fa8c26 (diff)
samsung-laptop: don't handle backlight if handled by acpi/video
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: Corentin Chary <corentincj@iksaif.net> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform/x86')
-rw-r--r--drivers/platform/x86/samsung-laptop.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/platform/x86/samsung-laptop.c b/drivers/platform/x86/samsung-laptop.c
index 1dd81d148cb7..b391a38bc7c0 100644
--- a/drivers/platform/x86/samsung-laptop.c
+++ b/drivers/platform/x86/samsung-laptop.c
@@ -21,6 +21,7 @@
21#include <linux/dmi.h> 21#include <linux/dmi.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/rfkill.h> 23#include <linux/rfkill.h>
24#include <linux/acpi.h>
24 25
25/* 26/*
26 * This driver is needed because a number of Samsung laptops do not hook 27 * This driver is needed because a number of Samsung laptops do not hook
@@ -230,6 +231,7 @@ struct samsung_laptop {
230 struct backlight_device *backlight_device; 231 struct backlight_device *backlight_device;
231 struct rfkill *rfk; 232 struct rfkill *rfk;
232 233
234 bool handle_backlight;
233 bool has_stepping_quirk; 235 bool has_stepping_quirk;
234}; 236};
235 237
@@ -616,6 +618,9 @@ static int __init samsung_backlight_init(struct samsung_laptop *samsung)
616 struct backlight_device *bd; 618 struct backlight_device *bd;
617 struct backlight_properties props; 619 struct backlight_properties props;
618 620
621 if (!samsung->handle_backlight)
622 return 0;
623
619 memset(&props, 0, sizeof(struct backlight_properties)); 624 memset(&props, 0, sizeof(struct backlight_properties));
620 props.type = BACKLIGHT_PLATFORM; 625 props.type = BACKLIGHT_PLATFORM;
621 props.max_brightness = samsung->config->max_brightness - 626 props.max_brightness = samsung->config->max_brightness -
@@ -698,7 +703,8 @@ static void __init samsung_sabi_selftest(struct samsung_laptop *samsung,
698 printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP); 703 printk(KERN_DEBUG "ifaceP = 0x%08x\n", ifaceP);
699 printk(KERN_DEBUG "sabi_iface = %p\n", samsung->sabi_iface); 704 printk(KERN_DEBUG "sabi_iface = %p\n", samsung->sabi_iface);
700 705
701 test_backlight(samsung); 706 if (samsung->handle_backlight)
707 test_backlight(samsung);
702 test_wireless(samsung); 708 test_wireless(samsung);
703 709
704 sabi_get_command(samsung, config->commands.get_brightness, &sretval); 710 sabi_get_command(samsung, config->commands.get_brightness, &sretval);
@@ -771,7 +777,8 @@ static int __init samsung_sabi_init(struct samsung_laptop *samsung)
771 } 777 }
772 778
773 /* Check for stepping quirk */ 779 /* Check for stepping quirk */
774 check_for_stepping_quirk(samsung); 780 if (samsung->handle_backlight)
781 check_for_stepping_quirk(samsung);
775 782
776exit: 783exit:
777 if (ret) 784 if (ret)
@@ -1059,6 +1066,15 @@ static int __init samsung_init(void)
1059 return -ENOMEM; 1066 return -ENOMEM;
1060 1067
1061 mutex_init(&samsung->sabi_mutex); 1068 mutex_init(&samsung->sabi_mutex);
1069 samsung->handle_backlight = true;
1070
1071#ifdef CONFIG_ACPI
1072 /* Don't handle backlight here if the acpi video already handle it */
1073 if (acpi_video_backlight_support()) {
1074 pr_info("Backlight controlled by ACPI video driver\n");
1075 samsung->handle_backlight = false;
1076 }
1077#endif
1062 1078
1063 ret = samsung_platform_init(samsung); 1079 ret = samsung_platform_init(samsung);
1064 if (ret) 1080 if (ret)