From patchwork Thu Mar 29 15:53:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brad Figg X-Patchwork-Id: 149426 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 77718B6EE7 for ; Fri, 30 Mar 2012 02:53:23 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SDHf2-0003lF-Vw; Thu, 29 Mar 2012 15:53:17 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SDHf0-0003kJ-T8 for kernel-team@lists.ubuntu.com; Thu, 29 Mar 2012 15:53:14 +0000 Received: from static-50-53-107-235.bvtn.or.frontiernet.net ([50.53.107.235] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SDHf0-0006F7-Hk for kernel-team@lists.ubuntu.com; Thu, 29 Mar 2012 15:53:14 +0000 From: Brad Figg To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/1] UBUNTU: SAUCE (no-up) Provide a param for allowing the BIOS to handle changing the brightness on AC/battery status changes. Date: Thu, 29 Mar 2012 08:53:11 -0700 Message-Id: <1333036391-8876-2-git-send-email-brad.figg@canonical.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1333036391-8876-1-git-send-email-brad.figg@canonical.com> References: <1333036391-8876-1-git-send-email-brad.figg@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com BugLink: http://bugs.launchpad.net/bugs/949311 We currently carry a SAUCE patch which lets the OS handle the brightness levels automatically when connecting/disconnecting AC. There are some laptops (MSI Wind) for which this doesn't work. Provide a driver param which allows this behaviour to be overriden. Signed-off-by: Brad Figg Acked-by: Colin Ian King --- drivers/acpi/video.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index eae12b6..42b226e0 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -73,6 +73,14 @@ static int brightness_switch_enabled = 1; module_param(brightness_switch_enabled, bool, 0644); /* + * The Default is to let the OS handle brightness autoswitching due to + * AC/battery status changes. On some laptops (MSI Wind) this doesn't + * work so we need a workaround. + */ +static int brightness_autoswitch_via_bios = 0; +module_param(brightness_autoswitch_via_bios, bool, 0644); + +/* * By default, we don't allow duplicate ACPI video bus devices * under the same VGA controller */ @@ -1421,7 +1429,7 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) static int acpi_video_bus_start_devices(struct acpi_video_bus *video) { - return acpi_video_bus_DOS(video, 0, 1); + return acpi_video_bus_DOS(video, 0, !brightness_autoswitch_via_bios); } static int acpi_video_bus_stop_devices(struct acpi_video_bus *video)