mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Garrett <mjg@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Matthew Garrett <mjg@redhat.com>,
	linux-acpi@vger.kernel.org, lenb@kernel.org
Subject: [PATCH 2/3] ACPI: Provide config option to control automatic brightness switching
Date: Fri,  3 Feb 2012 10:18:12 -0500	[thread overview]
Message-ID: <1328282293-16551-2-git-send-email-mjg@redhat.com> (raw)
In-Reply-To: <1328282293-16551-1-git-send-email-mjg@redhat.com>

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


  reply	other threads:[~2012-02-03 15:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 15:18 [PATCH 1/3] ACPI: Provide config option to disable BIOS brightness changes on power events Matthew Garrett
2012-02-03 15:18 ` Matthew Garrett [this message]
2012-02-03 15:18 ` [PATCH 3/3] pcie: Add support for setting default ASPM policy Matthew Garrett
2012-02-10 20:31   ` Jesse Barnes
2012-02-17 19:27 ` [PATCH 1/3] ACPI: Provide config option to disable BIOS brightness changes on power events Pavel Machek
2012-02-17 19:37   ` Matthew Garrett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1328282293-16551-2-git-send-email-mjg@redhat.com \
    --to=mjg@redhat.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome