[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1328282293-16551-2-git-send-email-mjg@redhat.com>
Date: Fri, 3 Feb 2012 10:18:12 -0500
From: Matthew Garrett <mjg@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: Matthew Garrett <mjg@...hat.com>, linux-acpi@...r.kernel.org,
lenb@...nel.org
Subject: [PATCH 2/3] ACPI: Provide config option to control automatic brightness switching
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@...hat.com>
Cc: linux-acpi@...r.kernel.org
Cc: lenb@...nel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists