aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 17:20:23 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-28 17:20:23 -0400
commit61e5191c9d96268746bd57ed55d035678a1a2cf9 (patch)
tree5ee75dc9aa9eab9cfc41c9fe0042d15f000ef2e6 /drivers/video/backlight
parentd2a2fc18d98d8ee2dec1542efc7f47beec256144 (diff)
parent86924de2a612b275a45e92ba80d6f47d4e97d620 (diff)
Merge branch 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86
Pull x86 platform driver updates from Matthew Garrett: "Some significant updates to samsung-laptop, additional hardware support for Toshibas, misc updates to various hardware and a new backlight driver for some Apple machines." Fix up trivial conflicts: geode Geos update happening next to net5501 support, and MSIC thermal platform support added twice. * 'for_linus' of git://cavan.codon.org.uk/platform-drivers-x86: (77 commits) acer-wmi: add quirk table for video backlight vendor mode drivers/platform/x86/amilo-rfkill.c::amilo_rfkill_probe() avoid NULL deref samsung-laptop: unregister ACPI video module for some well known laptops acer-wmi: No wifi rfkill on Sony machines thinkpad-acpi: recognize Lenovo as version string in newer V-series BIOS asus-wmi: don't update power and brightness when using scalar eeepc-wmi: split et2012 specific hacks eeepc-wmi: refine quirks handling asus-nb-wmi: set panel_power correctly asus-wmi: move WAPF variable into quirks_entry asus-wmi: store backlight power status for AIO machine asus-wmi: add scalar board brightness adj. support samsung-laptop: cleanup return type: mode_t vs umode_t drivers, samsung-laptop: fix usage of isalnum drivers, samsung-laptop: fix initialization of sabi_data in sabi_set_commandb asus-wmi: on/off bit is not set when reading the value eeepc-wmi: add extra keymaps for EP121 asus-nb-wmi: ignore useless keys acer-wmi: support Lenovo ideapad S205 Brazos wifi switch acer-wmi: fix out of input parameter size when set ...
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r--drivers/video/backlight/apple_bl.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index be98d152b7fd..a523b255e124 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -24,6 +24,7 @@
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/pci.h> 25#include <linux/pci.h>
26#include <linux/acpi.h> 26#include <linux/acpi.h>
27#include <linux/atomic.h>
27 28
28static struct backlight_device *apple_backlight_device; 29static struct backlight_device *apple_backlight_device;
29 30
@@ -221,14 +222,32 @@ static struct acpi_driver apple_bl_driver = {
221 }, 222 },
222}; 223};
223 224
225static atomic_t apple_bl_registered = ATOMIC_INIT(0);
226
227int apple_bl_register(void)
228{
229 if (atomic_xchg(&apple_bl_registered, 1) == 0)
230 return acpi_bus_register_driver(&apple_bl_driver);
231
232 return 0;
233}
234EXPORT_SYMBOL_GPL(apple_bl_register);
235
236void apple_bl_unregister(void)
237{
238 if (atomic_xchg(&apple_bl_registered, 0) == 1)
239 acpi_bus_unregister_driver(&apple_bl_driver);
240}
241EXPORT_SYMBOL_GPL(apple_bl_unregister);
242
224static int __init apple_bl_init(void) 243static int __init apple_bl_init(void)
225{ 244{
226 return acpi_bus_register_driver(&apple_bl_driver); 245 return apple_bl_register();
227} 246}
228 247
229static void __exit apple_bl_exit(void) 248static void __exit apple_bl_exit(void)
230{ 249{
231 acpi_bus_unregister_driver(&apple_bl_driver); 250 apple_bl_unregister();
232} 251}
233 252
234module_init(apple_bl_init); 253module_init(apple_bl_init);