lkml.org 
[lkml]   [2012]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] ACPI: Provide config option to control automatic brightness switching
Date
The ACPI backlight driver will optionally automatically respond to ACPI
brightness key events. This is unique amongst backlight drivers and makes
it more difficult for userspace to provide a consistent backlight policy.
Add support for disabling this behaviour by default.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: linux-acpi@vger.kernel.org
Cc: lenb@kernel.org
---
drivers/acpi/Kconfig | 11 +++++++++++
drivers/acpi/video.c | 6 +++++-
2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 5354290..27212e0 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -171,6 +171,17 @@ config ACPI_VIDEO_DISABLE_BIOS_POWER_BRIGHTNESS
Many laptops will automatically change brightness on AC/battery
status changes. Choose Y here to disable this.

+config ACPI_VIDEO_BRIGHTNESS_SWITCH_ENABLED
+ bool "Automatically change brightness on ACPI key events"
+ depends on ACPI_VIDEO
+ default y
+ help
+ If this option is enabled the kernel will change brightness
+ automatically in response to ACPI video key events. If it is
+ disabled, the keys will be reported to userspace but no further
+ action will be taken by the kernel. It is then up to userspace
+ to respond to the events.
+
config ACPI_FAN
tristate "Fan"
select THERMAL
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 4b42938..2b85046 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -69,7 +69,11 @@ MODULE_AUTHOR("Bruno Ducrot");
MODULE_DESCRIPTION("ACPI Video Driver");
MODULE_LICENSE("GPL");

-static bool brightness_switch_enabled = 1;
+#ifdef CONFIG_ACPI_VIDEO_BRIGHTNESS_SWITCH_ENABLED
+static bool brightness_switch_enabled = true;
+#else
+static bool brightness_switch_enabled;
+#endif
module_param(brightness_switch_enabled, bool, 0644);

/*
--
1.7.7.6


\
 
 \ /
  Last update: 2012-02-03 16:21    [W:0.033 / U:1.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site