[PATCH 2/3] ACPI: Provide config option to control automatic brightness switching

From: Matthew Garrett
Date: Fri Feb 03 2012 - 10:18:34 EST

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@xxxxxxxxxx>
Cc: linux-acpi@xxxxxxxxxxxxxxx
Cc: lenb@xxxxxxxxxx
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
Many laptops will automatically change brightness on AC/battery
status changes. Choose Y here to disable this.

+ 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");

-static bool brightness_switch_enabled = 1;
+static bool brightness_switch_enabled = true;
+static bool brightness_switch_enabled;
module_param(brightness_switch_enabled, bool, 0644);


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/